summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-20 12:53:42 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-20 12:55:01 +0000
commitd257a967396c517146cfb12bbec5cd28418752a3 (patch)
tree8803dc0322c8febdaedd0bb7ba423a28a6d9c3a0
parent0c12f7cb01e75de3bf9c2af8ac6d5b4152566457 (diff)
sna: Explicitly handle depth==1 scratch pixmaps
Short-cut the determination of whether it can be tiled and accelerated -- we know it can't! This is mainly to cleanup the debug logs. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 4fd4fd90..47665dd3 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -469,16 +469,21 @@ sna_pixmap_create_scratch(ScreenPtr screen,
uint32_t tiling)
{
struct sna *sna = to_sna_from_screen(screen);
- PixmapPtr pixmap;
struct sna_pixmap *priv;
- int bpp = BitsPerPixel(depth);
+ PixmapPtr pixmap;
+ int bpp;
DBG(("%s(%d, %d, %d, tiling=%d)\n", __FUNCTION__,
width, height, depth, tiling));
+ if (depth < 8)
+ return create_pixmap(sna, screen, width, height, depth,
+ CREATE_PIXMAP_USAGE_SCRATCH);
+
if (tiling == I915_TILING_Y && !sna->have_render)
tiling = I915_TILING_X;
+ bpp = BitsPerPixel(depth);
tiling = kgem_choose_tiling(&sna->kgem, tiling, width, height, bpp);
if (!kgem_can_create_2d(&sna->kgem, width, height, bpp, tiling))
return create_pixmap(sna, screen, width, height, depth,