intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 6/8] drm/i915: Disable FBC across page-flipping
Date: Fri,  8 Jul 2011 12:22:41 +0100	[thread overview]
Message-ID: <1310124163-12177-7-git-send-email-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <1310124163-12177-1-git-send-email-chris@chris-wilson.co.uk>

Page-flipping updates the scanout address, nukes the FBC compressed
image and so forces an FBC 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. Future updates to the new front-buffer (scanout) are then
undetected!

This first approach to demonstrate the issue and highlight the fix,
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 FBC registers are now
pointing to the new framebuffer and front-buffer rendering works once
more.

Ideally, we want to only re-enable FBC after page-flipping is complete,
as otherwise we are just wasting cycles and power (with needless
recompression) whilst the page-flipping application is still running.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33487
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 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 9df96bd..f0788a9 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6333,6 +6333,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);
 }
@@ -6697,6 +6698,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.5.4

  parent reply	other threads:[~2011-07-08 11:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-08 11:22 FBC patchset Chris Wilson
2011-07-08 11:22 ` [PATCH 1/8] drm/i915: Only export the generic intel_disable_fbc() interface Chris Wilson
2011-07-08 11:22 ` [PATCH 2/8] drm/i915: Replace direct calls to vfunc.disable_fbc with intel_disable_fbc() Chris Wilson
2011-07-08 11:22 ` [PATCH 3/8] drm/i915: Remove vestigial pitch from post-gen2 FBC control routines Chris Wilson
2011-07-08 17:20   ` Keith Packard
2011-07-08 11:22 ` [PATCH 4/8] drm/i915: Use of a CPU fence is mandatory to update FBC regions upon CPU writes Chris Wilson
2011-07-08 11:22 ` [PATCH 5/8] drm/i915: Set persistent-mode for ILK/SNB framebuffer compression Chris Wilson
2011-07-08 11:22 ` Chris Wilson [this message]
2011-07-08 11:22 ` [PATCH 7/8] drm/i915: Perform intel_enable_fbc() from a delayed task Chris Wilson
2011-07-08 11:22 ` [PATCH 8/8] drm/i915: Share the common work of disabling active FBC before updating Chris Wilson
2011-07-08 19:43 ` FBC patchset Chris Wilson
2011-07-08 20:00   ` Keith Packard
2011-07-08 20:19     ` Chris Wilson
2011-07-08 21:28       ` Keith Packard
2011-07-08 22:08         ` Chris Wilson
2012-01-17 16:18   ` Daniel Vetter
2012-01-17 16:57     ` Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1310124163-12177-7-git-send-email-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).