Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
* [PATCH v1 0/6] media: imx-mipi-csis: Add streams support
@ 2025-11-07  1:58 Laurent Pinchart
  2025-11-07  1:58 ` [PATCH v1 1/6] media: imx-mipi-csis: Add VC-related register fields Laurent Pinchart
                   ` (6 more replies)
  0 siblings, 7 replies; 26+ messages in thread
From: Laurent Pinchart @ 2025-11-07  1:58 UTC (permalink / raw)
  To: linux-media
  Cc: Rui Miguel Silva, Martin Kepplinger, Purism Kernel Team,
	Pengutronix Kernel Team, imx, Frank Li, Stefan Klug, Sakari Ailus

Hello,

The reference manual for the NXP i.MX7D in which the CSIS is integrated
lists four outputs named "channels" in various diagrams and tables, but 
only documents registers for channel 0. Reference manuals for i.MX8 SoCs
that integrate the CSIS gradually removed mentions of channels 1 to 3 as
newer revisions of the documents got released, which was interpreted as
an indication that the CSIS has only a single output.

That interpretation turned out not to be correct. In the i.MX8MP, the
CSIS features multiple output channels. Channel 0 is connected to the
ISI, and channels 0, 1 and 2 are connected to the ISP. Multi-channel
support towards the ISP is meant to support HDR, where camera sensors
transmit multiple exposures or gains over different virtual channels.
The glue logic between the CSIS and ISP hardcodes this use case and
combines the channels in a way suitable for the ISP's single input port.

With a time machine, we would probably redesign the CSIS DT bindings to
model each output channel with a port, and the V4L2 subdev would use
multiple source pads. Without a time machine, we need to preserve
backward compatibility with userspace. Not only would the addition of
new ports and pads make this tricky, they would also require modelling
the glue logic between the CSIS and ISP with a subdev. This would
conflict with the need to preserve backward compatibility.

Fortunately for us, the CSIS is an old IP. The NXP i.MX9 series uses a
different CSI-2 receiver, and the probability of needing to support an
SoC that connects different output channels to different devices is
extremely low. We can therefore implement a solution tailored to the
needs of the i.MX8MP, and model the output channels as separate streams
instead of separate pads. Should the need arise in the future to support
connecting output channels to different devices in a new SoC, we will
still be able to model this with extra ports in the device tree without
breaking backward compatibility. The driver could then create extra
subdev pads accordingly.

The series starts with 5 preparatory patches to ease review. Patch 1/6
adds missing register definitions. Patch 2/6 then switches from
.s_stream() to .enable_streams() and .disable_streams(), a pre-requisite
for multi-stream support. Patch 3/6 follows by implementing the
.s_routing() operation, supporting a single route exactly as done
implicitly so far. Patches 4/6 and 5/6 refactor the code to group
parameters in structures and clean up how they are written to registers.
Finally, patch 6/6 adds multi-channel support.

The series has been tested on an i.MX8MP with libcamera, both without
changes to verify that backward compatibility is preserved, and with HDR
support (work still in progress) to verify that VC filtering works as
expected.

Laurent Pinchart (6):
  media: imx-mipi-csis: Add VC-related register fields
  media: imx-mipi-csis: Switch to .enable_streams()
  media: imx-mipi-csis: Implement the .set_routing() operation
  media: imx-mipi-csis: Group runtime parameters in structure
  media: imx-mipi-csis: Set all per-channel registers in one function
  media: imx-mipi-csis: Add multi-channel support

 drivers/media/platform/nxp/imx-mipi-csis.c | 551 ++++++++++++++++-----
 1 file changed, 429 insertions(+), 122 deletions(-)


base-commit: dcb6fa37fd7bc9c3d2b066329b0d27dedf8becaa
-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2025-12-02  1:00 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-07  1:58 [PATCH v1 0/6] media: imx-mipi-csis: Add streams support Laurent Pinchart
2025-11-07  1:58 ` [PATCH v1 1/6] media: imx-mipi-csis: Add VC-related register fields Laurent Pinchart
2025-11-07 16:19   ` Frank Li
2025-11-07 18:44     ` Laurent Pinchart
2025-11-07 20:37       ` Frank Li
2025-11-07  1:58 ` [PATCH v1 2/6] media: imx-mipi-csis: Switch to .enable_streams() Laurent Pinchart
2025-11-07 16:29   ` Frank Li
2025-11-07 18:32     ` Laurent Pinchart
2025-11-07  1:58 ` [PATCH v1 3/6] media: imx-mipi-csis: Implement the .set_routing() operation Laurent Pinchart
2025-11-07 16:36   ` Frank Li
2025-11-07 18:30     ` Laurent Pinchart
2025-11-07 20:38       ` Frank Li
2025-11-09 21:48   ` kernel test robot
2025-11-07  1:58 ` [PATCH v1 4/6] media: imx-mipi-csis: Group runtime parameters in structure Laurent Pinchart
2025-11-07 16:40   ` Frank Li
2025-11-07  1:58 ` [PATCH v1 5/6] media: imx-mipi-csis: Set all per-channel registers in one function Laurent Pinchart
2025-11-07 16:37   ` Frank Li
2025-11-07  1:58 ` [PATCH v1 6/6] media: imx-mipi-csis: Add multi-channel support Laurent Pinchart
2025-11-07 16:48   ` Frank Li
2025-11-07 18:43     ` Laurent Pinchart
2025-11-20  3:12     ` G.N. Zhou
2025-11-20 15:23       ` Frank Li
2025-11-20 16:22       ` Laurent Pinchart
2025-12-02  0:59         ` [EXT] " G.N. Zhou
2025-11-07  9:31 ` [PATCH v1 0/6] media: imx-mipi-csis: Add streams support Martin Kepplinger
2025-11-07 18:28   ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox