Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Tighting frontbuffer tracking around flips
@ 2014-09-30 20:10 Daniel Vetter
  2014-09-30 20:10 ` [PATCH 2/2] drm/i915: spelling fixes for frontbuffer tracking kerneldoc Daniel Vetter
  2014-09-30 20:26 ` [PATCH 1/2] drm/i915: Tighting frontbuffer tracking around flips Paulo Zanoni
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Vetter @ 2014-09-30 20:10 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

So I think I've spotted a small gap in the frontbuffer tracking
while discussing the logic with Paulo on irc:

1. Userspace schedules gpu rendering to the current frontbuffer.
This gets tracked in dev_priv->fb_tracking.busy_bits.

2. We pageflip a fully rendered buffer before the frontbuffer
rendering completes.

3. The request retiring will never clear busy_bits (since at retire
time the old frontbuffer won't have obj->frontbuffer_bits set), so
these bits now are stuck until someone again does a bit of frontbuffer
tracking.

If we clear stale busy_bits in flip_prepare this gap is closed.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_frontbuffer.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_frontbuffer.c b/drivers/gpu/drm/i915/intel_frontbuffer.c
index f74744c091cb..969af6e7b634 100644
--- a/drivers/gpu/drm/i915/intel_frontbuffer.c
+++ b/drivers/gpu/drm/i915/intel_frontbuffer.c
@@ -246,8 +246,9 @@ void intel_frontbuffer_flip_prepare(struct drm_device *dev,
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
 	mutex_lock(&dev_priv->fb_tracking.lock);
-	dev_priv->fb_tracking.flip_bits
-		|= frontbuffer_bits;
+	dev_priv->fb_tracking.flip_bits |= frontbuffer_bits;
+	/* Remove stale busy bits due to the old buffer. */
+	dev_priv->fb_tracking.busy_bits &= ~frontbuffer_bits;
 	mutex_unlock(&dev_priv->fb_tracking.lock);
 }
 
-- 
2.1.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-10-01  8:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-30 20:10 [PATCH 1/2] drm/i915: Tighting frontbuffer tracking around flips Daniel Vetter
2014-09-30 20:10 ` [PATCH 2/2] drm/i915: spelling fixes for frontbuffer tracking kerneldoc Daniel Vetter
2014-09-30 20:34   ` Paulo Zanoni
2014-10-01  8:13     ` Daniel Vetter
2014-09-30 20:26 ` [PATCH 1/2] drm/i915: Tighting frontbuffer tracking around flips Paulo Zanoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox