mbox series

[0/6] media: rcar-vin: Make use of multiple connections in v4l-async

Message ID 20240129202254.1126012-1-niklas.soderlund+renesas@ragnatech.se
Headers show
Series media: rcar-vin: Make use of multiple connections in v4l-async | expand

Message

Niklas Söderlund Jan. 29, 2024, 8:22 p.m. UTC
Hello,

Since the addition of Gen3 support to rcar-vin the driver have worked
around the limitation in v4l-async that a subdevice could only be bound
to one notifier. This was needed as each VIN instance can be connected
to the same CSI-2 receiver and each capture a different virtual channel.

The workaround was implemented as a single notifier that was registered
by the last VIN driver instance to attach to the device, and
unregistered by the last VIN driver instance to go away. This lead to a
lot of complexities as the driver had to synchronize between them at
different points in the life-cycle (probe, v4l-async complete, remove,
etc).

To complicate things even more some VIN instances had access to its own
private parallel interface that also needed to be a part of the media
graph. This lead to some VIN driver instances having to deal with one
private notifier for the parallel interface and interacting with the
shared group notifier.

The limitation in v4l-async have now been addressed by [1]. This
simplify things quiet a bit for drivers and this series removes the
concept of a shared group notifier and implements a single notifier for
each VIN instance. This single notifier covers both the parallel
interface for the VIN instances that have it and all shared subdevices
that are readable for each VIN. This also simplify the media link
creation.

This series depends on a fix to the v4l-async multiple connections 
posted separately in [2]. Without this fix the probe order can cause 
regressions in functionality if the rcar-vin is not probed after all 
subdevices it depends on.

Patch 1-4 are small preparation patches getting small things out of the 
way while patch 6 is a small post cleanup patch. Patch 5 is the real 
work in this series, it's a bit large but most of it is removal of code 
no longer needed.

Tested on R-Car Gen2 (M2), Gen3 (H3, M3N, V3M), Gen4 (V4H) with latest 
v4l2-compilance and other VIN specific tests without regressions.

The work is based on the latest media-next/master branch.

1. commit 28a1295795d8 ("media: v4l: async: Allow multiple connections
   between entities")

2. [PATCH] media: v4l: async: Fix completion of chained subnotifiers
   https://lore.kernel.org/linux-media/20240129195954.1110643-1-niklas.soderlund+renesas@ragnatech.se/T/#u

Niklas Söderlund (6):
  media: rcar-vin: Move media graph pointers to device info
  media: rcar-vin: Simplify remote source type detection
  media: rcar-vin: Fold simple functions into only caller
  media: rcar-vin: Register the media device together with the group
  media: rcar-vin: Remove the shared group notifier
  media: rcar-vin Rename notifier helper functions

 .../platform/renesas/rcar-vin/rcar-core.c     | 639 +++++++-----------
 .../platform/renesas/rcar-vin/rcar-dma.c      |  48 +-
 .../platform/renesas/rcar-vin/rcar-v4l2.c     |  44 +-
 .../platform/renesas/rcar-vin/rcar-vin.h      |  34 +-
 4 files changed, 289 insertions(+), 476 deletions(-)