sna/dri2: Set depth/bpp on scratch DrawableRec
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 1 Jul 2014 12:10:32 +0000 (13:10 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 1 Jul 2014 12:15:44 +0000 (13:15 +0100)
We need to initialise both depth and bitsPerPixel on the drawable struct
we pass around as they are used for selecting for the format when
copying.

Reported-by: Vedran Rodic <vrodic@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_dri2.c

index d0b5da5..b03bf6a 100644 (file)
@@ -962,6 +962,8 @@ __sna_dri2_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region,
                scratch.x = scratch.y = 0;
                scratch.width = src_priv->size & 0xffff;
                scratch.height = src_priv->size >> 16;
+               scratch.depth = draw->depth;
+               scratch.bitsPerPixel = draw->bitsPerPixel;
                src_draw = &scratch;
 
                DBG(("%s: source size %dx%d, region size %dx%d\n",
@@ -1006,6 +1008,8 @@ __sna_dri2_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region,
                scratch.x = scratch.y = 0;
                scratch.width = dst_priv->size & 0xffff;
                scratch.height = dst_priv->size >> 16;
+               scratch.depth = draw->depth;
+               scratch.bitsPerPixel = draw->bitsPerPixel;
                dst_draw = &scratch;
 
                DBG(("%s: target size %dx%d, region size %dx%d\n",