Re: [PATCH 0/3] media: ipu3-cio2: support concurrent CSI-2 streams
From: joe . dzado
Date: Fri Oct 30 2026 - 20:25:42 EST
I’ve never submitted a patch before, so I’m not sure if I’m following the right process, but I found something while I was creating a person/gesture detection pipeline on my Surface Laptop (1st generation, 2017) — DMI product_name=Surface Laptop (no "2"+), i5-7200U.
I wanted to use the RGB and IR cameras at the same time and found I could not. So, I got a patch working.
— Joe
> On Oct 30, 2026, at 6:23 PM, Joe Dzado <joe.dzado@xxxxxxxxxx> wrote:
>
> The ipu3-cio2 driver currently assumes a single active capture: every
> stream is pinned to DMA channel 0 (CIO2_DMA_CHAN) and tracked through a
> single cur_queue pointer, with the IRQ handler assuming all completion
> and start-of-frame events belong to that one queue. On platforms with
> more than one sensor wired to separate CSI-2 ports (e.g. the Microsoft
> Surface RGB + IR cameras), starting a second stream reprograms channel 0
> and cur_queue out from under the first, so only one sensor can capture
> at a time.
>
> This series lets the driver use the DMA channels the hardware actually
> has, so multiple sensors can stream concurrently:
>
> 1/3 dispatches interrupts by DMA channel instead of a single cur_queue
> and converts the streaming state to a per-queue count (no
> functional change);
> 2/3 serialises concurrent hw_init()/hw_exit() with a new lock and
> guards the block-shared setup so bringing up a second stream does
> not tear down the first (still single-channel, no functional
> change);
> 3/3 maps each CSI-2 port to its own DMA channel (2*port), with a
> dma_per_port module parameter to restore the old behaviour.
>
> Each patch builds on its own and is bisectable. Tested on a Microsoft
> Surface Laptop (i5-7200U, Kaby Lake) with the OV9734 (colour) and OV7251
> (IR) sensors streaming concurrently on CIO2 ports 1 and 2 for several
> days without errors.
>
> Joe Dzado (3):
> media: ipu3-cio2: track the streaming queue by DMA channel
> media: ipu3-cio2: serialise concurrent stream start and stop
> media: ipu3-cio2: give each CSI-2 port its own DMA channel
>
> drivers/media/pci/intel/ipu3/ipu3-cio2.c | 283 ++++++++++++++---------
> drivers/media/pci/intel/ipu3/ipu3-cio2.h | 10 +-
> 2 files changed, 188 insertions(+), 105 deletions(-)
>
> --
> 2.56.0
>