[PATCH 0/4] media: rcar-isp: Add NV12M support and fix stride

From: Niklas Söderlund

Date: Mon Oct 19 2026 - 15:37:35 EST


Hello,

The main part of this series aims to add NV12M output format support and
there is a small drive-by fix to honor the image stride from input
images in patch 1/4.

Patch 2/4 address a confusion around how much data was needed to flush
out all pixels to the output buffer. Later versions of the datasheet
makes it use clear and how it relates to image strides. This is needed
for NV12M support as we need to tightly control it to generate valid
NV12M frames.

Patch 3/4 is a quality of life fix where the current driver looks at the
pixelformat to figure out how many planes are used. As it only supports
RGB (1 plane) and NV16M (2 plane) this worked, but before adding NV12M
(2 plane) look at the correct field so we don't have to maintain a list
of pixelformats that have two planes ourself.

Finally patch 4/4 adds NV12M support. Enabling support for it is
straightforward but one snag around how the DMA-engine works.

When the DMA-engine is configured to only output CbCr data from odd or
even lines it still outputs blanks pixels to the buffer for the line
where no data is taken.

To work around this and still produce valid NV12 frames the device needs
to be configured so all blank pixels written to the buffer are part of
the line padding. In addition to also keeping the same number of padding
bytes as the Y plane.

The DMA-engine is able to do this as we can set different strides for
the two planes and haw two DMA-engine lines (one with data + some
padding and one with only padding) make up a single correctly formatted
NV12 CbCr line.

For readers comparing the DMA configuration with the datasheet this
driver takes the CbCr data from even lines, compared to odd lines in the
datasheet example. The reason for this is that if odd lines are used the
first even line adds half a NV12 line of padding at the start of the
CbCr plane. To counter this the CbCr plane would need a padding line at
the start of the plane which is not supported, or we would need to set
the plane start address half a line before the buffer actually starts
and potentially corrupt memory as we write blank bytes outside our
buffer.

Tested on V4H SparrowHawk without any regressions and the output frames
looks good.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>
---
Niklas Söderlund (3):
media: rcar-isp: ispcore: Update image data flush settings
media: rcar-isp: ispcore: Look at number of planes when programming
media: rcar-isp: ispcore: Add NV12M support

Yuya Hamamachi (1):
media: rcar-isp: ispcore: Honour requested bytesperline on RAW input

drivers/media/platform/renesas/rcar-isp/core-io.c | 78 +++++++++++++++++++++--
drivers/media/platform/renesas/rcar-isp/core.c | 45 ++++++++++++-
2 files changed, 115 insertions(+), 8 deletions(-)
---
base-commit: d7e7bca7169873b46e857c025c10f3336c1258d8
change-id: 20261015-v4l2-add-nv12-9358df2bf649

Best regards,
--
Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>