drm/i915: Fix cdclk vs. dev_cdclk mess when not recomputing things
authorVille Syrjälä <[email protected]>
Mon, 14 Nov 2016 16:35:09 +0000 (18:35 +0200)
committerVille Syrjälä <[email protected]>
Wed, 23 Nov 2016 20:19:22 +0000 (22:19 +0200)
When we end up not recomputing the cdclk, we need to populate
intel_state->cdclk with the "atomic_cdclk_freq" instead of the
current cdclk_freq. When no pipes are active, the actual cdclk_freq
may be lower than what the configuration of the planes and
pipes would require from the point of view of the software state.

This fixes bogus WARNS from skl_max_scale() which is trying to check
the plane software state against the cdclk frequency. So any time
it got called during DPMS off for instance, we might have tripped
the warn if the current mode would have required a higher than
minimum cdclk.

v2: Drop the dev_cdclk stuff (Maarten)

Cc: Maarten Lankhorst <[email protected]>
Cc: Mika Kahola <[email protected]>
Cc: [email protected]
Cc: Daniel J Blueman <[email protected]>
Cc: Paul Bolle <[email protected]>
Cc: Joseph Yasi <[email protected]>
Tested-by: Paul Bolle <[email protected]>
Tested-by: Joseph Yasi <[email protected]> (v1)
Cc: [email protected]
Fixes: 1a617b77658e ("drm/i915: Keep track of the cdclk as if all crtc's were active.")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98214
Signed-off-by: Ville Syrjälä <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/i915/intel_display.c

index f1966fe3dfbe7ef8b70c8ee2493235008bd8e0b6..383775e0658a3ed423a9694e4b0e36d9b5af83aa 100644 (file)
@@ -13995,8 +13995,9 @@ static int intel_modeset_checks(struct drm_atomic_state *state)
 
                DRM_DEBUG_KMS("New cdclk calculated to be atomic %u, actual %u\n",
                              intel_state->cdclk, intel_state->dev_cdclk);
-       } else
+       } else {
                to_intel_atomic_state(state)->cdclk = dev_priv->atomic_cdclk_freq;
+       }
 
        intel_modeset_clear_plls(state);
 
@@ -14097,8 +14098,9 @@ static int intel_atomic_check(struct drm_device *dev,
 
                if (ret)
                        return ret;
-       } else
-               intel_state->cdclk = dev_priv->cdclk_freq;
+       } else {
+               intel_state->cdclk = dev_priv->atomic_cdclk_freq;
+       }
 
        ret = drm_atomic_helper_check_planes(dev, state);
        if (ret)