On Thu, 5 Nov 2026 at 01:01, Cristian Ciocaltea <[email protected]> wrote: > The HDMI PHY PLL can only be used as DCLK source while the HDMI link > operates in TMDS mode, i.e. for TMDS character rates up to 600 MHz. > Beyond that, HDMI 2.1 FRL is required, in which case the PLL would run > at the link rate and VOP2 must keep using the system CRU. > > Currently, this is decided by reconstructing the TMDS character rate > from the DCLK rate and the color depth, i.e. DCLK * bpc / 8, which does > not hold for all possible output configurations: > > - YUV422 always transmits two 12-bit components per clock cycle, > regardless of the color depth, which from a clock-rate perspective is > equivalent to three 8-bit RGB components. For example, 4K@60Hz 10-bit > YUV422 requires the same bandwidth as 4K@60Hz 8-bit RGB, typically 594 > MHz. However, VOP2 wrongly assumes it needs 742.5 MHz (594 * 10 / 8) > and ends up switching the DCLK source. As a consequence, modes > requiring uncommon pixel clocks, such as those corresponding to > fractional refresh rates, will fail. An example is [email protected], > which would likely rely on a 593.407 MHz clock rate, unsupported by > the system CRU. > > - When VOP2 processes multiple pixels per clock cycle, DCLK is only a > fraction of the pixel clock, e.g. RK3576 halves it for pixel clocks > above 600 MHz. Hence, an FRL mode such as 4K@120Hz 8-bit RGB, with a > pixel clock of 1188 MHz, ends up with a 594 MHz DCLK, which slips > under the limit and wrongly selects the HDMI PHY PLL as DCLK source. > > In preparation for supporting the use cases above, rework the DCLK > source switch logic to check the TMDS character rate computed by the > HDMI connector state helpers, which already accounts for the output > color format and depth. Keep using the system CRU when the rate is not > available. > > While at it, drop the VOP2_MAX_DCLK_RATE define in favor of the generic > HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ, since the 600 MHz limit applies to the > TMDS character rate rather than to DCLK.
Reviewed-by: Daniel Stone <[email protected]>
