Skip to content

drm/vc4: hdmi: write SCDC TMDS_Bit_Clock_Ratio before the TMDS clock starts - #7695

Open
lucastanure wants to merge 1 commit into
raspberrypi:rpi-6.18.yfrom
lucastanure:vc4_hdmi_issue_7693
Open

lucastanure wants to merge 1 commit into
raspberrypi:rpi-6.18.yfrom
lucastanure:vc4_hdmi_issue_7693

Conversation

@lucastanure

Copy link
Copy Markdown
Contributor

HDMI 2.0 requires a source to suspend the TMDS clock, write the TMDS_Bit_Clock_Ratio bit in the sink's SCDC registers, wait at least 1 ms and only then resume the clock. vc4 does the opposite: the PHY starts at the new rate first, and the SCDC bits are written tens of milliseconds later from the post-enable step. On disable the bits are cleared while the clock is still running.

Some sinks sample the bit only when the clock appears. One HDMI 2.0 sink we tested then sets up its receiver for a 1/10 clock and never recovers: a Raspberry Pi 5 at 3840x2160@60 shows no picture, while 1080p60 and 4K30 work and other sources work at 4K60 on the same sink. Writing the bit by hand before enabling the output makes the same mode lock every time.

Fixes: c85695a ("drm/vc4: hdmi: Enable the scrambler")
Assisted-by: LLM
Signed-off-by: Lucas Tanure lucas.tanure@neat.no

…starts

HDMI 2.0 requires a source to suspend the TMDS clock, write the
TMDS_Bit_Clock_Ratio bit in the sink's SCDC registers, wait at least
1 ms and only then resume the clock. vc4 does the opposite: the PHY
starts at the new rate first, and the SCDC bits are written tens of
milliseconds later from the post-enable step. On disable the bits are
cleared while the clock is still running.

Some sinks sample the bit only when the clock appears. One HDMI 2.0
sink we tested then sets up its receiver for a 1/10 clock and never
recovers: a Raspberry Pi 5 at 3840x2160@60 shows no picture, while
1080p60 and 4K30 work and other sources work at 4K60 on the same sink.
Writing the bit by hand before enabling the output makes the same mode
lock every time.

Fixes: c85695a ("drm/vc4: hdmi: Enable the scrambler")
Assisted-by: LLM
Signed-off-by: Lucas Tanure <lucas.tanure@neat.no>
@popcornmix

Copy link
Copy Markdown
Collaborator

This looks plausible to me. As we largely use the upstream vc4 driver, it would be best to get this fixed at source.
Are you willing to submit this upstream?
We can backport it downstream once upstream have agreed on the solution.

@lucastanure

Copy link
Copy Markdown
Contributor Author

https://lore.kernel.org/lkml/20261020134941.631907-1-lucas.tanure@neat.no/T/#u

@lucastanure

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants