mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Sascha Hauer" <s.hauer@pengutronix.de>
To: "Hans Verkuil" <hverkuil+cisco@kernel.org>
Cc: "Sascha Hauer" <s.hauer@pengutronix.de>,
	"Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Hans Verkuil" <hverkuil@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Dingxian Wen" <shawn.wen@rock-chips.com>,
	"Shreeya Patel" <shreeya.patel@collabora.com>,
	"Gerald Loacker" <gerald.loacker@wolfvision.net>,
	"Lucas Sinn" <lucas.sinn@wolfvision.net>,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	kernel@collabora.com, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org,
	"Conor Dooley" <conor.dooley@microchip.com>
Subject: Re: [PATCH v3 00/10] media: synopsys: hdmirx: support an HDMI bridge in front of the receiver
Date: Mon, 16 Nov 2026 15:13:52 +0000	[thread overview]
Message-ID: <ebff012d-7857-4aa2-a8a0-38b5b59128d4@pengutronix.de> (raw)
In-Reply-To: <5042d545-24ae-4567-a39c-a28bcb1d1ed1@kernel.org>

On 2026-11-13 10:01, Hans Verkuil wrote:
> Hi Sascha,
> 
> On 05/10/2026 15:28, Sascha Hauer wrote:
> > The Synopsys HDMI receiver driver assumes the HDMI connector belongs to
> > it: the connector's +5V line arrives on hpd-gpios, and there is nothing
> > between the source and the receiver. On the board this series comes from
> > that is not the case. An HDMI bridge owns the connector, the receiver
> > sits behind it, and the two are described by an OF graph endpoint.
> > 
> > Three things follow from that, and the series is arranged in that order.
> > 
> > Patch 1 comes before them and is a fix for the driver as it is. The
> > driver data is devm allocated, but an open file descriptor keeps the
> > video device alive past unbind, so the last close works on freed memory.
> > The media device the series adds would have been torn down the same way,
> > which is why the fix leads the series. It stands on its own and is
> > marked for stable.
> > 
> > Patches 2-3 give the driver a media device and register the video device
> > as an entity with a sink pad. On their own they add a graph with one node
> > in it; they exist so that there is somewhere for the bridge to appear.
> > 
> > Patches 4-5 add the endpoint to the binding and bind the remote subdev
> > through a v4l2 async notifier, linking its source pad to the receiver's
> > sink pad. Such a board cannot provide hpd-gpios, so the binding requires
> > either hpd-gpios or the port. Without an endpoint in the device tree the
> > driver keeps working exactly as before, so boards wired straight to the
> > connector are unaffected.
> > 
> > Patch 6 is fallout from the wait for signal lock, which was bounded by an
> > iteration count whose duration came from the 5V debounce it called
> > each time round. That debounce goes away on a board with no hpd-gpios
> > later in the series, so the wait gets a real timeout first.
> > 
> > Patches 7-10 are the 5V state itself. Patch 7 stops probe requiring an
> > interrupt for hpd-gpios. Patch 8 makes v4l2_device_unregister_subdev()
> > wait for notifications already in flight. Nothing kept a subdev from
> > notifying a v4l2_device that was unbinding it; that is not new with this
> > series, as asynchronously bound subdevs sending V4L2_EVENT_SOURCE_CHANGE
> > race the same way today. Patch 9 adds V4L2_DEVICE_NOTIFY_RX_POWER_PRESENT,
> > and patch 10 has the receiver set v4l2_dev.notify and take the state from
> > whatever is bound in front of it. The notification is only an edge, as
> > the 5V interrupt is with hpd-gpios: the hotplug worker then asks the
> > subdev through g_input_status(), so nothing is cached that could go
> > stale against bind or unbind. Without a det_irq there is nothing to
> > disable across suspend and remove either, so patch 10 disables the
> > hotplug work items themselves instead of cancelling them. Patch 8 is
> > what lets the notify callback read sd->v4l2_dev while the subdev is
> > being unbound.
> > 
> > V4L2_CID_DV_RX_POWER_PRESENT is otherwise the only place this state is
> > published - adv7604, adv7842, tc358743 and tda1997x all set that control
> > from their cable detect interrupt and stop there - while a format change
> > already gets an in-kernel notification through v4l2_subdev_notify_event().
> > An earlier version of this series hooked the control with
> > v4l2_ctrl_notify() instead. That reaches into another device's control
> > handler, and the only thing it bought was working with those four
> > drivers unmodified, which turns out to be worth nothing: they are HDMI
> > sinks, so none of them could sit in front of an HDMI receiver anyway.
> > 
> > Nothing in tree sends the new notification yet. The driver for the device
> > on this board does, and the alternative was a mechanism that no in-tree
> > driver could have used either.
> > 
> > There is no in-tree device tree using the new port yet: the board is not
> > upstream, and the device in front of the receiver, a Lontium LT86102UXE
> > 1:2 HDMI splitter, has no driver upstream either. I would rather send the
> > infrastructure for review now than sit on it until the board lands.
> > 
> > Tested on that board, and build tested for arm64 at each patch with W=1.
> > 
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> 
> As mentioned in my reply to patch 1/10 I'll take that one. But for the remaining
> 9 patches I need to see the 'v4l2-compliance -m /dev/mediaX -s' output to make
> sure the media device topology is sane and streaming works as expected.
> 
> Use the v4l2-compliance version from the v4l-utils git repo so you have the latest
> code.
> 
> I also need more time to review the v4l2 core notify patches. Apologies for not
> doing that sooner, I hadn't noticed before that this series made core changes as well.
> 
> I haven't looked at that notify code for years, so I will need to refresh my
> memory.
> 
> My plan is to merge patch 1/10 today in our next branch. It is probably best
> if you post a v4 rebased to that and including the v4l2-compliance output in
> the cover letter.

