diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c index 276c3a6a916832c40da7337d9d3dc2b30a4ffe04..d19146992f3495902106f6bc5c0c8e49b3cbc99c 100644 --- a/drivers/gpu/drm/i915/intel_sprite.c +++ b/drivers/gpu/drm/i915/intel_sprite.c @@ -526,11 +526,11 @@ intel_enable_primary(struct drm_crtc *crtc) intel_crtc->primary_disabled = false; + I915_WRITE(reg, I915_READ(reg) | DISPLAY_PLANE_ENABLE); + mutex_lock(&dev->struct_mutex); intel_update_fbc(dev); mutex_unlock(&dev->struct_mutex); - - I915_WRITE(reg, I915_READ(reg) | DISPLAY_PLANE_ENABLE); } static void @@ -544,13 +544,14 @@ intel_disable_primary(struct drm_crtc *crtc) if (intel_crtc->primary_disabled) return; - I915_WRITE(reg, I915_READ(reg) & ~DISPLAY_PLANE_ENABLE); - intel_crtc->primary_disabled = true; mutex_lock(&dev->struct_mutex); - intel_update_fbc(dev); + if (dev_priv->fbc.plane == intel_crtc->plane) + intel_disable_fbc(dev); mutex_unlock(&dev->struct_mutex); + + I915_WRITE(reg, I915_READ(reg) & ~DISPLAY_PLANE_ENABLE); } static int