Re: [PATCH 0/2] media: imx6: Support complex external topologies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Laurent,

I've already done this work, see [1]. The fwnode related changes are awaiting an ack from Sakari.

It fixes this stuff the right way in my opinion. The patchset relies on the subdevs to create links to their discovered upstream subdevs, via the subdev notifier's bound callbacks. In other words it comprehensively accomplishes the distributed link creation that you're partially doing here.

If you were to implement .get_fwnode_pad in the smiapp driver, and use patchset [1], I think it should resolve the issues with smiapp subdev, or any other subdevs with complex internal topologies (another example I can think of is the adv748x). Specifically see [2] which will create the link to smiapp in the mipi csi-2 receiver's bound callback with the help of a new helper function imx_media_create_fwnode_pad_link().

Steve

[1] https://patchwork.linuxtv.org/patch/61927/
[2] https://patchwork.linuxtv.org/patch/61936/


On 4/12/20 6:14 PM, Laurent Pinchart wrote:
Hello,

This small patch series adds support to the i.MX6 IPU CSI driver for
external (on-board) devices that exhibit complex topologies. My use case
is a CSI-2 camera sensor that has a single DT node (as an I2C device)
and creates two V4L2 subdevs. "Complex" may thus be a bit of an
exageration, but the series nonetheless makes such a sensor usable with
the driver.

There are two issues, fixed by two patches. Patch 1/2 removes the
assumption that OF port ids and pad indices are equivalent. This holds
true in many cases, but is incorrect in my case, with the topology being

+------------+       +--------------+       +---------------------+
|  Sensor   _|       |_   Sensor   _|       |_                    |
| Subdev A |0| ----> |0| Subdev B |1| ----> |0| imx6-mipi-csi2 ...|
|           ¯|       |¯            ¯|       |¯                    |
+------------+       +--------------+       +---------------------+

while the sensor has a single DT node with a single port. The IPU CSI
driver then tries to connect 'Sensor Subdev B':0 to 'imx6-mipi-csi2':0,
which isn't right.

The fix isn't perfect, as we ideally need media entity operations to
handle the translation between port ids and pad indices. Nonetheless,
the heuristic in patch 1/2 should cover most, if not all, use cases and
is in my opinion a good way forward.

Patch 2/2 then stops creating links between external entities. The IPU
CSI driver iterates over the list of subdevs registered with the V4L2
device, and creates links based on the OF graph for all of them. That's
fine for devices internal to the i.MX6, but is oversteps the driver's
responsibility as links between external entities are supposed to be
handled by their respective driver. In my use case, the driver attempts
to link 'Sensor Subdev A' by checking OF graph connections in DT, which
results in 'Sensor Subdev A':0 being linked to 'imx6-mipi-csi2':0. The
patch skips external entities for link creation, which fixes the issue.
The link between the closest external entities and the internal entities
are still created by the IPU CSI driver as part of link creation for all
internal entities.

Laurent Pinchart (2):
   media: staging/imx: Don't assume OF port id equals pad index
   media: staging/imx: Don't create links between external entities

  drivers/staging/media/imx/imx-media-csi.c     | 29 ++++++++++-
  .../staging/media/imx/imx-media-dev-common.c  |  7 +--
  drivers/staging/media/imx/imx-media-of.c      | 52 ++++++++++++++++---
  drivers/staging/media/imx/imx-media.h         |  1 +
  4 files changed, 75 insertions(+), 14 deletions(-)





[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux