xf86-video-intel: src/sna/sna_accel.c src/sna/sna_dri2.c src/sna/sna_dri3.c src/sna/sna.h

Chris Wilson ickle at kemper.freedesktop.org
Fri Jun 5 09:44:28 PDT 2015


 src/sna/sna.h       |    2 ++
 src/sna/sna_accel.c |    6 +++---
 src/sna/sna_dri2.c  |    4 ++--
 src/sna/sna_dri3.c  |    2 +-
 4 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 46d74edf991f315319236ba81c6e357e0cb0dddc
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jun 5 17:43:22 2015 +0100

    sna: Only add the COW to the flush write if exported for writing
    
    If the source is only being exported for reading, we can skip adding it
    to the flush list only to perform a no-op.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna.h b/src/sna/sna.h
index 8a40580..34a7881 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -154,6 +154,8 @@ struct sna_pixmap {
 #define MAPPED_GTT 1
 #define MAPPED_CPU 2
 	uint8_t flush :2;
+#define FLUSH_READ 1
+#define FLUSH_WRITE 2
 	uint8_t shm :1;
 	uint8_t clear :1;
 	uint8_t header :1;
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 8a6bf5a..b40b99a 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2046,7 +2046,7 @@ sna_pixmap_make_cow(struct sna *sna,
 		     cow->bo->handle));
 
 		src_priv->cow = MAKE_COW_OWNER(cow);
-		if (src_priv->flush) {
+		if (src_priv->flush & FLUSH_WRITE) {
 			assert(!src_priv->shm);
 			sna_add_flush_pixmap(sna, src_priv, src_priv->gpu_bo);
 		}
@@ -17325,10 +17325,10 @@ void sna_accel_flush(struct sna *sna)
 			     priv->pixmap->drawable.serialNumber));
 			assert(priv->flush);
 			hints = MOVE_READ | __MOVE_FORCE;
-			if (priv->flush & IS_CLIPPED)
+			if (priv->flush & FLUSH_WRITE)
 				hints |= MOVE_WRITE;
 			if (sna_pixmap_move_to_gpu(priv->pixmap, hints)) {
-				if (priv->flush & IS_CLIPPED) {
+				if (priv->flush & FLUSH_WRITE) {
 					kgem_bo_unclean(&sna->kgem, priv->gpu_bo);
 					sna_damage_all(&priv->gpu_damage, priv->pixmap);
 					assert(priv->cpu_damage == NULL);
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 3f63273..65c781c 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -715,14 +715,14 @@ sna_dri2_create_buffer(DrawablePtr draw,
 		if (priv->gpu_bo->exec)
 			sna->kgem.flush = 1;
 
-		priv->flush |= 1;
+		priv->flush |= FLUSH_READ;
 		if (draw->type == DRAWABLE_PIXMAP) {
 			/* DRI2 renders directly into GLXPixmaps, treat as hostile */
 			kgem_bo_unclean(&sna->kgem, priv->gpu_bo);
 			sna_damage_all(&priv->gpu_damage, pixmap);
 			priv->clear = false;
 			priv->cpu = false;
-			priv->flush |= 2;
+			priv->flush |= FLUSH_WRITE;
 		}
 
 		sna_accel_watch_flush(sna, 1);
diff --git a/src/sna/sna_dri3.c b/src/sna/sna_dri3.c
index 1a2ba5d..52ae263 100644
--- a/src/sna/sna_dri3.c
+++ b/src/sna/sna_dri3.c
@@ -55,7 +55,7 @@ static inline void mark_dri3_pixmap(struct sna *sna, struct sna_pixmap *priv, st
 	if (bo->exec)
 		sna->kgem.flush = 1;
 	if (bo == priv->gpu_bo)
-		priv->flush |= 3;
+		priv->flush |= FLUSH_READ | FLUSH_WRITE;
 	else
 		priv->shm = true;
 


More information about the xorg-commit mailing list