drm/vc4: kms: Use maximum FIFO load for the HVS clock rate
authorMaxime Ripard <maxime@cerno.tech>
Wed, 13 Apr 2022 14:22:49 +0000 (16:22 +0200)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Fri, 22 Apr 2022 09:17:27 +0000 (10:17 +0100)
commit4517b3f4dd0f66592f82e5d1de5358097b9b0a14
treed348aca8d6f418f2785f7c6cc9f7b6ae01ef2155
parent6fd2deea9e82370d719a1c8c1b2c48558db4fff5
drm/vc4: kms: Use maximum FIFO load for the HVS clock rate

The core clock computation takes into account both the load due to the
input (ie, planes) and its output (ie, encoders).

However, while the input load needs to consider all the planes, and thus
sum all of their associated loads, the output happens mostly in
parallel.

Therefore, we need to consider only the maximum of all the output loads,
and not the sum like we were doing. This resulted in a clock rate way
too high which could be discarded for being too high by the clock
framework.

Since recent changes, the clock framework will even downright reject it,
leading to a core clock being too low for its current needs.

Fixes: 16e101051f32 ("drm/vc4: Increase the core clock based on HVS load")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/vc4_kms.c