mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] media: rcar-isp: Add NV12M support and fix stride
@ 2026-10-19 19:35 Niklas Söderlund
  2026-10-19 19:35 ` [PATCH 1/4] media: rcar-isp: ispcore: Honour requested bytesperline on RAW input Niklas Söderlund
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Niklas Söderlund @ 2026-10-19 19:35 UTC (permalink / raw)
  To: Jacopo Mondi, Jai Luthra, Niklas Söderlund,
	Mauro Carvalho Chehab, Geert Uytterhoeven, Magnus Damm,
	Barnabás Pőcze, Yusuke Goda, Yuya Hamamachi
  Cc: linux-media, linux-kernel, linux-renesas-soc, Niklas Söderlund

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@ragnatech.se>
---
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@ragnatech.se>


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

end of thread, other threads:[~2026-10-20 15:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-19 19:35 [PATCH 0/4] media: rcar-isp: Add NV12M support and fix stride Niklas Söderlund
2026-10-19 19:35 ` [PATCH 1/4] media: rcar-isp: ispcore: Honour requested bytesperline on RAW input Niklas Söderlund
2026-10-20  9:36   ` Barnabás Pőcze
2026-10-20 13:44     ` Niklas Söderlund
2026-10-20 15:25       ` Barnabás Pőcze
2026-10-20 15:51         ` Niklas Söderlund
2026-10-19 19:35 ` [PATCH 2/4] media: rcar-isp: ispcore: Update image data flush settings Niklas Söderlund
2026-10-20 10:19   ` Barnabás Pőcze
2026-10-20 13:40     ` Niklas Söderlund
2026-10-19 19:35 ` [PATCH 3/4] media: rcar-isp: ispcore: Look at number of planes when programming Niklas Söderlund
2026-10-20 10:26   ` Barnabás Pőcze
2026-10-19 19:35 ` [PATCH 4/4] media: rcar-isp: ispcore: Add NV12M support Niklas Söderlund

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

all inboxes | Powered by JetHome®