drm/i915/skl: Assume no scaling is available when things are not as expected
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 20 Oct 2015 16:17:07 +0000 (17:17 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 21 Oct 2015 06:45:15 +0000 (08:45 +0200)
Cdclk < crtc_clock is not allowed and suggests a different problem
elsewhere in the code.

It is more robust and safe to assume no scaling is possible in
this case with no other downsides since it will also WARN_ON_ONCE
so that this definitely gets noticed.

Call it an assert to help new platform bring-up in simulation.

v2: Better commit msg and use WARN_ON_ONCE to signify the unexpectedness.

v3: Move zero crtc_clock check under the warn. (Ville)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c

index f5a3c1e25db98c670c243e5dd1f5ebe5141c9ba0..c1ac8ae69541c09cac7b08b4134d70629d9cdcf6 100644 (file)
@@ -13453,7 +13453,7 @@ skl_max_scale(struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state
        crtc_clock = crtc_state->base.adjusted_mode.crtc_clock;
        cdclk = to_intel_atomic_state(crtc_state->base.state)->cdclk;
 
-       if (!crtc_clock || !cdclk)
+       if (WARN_ON_ONCE(!crtc_clock || cdclk < crtc_clock))
                return DRM_PLANE_HELPER_NO_SCALING;
 
        /*