Thanks for looking into this. I'll send a rebased v4 shortly. The
v4l2-compliance test works on this v3 already.

Sascha

--
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


      reply	other threads:[~2026-11-16 15:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05 13:28 Sascha Hauer
2026-10-05 13:28 ` [PATCH v3 01/10] media: synopsys: hdmirx: free the driver data when the last user is gone Sascha Hauer
2026-10-07 11:20   ` Dmitry Osipenko
2026-10-16 11:06     ` Sascha Hauer
2026-11-04 14:18       ` Dmitry Osipenko
2026-11-13  8:44         ` Hans Verkuil
2026-11-16 15:10           ` Sascha Hauer
2026-10-05 13:28 ` [PATCH v3 02/10] media: synopsys: hdmirx: add media device infrastructure Sascha Hauer
2026-11-04 14:11   ` Dmitry Osipenko
2026-10-05 13:28 ` [PATCH v3 03/10] media: synopsys: hdmirx: add media entity for video capture device Sascha Hauer
2026-11-04 14:11   ` Dmitry Osipenko
2026-10-05 13:28 ` [PATCH v3 04/10] dt-bindings: media: snps,dw-hdmi-rx: add a port for a bridge in front Sascha Hauer
2026-11-04 14:11   ` Dmitry Osipenko
2026-11-04 14:12   ` Dmitry Osipenko
2026-10-05 13:28 ` [PATCH v3 05/10] media: synopsys: hdmirx: add async subdevice support Sascha Hauer
2026-11-04 14:12   ` Dmitry Osipenko
2026-10-05 13:28 ` [PATCH v3 06/10] media: synopsys: hdmirx: give the signal lock wait a real timeout Sascha Hauer
2026-11-04 14:12   ` Dmitry Osipenko
2026-10-05 13:28 ` [PATCH v3 07/10] media: synopsys: hdmirx: skip the 5V detect interrupt without a GPIO Sascha Hauer
2026-11-04 14:12   ` Dmitry Osipenko
2026-10-05 13:28 ` [PATCH v3 08/10] media: v4l2-device: wait for notifications when unregistering a subdev Sascha Hauer
2026-10-05 13:28 ` [PATCH v3 09/10] media: v4l2-subdev: notify the bridge when the source power changes Sascha Hauer
2026-10-05 13:28 ` [PATCH v3 10/10] media: synopsys: hdmirx: get the 5V state from the upstream subdev Sascha Hauer
2026-11-04 14:12   ` Dmitry Osipenko
2026-11-13  9:01 ` [PATCH v3 00/10] media: synopsys: hdmirx: support an HDMI bridge in front of the receiver Hans Verkuil
2026-11-16 15:13   ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ebff012d-7857-4aa2-a8a0-38b5b59128d4@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=conor+dt@kernel.org \
    --cc=conor.dooley@microchip.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.osipenko@collabora.com \
    --cc=gerald.loacker@wolfvision.net \
    --cc=hverkuil+cisco@kernel.org \
    --cc=hverkuil@kernel.org \
    --cc=kernel@collabora.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=lucas.sinn@wolfvision.net \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=shawn.wen@rock-chips.com \
    --cc=shreeya.patel@collabora.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®