mbox series

[v6,00/13] media: rcar-vin: Unify notifiers and enable MC on Gen2

Message ID 20250613153434.2001800-1-niklas.soderlund+renesas@ragnatech.se
Headers show
Series media: rcar-vin: Unify notifiers and enable MC on Gen2 | expand

Message

Niklas Söderlund June 13, 2025, 3:34 p.m. UTC
Hello,

This series completes the conversion of the soc_camera VIN driver to a
full fledge media-graph enabled driver for R-Car Gen2 devices, Gen3 and
later have been media-graph centric from the start. Having a single
driver supporting both MC and non-MC operation have lead do odd design
decisions in the driver, and it have prevented improving the driver over
all.

New features and bug fixes have always been more important then fixing
this old generation to be MC-centric. But in order to start to play with
libcamera support for the R-Car pipeline it have become more pressing to
make take the time to make this driver MC-only, and more importantly
test it to make sure nothing really breaks.

Patch 1/13, 2/13 3/13 and 4/13 are drive-by fixes correcting issues in the
existing design. Patch 5/13 prepares for Gen2 MC by making sure each VIN
instance on Gen2 gets a unique ID which will be needed to support VIN
groups. Compared to Gen3 and later the group ID does not match what it
can do in the group and does not need to be set from DT, all that
matters is that each VIN instance have a unique ID.

Patch 6/13, 7/13 and 8/13 uses the fact that VIN instances on Gen2 now
have unique IDs and greatly simplifies the unnecessarily complex
vl4-async notifier usage in the VIN driver. This have in the past lead
to some subtle bugs and having only a single notifier for all VIN will
remove a lot of possibilities for this to go wrong in the future.

Patch 9/13 10/13 and 11/13 make to adapt Gen2 to MC in incremental steps
to ease review. These two patches where previously part of a larger
one-patch to change it all (now 12/13). There is on state of the series
with 11/13 applied where controls from the sub-device are not exposed to
user-space that is then addressed in 12/13.

Finally patch 12/13 removes all non MC code paths and have the Gen2
devices register a media device and configure links. While patch 13/13
is a small cleanup that was previously part of 12/13.

This have been tested on Gen3 and Gen4 devices without any regressions.
And on Gen2 to make sure the media-graph behaves as it should. As a
bonus the Gen2 devices can now join the VIN CI and any future issues
should be caught as they are for Gen3 and Gen4.

See individual patches for changelog.

Niklas Söderlund (13):
  media: rcar-vin: Use correct count of remote subdevices
  media: rcar-vin: Store platform info with group structure
  media: rcar-vin: Change link setup argument
  media: rcar-vin: Use error labels in probe
  media: rcar-vin: Generate a VIN group ID for Gen2
  media: rcar-vin: Prepare for unifying all v4l-async notifiers
  media: rcar-vin: Improve error paths for parallel devices
  media: rcar-vin: Merge all notifiers
  media: rcar-vin: Always create a media pad
  media: rcar-vin: Remove NTSC workaround
  media: rcar-vin: Only expose VIN controls
  media: rcar-vin: Enable media-graph on Gen2
  media: rcar-vin: Fold event notifier into only user

 .../platform/renesas/rcar-vin/rcar-core.c     | 696 +++++++-----------
 .../platform/renesas/rcar-vin/rcar-dma.c      |  23 +-
 .../platform/renesas/rcar-vin/rcar-v4l2.c     | 490 +-----------
 .../platform/renesas/rcar-vin/rcar-vin.h      |  16 +-
 4 files changed, 295 insertions(+), 930 deletions(-)