diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 81431708..5863d2a6 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 f29f81a8..14615572 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 bd2cd484..2f732eb1 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 6d7d2fb8..82b88a4e 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 b34f3887..b56c8440 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__));