drm/i915: WARN if primary plane state doesn't match expectations
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 1 Oct 2013 15:02:20 +0000 (18:02 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 10 Oct 2013 10:47:03 +0000 (12:47 +0200)
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c

index a2acf79..2e3289c 100644 (file)
@@ -1840,6 +1840,8 @@ static void intel_enable_primary_plane(struct drm_i915_private *dev_priv,
        /* If the pipe isn't enabled, we can't pump pixels and may hang */
        assert_pipe_enabled(dev_priv, pipe);
 
+       WARN(!intel_crtc->primary_disabled, "Primary plane already enabled\n");
+
        intel_crtc->primary_disabled = false;
 
        reg = DSPCNTR(plane);
@@ -1868,6 +1870,8 @@ static void intel_disable_primary_plane(struct drm_i915_private *dev_priv,
        int reg;
        u32 val;
 
+       WARN(intel_crtc->primary_disabled, "Primary plane already disabled\n");
+
        intel_crtc->primary_disabled = true;
 
        reg = DSPCNTR(plane);