xf86-video-intel: 2 commits - src/sna/sna_dri2.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Aug 12 16:25:39 UTC 2016


 src/sna/sna_dri2.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit c8fc7f5e4bdd5b1e3212a226a2873393b5745f14
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Aug 12 17:01:22 2016 +0100

    sna/dri2: Force the render to be flushed after DRI2CopyRegion
    
    After doing the copy, we need to be sure that it is submitted to
    hardware before the reply is sent to the client.
    
    Reported-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
    Fixes: 1f6dfc9df678 ("sna: Only flush GPU bo for a damage event")
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 3328d87..081da91 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -1385,6 +1385,7 @@ __sna_dri2_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region,
 				  dst_draw, dst_bo, dx, dy,
 				  boxes, n, hint);
 
+	sna->needs_dri_flush = true;
 	if (flags & (DRI2_SYNC | DRI2_BO)) { /* STAT! */
 		struct kgem_request *rq = RQ(dst_bo->rq);
 		if (rq && rq != (void *)&sna->kgem) {
commit 8586813169e6be75f93e3e15620fbb4e72912515
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Aug 12 17:01:22 2016 +0100

    sna/dri2: Force the render to be flushed before reporting new buffers
    
    When filling out the set of buffers for the DRI2GetBuffers request,
    ensure that any pending rendering to them is flushed to hardware.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 876a909..3328d87 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -434,25 +434,29 @@ sna_dri2_swap_limit_validate(DrawablePtr draw, int swap_limit)
 static void
 sna_dri2_reuse_buffer(DrawablePtr draw, DRI2BufferPtr buffer)
 {
+	struct sna *sna = to_sna_from_drawable(draw);
+
 	DBG(("%s: reusing buffer pixmap=%ld, attachment=%d, handle=%d, name=%d\n",
 	     __FUNCTION__, get_drawable_pixmap(draw)->drawable.serialNumber,
 	     buffer->attachment, get_private(buffer)->bo->handle, buffer->name));
 	assert(get_private(buffer)->refcnt);
 	assert(get_private(buffer)->bo->refcnt >= get_private(buffer)->bo->active_scanout);
-	assert(kgem_bo_flink(&to_sna_from_drawable(draw)->kgem, get_private(buffer)->bo) == buffer->name);
+	assert(kgem_bo_flink(&sna->kgem, get_private(buffer)->bo) == buffer->name);
 
 	if (buffer->attachment == DRI2BufferBackLeft &&
 	    draw->type != DRAWABLE_PIXMAP) {
 		DBG(("%s: replacing back buffer on window %ld\n", __FUNCTION__, draw->id));
-		sna_dri2_get_back(to_sna_from_drawable(draw), draw, buffer);
+		sna_dri2_get_back(sna, draw, buffer);
 
 		assert(get_private(buffer)->bo->refcnt);
 		assert(get_private(buffer)->bo->active_scanout == 0);
-		assert(kgem_bo_flink(&to_sna_from_drawable(draw)->kgem, get_private(buffer)->bo) == buffer->name);
+		assert(kgem_bo_flink(&sna->kgem, get_private(buffer)->bo) == buffer->name);
 		DBG(("%s: reusing back buffer handle=%d, name=%d, pitch=%d, age=%d\n",
 		     __FUNCTION__, get_private(buffer)->bo->handle,
 		     buffer->name, buffer->pitch, buffer->flags));
 	}
+
+	kgem_bo_submit(&sna->kgem, get_private(buffer)->bo);
 }
 
 static bool swap_limit(DrawablePtr draw, int limit)


More information about the xorg-commit mailing list