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

Chris Wilson ickle at kemper.freedesktop.org
Fri Jun 6 03:54:18 PDT 2014


 man/intel.man      |    8 +++++---
 src/sna/sna_dri2.c |   23 ++++++++++++++---------
 2 files changed, 19 insertions(+), 12 deletions(-)

New commits:
commit 0ebcef4f2ebe82e9b90589aa4266a9228e2b5fdb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jun 6 11:39:57 2014 +0100

    man: Update notes about TearFree
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/man/intel.man b/man/intel.man
index 27206e3..9deac41 100644
--- a/man/intel.man
+++ b/man/intel.man
@@ -150,9 +150,11 @@ the screen is then performed synchronously with the vertical refresh of the
 display so that the entire update is completed before the display starts its
 refresh. That is only one frame is ever visible, preventing an unsightly tear
 between two visible and differing frames. Note that this replicates what the
-compositing manager should be doing, so it is not advisable to enable both.
-However, some compositing managers do cause tearing, and if the outputs are
-rotated, there may will still be tearing without TearFree enabled.
+compositing manager should be doing, however TearFree will redirect the
+compositor updates (and those of fullscreen games) directly on to the scanout
+thus incurring no additional overhead in the composited case. Also note that
+not all compositing managers prevent tearing, and if the outputs are
+rotated, there will still be tearing without TearFree enabled.
 .IP
 Default: TearFree is disabled.
 .TP
commit 1f943a7d92d0e3a8895ba7d539cfc5e726bcc8b7
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jun 6 11:25:47 2014 +0100

    sna/dri2: Restore flush on front buffers after swapping bo
    
    Fallout from commit 8369166349c92a20d9a2e7d0256e63f66fe2682b
    Author: Chris Wilson <chris at chris-wilson.co.uk>
    Date:   Wed Jun 4 08:29:51 2014 +0100
    
        sna/dri2: Enable immediate buffer exchanges
    
    We set the flush hint too early, as we may need to swap the GPU bo for a
    more appropriate buffer for DRI.
    
    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 9e591be..e13e626 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -327,13 +327,6 @@ static struct kgem_bo *sna_pixmap_set_dri(struct sna *sna,
 	assert(priv->gpu_bo->proxy == NULL);
 	assert(priv->gpu_bo->flush == false);
 
-	/* Henceforth, we need to broadcast all updates to clients and
-	 * flush our rendering before doing so.
-	 */
-	priv->gpu_bo->flush = true;
-	if (priv->gpu_bo->exec)
-		sna->kgem.flush = 1;
-
 	tiling = color_tiling(sna, &pixmap->drawable);
 	if (tiling < 0)
 		tiling = -tiling;
@@ -377,12 +370,14 @@ sna_dri2_pixmap_update_bo(struct sna *sna, PixmapPtr pixmap, struct kgem_bo *bo)
 	if (private->bo == bo)
 		return;
 
+	DBG(("%s: dropping flush hint from handle=%d\n", __FUNCTION__, private->bo->handle));
 	private->bo->flush = false;
 	kgem_bo_destroy(&sna->kgem, private->bo);
 
 	buffer->name = kgem_bo_flink(&sna->kgem, bo);
 	private->bo = ref(bo);
 
+	DBG(("%s: adding flush hint to handle=%d\n", __FUNCTION__, bo->handle));
 	bo->flush = true;
 	assert(sna_pixmap(pixmap)->flush);
 
@@ -422,6 +417,7 @@ sna_dri2_create_buffer(DrawablePtr draw,
 			     private->bo->handle, buffer->name));
 
 			assert(private->pixmap == pixmap);
+			assert(private->bo->flush);
 			assert(sna_pixmap(pixmap)->flush);
 			assert(sna_pixmap(pixmap)->gpu_bo == private->bo);
 			assert(sna_pixmap(pixmap)->pinned & PIN_DRI2);
@@ -564,6 +560,11 @@ sna_dri2_create_buffer(DrawablePtr draw,
 		 *
 		 * As we don't track which Client, we flush for all.
 		 */
+		DBG(("%s: adding flush hint to handle=%d\n", __FUNCTION__, priv->gpu_bo->handle));
+		priv->gpu_bo->flush = true;
+		if (priv->gpu_bo->exec)
+			sna->kgem.flush = 1;
+
 		priv->flush = true;
 		sna_accel_watch_flush(sna, 1);
 	}
@@ -609,6 +610,7 @@ static void _sna_dri2_destroy_buffer(struct sna *sna, DRI2Buffer2Ptr buffer)
 
 		list_del(&priv->flush_list);
 
+		DBG(("%s: dropping flush hint from handle=%d\n", __FUNCTION__, private->bo->handle));
 		priv->gpu_bo->flush = false;
 		priv->pinned &= ~PIN_DRI2;
 
@@ -617,8 +619,8 @@ static void _sna_dri2_destroy_buffer(struct sna *sna, DRI2Buffer2Ptr buffer)
 
 		sna_pixmap_set_buffer(pixmap, NULL);
 		pixmap->drawable.pScreen->DestroyPixmap(pixmap);
-	} else
-		private->bo->flush = false;
+	}
+	assert(private->bo->flush == false);
 
 	kgem_bo_destroy(&sna->kgem, private->bo);
 	free(buffer);
@@ -691,6 +693,7 @@ static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo)
 	if (priv->move_to_gpu)
 		priv->move_to_gpu(sna, priv, 0);
 	if (priv->gpu_bo != bo) {
+		DBG(("%s: dropping flush hint from handle=%d\n", __FUNCTION__, priv->gpu_bo->handle));
 		priv->gpu_bo->flush = false;
 		if (priv->cow)
 			sna_pixmap_undo_cow(sna, priv, 0);
@@ -698,6 +701,7 @@ static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo)
 			sna_pixmap_unmap(pixmap, priv);
 			kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
 		}
+		DBG(("%s: adding flush hint to handle=%d\n", __FUNCTION__, bo->handle));
 		bo->flush = true;
 		if (bo->exec)
 			sna->kgem.flush = 1;
@@ -705,6 +709,7 @@ static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo)
 	}
 	if (bo->domain != DOMAIN_GPU)
 		bo->domain = DOMAIN_NONE;
+	assert(bo->flush);
 
 	DamageRegionProcessPending(&pixmap->drawable);
 }


More information about the xorg-commit mailing list