xf86-video-intel: src/sna/sna_dri.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Jul 19 16:23:15 PDT 2013


 src/sna/sna_dri.c |   39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

New commits:
commit 65a09436e6aef9fe0518e322f92e601d5d3f46c1
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jul 20 00:20:09 2013 +0100

    sna/dri: Fix the strict blitting check not to assume the dst is the front buffer
    
    In order to allow the case for copying onto a target other than the
    front buffer, such as the fake front buffer for example.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 3cceebe..94721ba 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -911,17 +911,18 @@ can_blit(struct sna *sna,
 	if (draw->type == DRAWABLE_PIXMAP)
 		return true;
 
-#ifdef STRICT_BLIT
-	if (get_private(dst)->pixmap != get_drawable_pixmap(draw)) {
-		DBG(("%s: reject as dst pixmap=%ld, but expecting pixmap=%ld\n",
-		     __FUNCTION__,
-		     get_private(dst)->pixmap ? get_private(dst)->pixmap->drawable.serialNumber : 0,
-		     get_drawable_pixmap(draw)->drawable.serialNumber));
-		return false;
+	if (STRICT_BLIT && dst->attachment == DRI2BufferFrontLeft) {
+		if (get_private(dst)->pixmap != get_drawable_pixmap(draw)) {
+			DBG(("%s: reject as dst pixmap=%ld, but expecting pixmap=%ld\n",
+						__FUNCTION__,
+						get_private(dst)->pixmap ? get_private(dst)->pixmap->drawable.serialNumber : 0,
+						get_drawable_pixmap(draw)->drawable.serialNumber));
+			return false;
+		}
+
+		assert(sna_pixmap(get_private(dst)->pixmap)->flush);
 	}
 
-	assert(sna_pixmap(get_private(dst)->pixmap)->flush);
-#endif
 	assert(get_private(dst)->bo->flush);
 	assert(get_private(src)->bo->flush);
 
@@ -994,11 +995,11 @@ sna_dri_copy_region(DrawablePtr draw,
 	dst = get_private(dst_buffer)->bo;
 	if (dst_buffer->attachment == DRI2BufferFrontLeft) {
 		copy = (void *)sna_dri_copy_to_front;
-#ifndef STRICT_BLIT
-		dst = sna_pixmap_get_bo(pixmap);
-		if (dst == NULL)
-			return;
-#endif
+		if (!STRICT_BLIT) {
+			dst = sna_pixmap_get_bo(pixmap);
+			if (dst == NULL)
+				return;
+		}
 	}
 
 	DBG(("%s: dst -- attachment=%d, name=%d, handle=%d [screen=%d]\n",
@@ -1011,11 +1012,11 @@ sna_dri_copy_region(DrawablePtr draw,
 	if (src_buffer->attachment == DRI2BufferFrontLeft) {
 		assert(copy == sna_dri_copy);
 		copy = sna_dri_copy_from_front;
-#ifndef STRICT_BLIT
-		src = sna_pixmap_get_bo(pixmap);
-		if (src == NULL)
-			return;
-#endif
+		if (!STRICT_BLIT) {
+			src = sna_pixmap_get_bo(pixmap);
+			if (src == NULL)
+				return;
+		}
 	}
 
 	DBG(("%s: src -- attachment=%d, name=%d, handle=%d\n",


More information about the xorg-commit mailing list