drm/vc4: kms: Avoid setting core and disp clocks for hdmi modes
authorDom Cobley <popcornmix@gmail.com>
Mon, 17 Jul 2023 16:45:32 +0000 (17:45 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:35:01 +0000 (11:35 +0000)
On 2712, the firmware always runs these clock at a speed sufficient
for dual 4kp60.

The requests here prevent the gpu from going into its lowest voltage
mode, so just skip the clock requests.

With this applied the idle voltage on my pi 5 reduces from 0.7424V
to 0.72V.

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
drivers/gpu/drm/vc4/vc4_kms.c

index c1c0a26..6548cdc 100644 (file)
@@ -429,7 +429,7 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state)
                old_hvs_state->fifo_state[channel].pending_commit = NULL;
        }
 
-       if (vc4->gen >= VC4_GEN_5 && !vc4->firmware_kms) {
+       if (vc4->gen == VC4_GEN_5 && !vc4->firmware_kms) {
                unsigned long state_rate = max(old_hvs_state->core_clock_rate,
                                               new_hvs_state->core_clock_rate);
                unsigned long core_rate = clamp_t(unsigned long, state_rate,
@@ -483,7 +483,7 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state)
 
        drm_atomic_helper_cleanup_planes(dev, state);
 
-       if (vc4->gen >= VC4_GEN_5 && !vc4->firmware_kms) {
+       if (vc4->gen == VC4_GEN_5 && !vc4->firmware_kms) {
                unsigned long core_rate = min_t(unsigned long,
                                                hvs->max_core_rate,
                                                new_hvs_state->core_clock_rate);