drm/vc4: hdmi: Adjust HSM clock rate depending on pixel rate
authorMaxime Ripard <maxime@cerno.tech>
Mon, 10 Feb 2020 14:23:06 +0000 (15:23 +0100)
committerpopcornmix <popcornmix@gmail.com>
Wed, 1 Jul 2020 15:33:40 +0000 (16:33 +0100)
commit48d47307dabb1c257a6abab051fa03294bb9d2fa
treee1d2a4e3aa51f425e08c04e5081ddb61026fce56
parent112e6803aacb3ec39ab3285c24086b7caf1e92cb
drm/vc4: hdmi: Adjust HSM clock rate depending on pixel rate

The HSM clock needs to be setup at around 110% of the pixel rate. This
was done previously by setting the clock rate to 148.5MHz * 108% at
probe time and only check in mode_valid whether the mode pixel clock was
under 148.5MHz or not.

However, with 4k we need to change that frequency to a higher frequency
than 148.5MHz.

Let's change that logic a bit by setting the clock rate of the HSM clock
to the pixel rate at encoder_enable time. This would work for the
BCM2711 that support 4k resolutions and has a clock that can provide it,
but we still have to take care of a 4k panel plugged on a BCM283x SoCs
that wouldn't be able to use those modes, so let's define the limit in
the variant.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/vc4_hdmi.c
drivers/gpu/drm/vc4/vc4_hdmi.h