diff mbox

[19/21] drm/i915: Enable the use of GPU semaphores whilst page-flipping

Message ID 1302945465-32115-20-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson April 16, 2011, 9:17 a.m. UTC
The 2D driver unfortunately uses the BLT ring in order to perform blits,
and will often blit between buffers in the course of a pageflip. (Though
usually it is from the post-flipped scanout to the window frontbuffer
for reasons known only to itself, maintaining the front buffer in case
of 2D access one presumes.)

As such, being able to use a GPU semaphore and not stall the CPU/GPU
whilst switching between rings for a pageflip is useful.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

Comments

Daniel Vetter April 16, 2011, 1:58 p.m. UTC | #1
On Sat, Apr 16, 2011 at 10:17:43AM +0100, Chris Wilson wrote:
> The 2D driver unfortunately uses the BLT ring in order to perform blits,
> and will often blit between buffers in the course of a pageflip. (Though
> usually it is from the post-flipped scanout to the window frontbuffer
> for reasons known only to itself, maintaining the front buffer in case
> of 2D access one presumes.)
> 
> As such, being able to use a GPU semaphore and not stall the CPU/GPU
> whilst switching between rings for a pageflip is useful.

Hey, we could issue flips on the blt ring .... <CARRIER LOST>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Chris Wilson April 16, 2011, 2:20 p.m. UTC | #2
On Sat, 16 Apr 2011 15:58:52 +0200, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Sat, Apr 16, 2011 at 10:17:43AM +0100, Chris Wilson wrote:
> > As such, being able to use a GPU semaphore and not stall the CPU/GPU
> > whilst switching between rings for a pageflip is useful.
> 
> Hey, we could issue flips on the blt ring .... <CARRIER LOST>

I hear that one day that may even be supported in hardware! What dreams we
have!
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 801496a..fe45f4e 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3217,11 +3217,9 @@  i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj,
 	if (ret)
 		return ret;
 
-	if (pipelined != obj->ring) {
-		ret = i915_gem_object_wait_rendering(obj);
-		if (ret)
-			return ret;
-	}
+	ret = i915_gem_object_move_to_ring(obj, pipelined);
+	if (ret)
+		return ret;
 
 	/* The display engine is not coherent with the LLC cache on gen6.  As
 	 * a result, we make sure that the pinning that is about to occur is