xf86-video-intel: src/sna/gen6_render.c src/sna/gen7_render.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Dec 4 09:29:45 PST 2012


 src/sna/gen6_render.c |    7 ++++---
 src/sna/gen7_render.c |    7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit b82bfcb54a6af0d1ee17806ef94d9da504cad606
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Dec 4 17:26:47 2012 +0000

    sna/gen6+: Cache the scanout targets separately to avoid override PTE caching
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 033f1cb..3706460 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -1220,9 +1220,10 @@ gen6_bind_bo(struct sna *sna,
 	uint32_t *ss;
 	uint32_t domains;
 	uint16_t offset;
+	uint32_t is_scanout = is_dst && bo->scanout;
 
 	/* After the first bind, we manage the cache domains within the batch */
-	offset = kgem_bo_get_binding(bo, format);
+	offset = kgem_bo_get_binding(bo, format | is_scanout << 31);
 	if (offset) {
 		DBG(("[%x]  bo(handle=%d), format=%d, reuse %s binding\n",
 		     offset, bo->handle, format,
@@ -1249,9 +1250,9 @@ gen6_bind_bo(struct sna *sna,
 	ss[3] = (gen6_tiling_bits(bo->tiling) |
 		 (bo->pitch - 1) << GEN6_SURFACE_PITCH_SHIFT);
 	ss[4] = 0;
-	ss[5] = is_dst && bo->scanout ? 0 : 3 << 16;
+	ss[5] = is_scanout ? 0 : 3 << 16;
 
-	kgem_bo_set_binding(bo, format, offset);
+	kgem_bo_set_binding(bo, format, offset | is_scanout << 31);
 
 	DBG(("[%x] bind bo(handle=%d, addr=%d), format=%d, width=%d, height=%d, pitch=%d, tiling=%d -> %s\n",
 	     offset, bo->handle, ss[1],
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 9d4e1a2..18c9036 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -1344,11 +1344,12 @@ gen7_bind_bo(struct sna *sna,
 	uint32_t *ss;
 	uint32_t domains;
 	int offset;
+	uint32_t is_scanout = is_dst && bo->scanout;
 
 	COMPILE_TIME_ASSERT(sizeof(struct gen7_surface_state) == 32);
 
 	/* After the first bind, we manage the cache domains within the batch */
-	offset = kgem_bo_get_binding(bo, format);
+	offset = kgem_bo_get_binding(bo, format | is_scanout << 31);
 	if (offset) {
 		if (is_dst)
 			kgem_bo_mark_dirty(bo);
@@ -1370,13 +1371,13 @@ gen7_bind_bo(struct sna *sna,
 		 (height - 1) << GEN7_SURFACE_HEIGHT_SHIFT);
 	ss[3] = (bo->pitch - 1) << GEN7_SURFACE_PITCH_SHIFT;
 	ss[4] = 0;
-	ss[5] = is_dst && bo->scanout ? 0 : 3 << 16;
+	ss[5] = is_scanout ? 0 : 3 << 16;
 	ss[6] = 0;
 	ss[7] = 0;
 	if (sna->kgem.gen == 075)
 		ss[7] |= HSW_SURFACE_SWIZZLE(RED, GREEN, BLUE, ALPHA);
 
-	kgem_bo_set_binding(bo, format, offset);
+	kgem_bo_set_binding(bo, format, offset | is_scanout << 31);
 
 	DBG(("[%x] bind bo(handle=%d, addr=%d), format=%d, width=%d, height=%d, pitch=%d, tiling=%d -> %s\n",
 	     offset, bo->handle, ss[1],


More information about the xorg-commit mailing list