From 850ee0f1539d50d7d0a2132e3081adac84e92013 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 7 Jul 2011 07:51:43 +0100 Subject: [PATCH] drm/i915: Disable FBC across page-flipping Page-flipping updates the scanout address and nukes the FBC compressed image and forces an update so that the displayed image remains consistent. However, page-flipping does not update the FBC registers themselves, which remain pointing to both the old address and the old CPU fence! This first approach to demonstrate the issue, simply disables FBC upon page-flip (a recompression will be forced on every flip so FBC becomes immaterial) and then re-enables FBC in the page-flip finish work function, so that the registers are now pointing to the new framebuffer. Ideally, we want to only re-enable FBC after page-flipping is complete, as otherwise we are just wasting cycles (with an undesirable wait-for-vblank) and power (with needless recompression) whilst the page-flipping application is still running. Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/intel_display.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 6071d2e..7bb6b16 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -6135,6 +6135,7 @@ static void intel_unpin_work_fn(struct work_struct *__work) drm_gem_object_unreference(&work->pending_flip_obj->base); drm_gem_object_unreference(&work->old_fb_obj->base); + intel_update_fbc(work->dev); mutex_unlock(&work->dev->struct_mutex); kfree(work); } @@ -6499,6 +6500,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, if (ret) goto cleanup_pending; + intel_disable_fbc(dev); mutex_unlock(&dev->struct_mutex); trace_i915_flip_request(intel_crtc->plane, obj); -- 1.7.6