From dfafe76a57655784c313bc2078d0b28a7ac2675b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 20 Dec 2011 18:39:20 +0000 Subject: [PATCH] sna: Do not use Y-tiling for composite back pixmaps These are treated by the core drawing routines as replacements for the front-buffer attached to Windows, and so expect the usual BLT accelerations are available, for example overlapping blits to handle scrolling. If we create these pixmaps with Y-tiling and then they are pinned by the external compositor we are forced to perform a double copy through the 3D pipeline as it does not handle overlapping blits and the BLT does not handle Y-tiling. Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 60bd39fc..6c655cae 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -291,6 +291,13 @@ static inline uint32_t default_tiling(PixmapPtr pixmap) if (sna->kgem.gen == 21) return I915_TILING_X; + if (pixmap->usage_hint == CREATE_PIXMAP_USAGE_BACKING_PIXMAP) { + /* Treat this like a window, and require accelerated + * scrolling i.e. overlapped blits. + */ + return I915_TILING_X; + } + return sna_damage_is_all(&priv->cpu_damage, pixmap->drawable.width, pixmap->drawable.height) ? I915_TILING_Y : sna->default_tiling;