From: Ville Syrjälä Date: Mon, 28 Apr 2014 12:53:25 +0000 (+0300) Subject: drm/i915: Remove useless checks from primary enable/disable X-Git-Tag: next-20140502~50^2~15 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e9e39655c0c30cddc3f8c09a757678a24dd36737;p=karo-tx-linux.git drm/i915: Remove useless checks from primary enable/disable We won't be calling intel_enable_primary_plane() or intel_disable_primary_plane() with the primary plane in the wrong state. So remove the useless DISPLAY_PLANE_ENABLE checks. v2: Convert the checks to WARNs instead (Daniel,Paulo) Signed-off-by: Ville Syrjälä Reviewed-by: Paulo Zanoni Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index c529ae6eb2eb..0a2be20cac69 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -1886,8 +1886,7 @@ static void intel_enable_primary_hw_plane(struct drm_i915_private *dev_priv, reg = DSPCNTR(plane); val = I915_READ(reg); - if (val & DISPLAY_PLANE_ENABLE) - return; + WARN_ON(val & DISPLAY_PLANE_ENABLE); I915_WRITE(reg, val | DISPLAY_PLANE_ENABLE); intel_flush_primary_plane(dev_priv, plane); @@ -1916,8 +1915,7 @@ static void intel_disable_primary_hw_plane(struct drm_i915_private *dev_priv, reg = DSPCNTR(plane); val = I915_READ(reg); - if ((val & DISPLAY_PLANE_ENABLE) == 0) - return; + WARN_ON((val & DISPLAY_PLANE_ENABLE) == 0); I915_WRITE(reg, val & ~DISPLAY_PLANE_ENABLE); intel_flush_primary_plane(dev_priv, plane);