OSDN Git Service

drm/vc4: Make sure we don't end up with a core clock too high
authorMaxime Ripard <maxime@cerno.tech>
Thu, 27 Oct 2022 12:52:47 +0000 (14:52 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Fri, 28 Oct 2022 11:03:20 +0000 (13:03 +0200)
commitfc04142894d1d970e21c6ab3ab663aa51c5a8b7b
tree444ca86f90c4ab813f11c54b1ef01f1b9de0450b
parentf09e172da85854d71284638d8ca25f0b3a980cb6
drm/vc4: Make sure we don't end up with a core clock too high

Following the clock rate range improvements to the clock framework,
trying to set a disjoint range on a clock will now result in an error.

Thus, we can't set a minimum rate higher than the maximum reported by
the firmware, or clk_set_min_rate() will fail.

Thus we need to clamp the rate we are about to ask for to the maximum
rate possible on that clock.

Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220815-rpi-fix-4k-60-v5-7-fe9e7ac8b111@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/vc4_kms.c