OSDN Git Service

drm/vc4: hdmi: Fix hdmi_enable_4kp60 detection
authorMaxime Ripard <maxime@cerno.tech>
Thu, 27 Oct 2022 12:52:44 +0000 (14:52 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Fri, 28 Oct 2022 11:03:19 +0000 (13:03 +0200)
commitdd51d3a33c10925b20d4b9b665a6f4a65f24ca67
tree8c453ab87d9f2e98bac8614da8406a6349b697da
parent40c31955e4e9ff268d21c0a8009e35f4cfaa167c
drm/vc4: hdmi: Fix hdmi_enable_4kp60 detection

In order to support higher HDMI frequencies, users have to set the
hdmi_enable_4kp60 parameter in their config.txt file.

We were detecting this so far by calling clk_round_rate() on the core
clock with the frequency we're supposed to run at when one of those
modes is enabled. Whether or not the parameter was enabled could then be
inferred by the returned rate since the maximum clock rate reported by
the firmware was one of the side effect of setting that parameter.

However, the recent clock rework we did changed what clk_round_rate()
was returning to always return the minimum allowed, and thus this test
wasn't reliable anymore.

Let's use the new clk_get_max_rate() function to reliably determine the
maximum rate allowed on that clock and fix the 4k@60Hz output.

Fixes: e9d6cea2af1c ("clk: bcm: rpi: Run some clocks at the minimum rate allowed")
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220815-rpi-fix-4k-60-v5-4-fe9e7ac8b111@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/vc4_hdmi.c