xf86-video-intel: src/sna/kgem.c src/sna/kgem.h src/sna/sna_accel.c src/sna/sna_glyphs.c src/sna/sna.h

Chris Wilson ickle at kemper.freedesktop.org
Tue Sep 10 07:00:32 PDT 2013


 src/sna/kgem.c       |    7 +++++++
 src/sna/kgem.h       |    1 +
 src/sna/sna.h        |    1 -
 src/sna/sna_accel.c  |    8 --------
 src/sna/sna_glyphs.c |    2 +-
 5 files changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 9a66d77efa53cff83e9711786c39e8ebff8dd26d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Sep 10 12:29:24 2013 +0100

    sna: Disable use of Y-tiling for gen4
    
    This problematic GPU still seems to like to fallover when faced with
    Y-tiling. It was reserved only for use with glyphs, but even that
    occasionally runs into trouble, so disable all selection of Y-tiling for
    our own use.
    
    Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1222203
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 8143170..5863d2a 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1200,6 +1200,10 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, unsigned gen)
 	DBG(("%s: can blt to cpu? %d\n", __FUNCTION__,
 	     kgem->can_blt_cpu));
 
+	kgem->can_render_y = gen != 021 && (gen >> 3) != 4;
+	DBG(("%s: can render to Y-tiled surfaces? %d\n", __FUNCTION__,
+	     kgem->can_render_y));
+
 	kgem->has_secure_batches = test_has_secure_batches(kgem);
 	DBG(("%s: can use privileged batchbuffers? %d\n", __FUNCTION__,
 	     kgem->has_secure_batches));
@@ -3657,6 +3661,9 @@ int kgem_choose_tiling(struct kgem *kgem, int tiling, int width, int height, int
 	if (tiling < 0)
 		return tiling;
 
+	if (tiling == I915_TILING_Y && !kgem->can_render_y)
+		tiling = I915_TILING_X;
+
 	if (tiling && (height == 1 || width == 1)) {
 		DBG(("%s: disabling tiling [%dx%d] for single row/col\n",
 		     __FUNCTION__,width, height));
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index f29f81a..1461557 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -184,6 +184,7 @@ struct kgem {
 	uint32_t has_handle_lut :1;
 
 	uint32_t can_blt_cpu :1;
+	uint32_t can_render_y :1;
 
 	uint16_t fence_max;
 	uint16_t half_cpu_cache_pages;
diff --git a/src/sna/sna.h b/src/sna/sna.h
index bd2cd48..2f732eb 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -909,7 +909,6 @@ memcpy_xor(const void *src, void *dst, int bpp,
 
 #define SNA_CREATE_FB 0x10
 #define SNA_CREATE_SCRATCH 0x11
-#define SNA_CREATE_GLYPHS 0x12
 
 inline static bool is_power_of_two(unsigned x)
 {
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 6d7d2fb..82b88a4 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1238,14 +1238,6 @@ static PixmapPtr sna_create_pixmap(ScreenPtr screen,
 		else
 			goto fallback;
 
-	case SNA_CREATE_GLYPHS:
-		if (flags & KGEM_CAN_CREATE_GPU)
-			return sna_pixmap_create_scratch(screen,
-							 width, height, depth,
-							 -I915_TILING_Y);
-		else
-			goto fallback;
-
 	case SNA_CREATE_SCRATCH:
 		if (flags & KGEM_CAN_CREATE_GPU)
 			return sna_pixmap_create_scratch(screen,
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index b34f388..b56c844 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -238,7 +238,7 @@ bool sna_glyphs_create(struct sna *sna)
 					      CACHE_PICTURE_SIZE,
 					      CACHE_PICTURE_SIZE,
 					      depth,
-					      SNA_CREATE_GLYPHS);
+					      SNA_CREATE_SCRATCH);
 		if (!pixmap) {
 			DBG(("%s: failed to allocate pixmap for Glyph cache\n",
 			     __FUNCTION__));


More information about the xorg-commit mailing list