mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] drm/vc4: hdmi: enable scrambling before the TMDS clock starts
@ 2026-10-20 15:19 Lucas Tanure
  2026-10-20 15:19 ` [PATCH v2 1/3] drm/vc4: Implement vc6_hdmi_phy_disable Lucas Tanure
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Lucas Tanure @ 2026-10-20 15:19 UTC (permalink / raw)
  To: Maxime Ripard, Dave Stevenson
  Cc: Dom Cobley, Maíra Canal, Raspberry Pi Kernel Maintenance,
	Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Simona Vetter, dri-devel, linux-kernel

HDMI 2.0 asks the source to set TMDS_Bit_Clock_Ratio in the sink while
the TMDS clock is stopped and to start the clock at least 1 ms later.
vc4 writes the bit, and enables the scrambler, at the end of the enable
sequence, long after the PHY has started, and clears it before the PHY
stops. A sink that samples the bit when the clock appears never locks
a 4K60 signal from a Raspberry Pi 5, while laptops that follow the
order work on the same sink.

Patch 3 is the fix. Patch 1 is needed on BCM2712, where phy_disable()
was an empty stub upstream, so the clock did not stop on disable; the
Raspberry Pi tree has carried this since 2024. Patch 2 fixes a
pre-existing race in the scrambling work cancel that the fix would
otherwise make easier to hit.

v1 was tested on a Raspberry Pi 5 running the Raspberry Pi 6.18 kernel
with the same change applied, against the sink that showed the
problem: plain enable at 4K60, 1080p60 to 4K60, 4K30 to 4K60, a sink
reset and a sink power cycle all lock with zero character errors. v2 is
compile-checked only so far; the hardware test will be repeated and
reported in this thread. Mainline was not booted on the Pi 5. The
BCM2711 path is unchanged except for the enable order; I have no Pi 4
at hand.

Changes in v2:
- Add Dom Cobley's vc6_hdmi_phy_disable() from the Raspberry Pi tree so
  the PHY really stops on BCM2712 before the SCDC bits are cleared.
- Cancel the scrambling work unconditionally with
  cancel_delayed_work_sync(); the pending check skipped a running
  instance that then re-armed itself.
- Enable the controller scrambler at the same point as the sink bits,
  before the PHY starts, instead of leaving it at the end of the enable
  sequence with the sink descrambler already on.
- Drop the extra usleep_range(); drm_scdc_set_high_tmds_clock_ratio()
  already waits.
- v1: https://lore.kernel.org/lkml/20261020134941.631907-1-lucas.tanure@neat.no/

Dom Cobley (1):
  drm/vc4: Implement vc6_hdmi_phy_disable

Lucas Tanure (2):
  drm/vc4: hdmi: always cancel the scrambling work synchronously
  drm/vc4: hdmi: enable scrambling before the TMDS clock starts

 drivers/gpu/drm/vc4/vc4_hdmi.c     | 10 +++++-----
 drivers/gpu/drm/vc4/vc4_hdmi_phy.c |  5 +++++
 2 files changed, 10 insertions(+), 5 deletions(-)

-- 
2.56.0


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

end of thread, other threads:[~2026-10-24 13:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-20 15:19 [PATCH v2 0/3] drm/vc4: hdmi: enable scrambling before the TMDS clock starts Lucas Tanure
2026-10-20 15:19 ` [PATCH v2 1/3] drm/vc4: Implement vc6_hdmi_phy_disable Lucas Tanure
2026-10-24 13:13   ` Maíra Canal
2026-10-20 15:19 ` [PATCH v2 2/3] drm/vc4: hdmi: always cancel the scrambling work synchronously Lucas Tanure
2026-10-24 13:23   ` Maíra Canal
2026-10-20 15:19 ` [PATCH v2 3/3] drm/vc4: hdmi: enable scrambling before the TMDS clock starts Lucas Tanure
2026-10-24 13:34   ` Maíra Canal

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®