summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2014-09-10 21:48:44 +0100
committerRussell King <rmk@arm.linux.org.uk>2014-09-12 11:01:47 +0100
commitedf9d8321ae0b45480e295a4e6873a665b077009 (patch)
treeea0b5eb3736c830d37ecdb822d6742a633a03193
parentafebe57a568e3dbaf58ceebbe490688120a87d0e (diff)
downloadxf86-video-armada-edf9d8321ae0b45480e295a4e6873a665b077009.tar.gz
vivante: fix temporary composite pixmap to be 32-bit ARGB8888
The temporary composite pixmap was being created with a variable depth, but we were trying to place ARGB8888 formatted pixels into it. Fix by ensuring that this is always created with a depth of 32, and move the format initialisation to one place. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--src/vivante_accel.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/vivante_accel.c b/src/vivante_accel.c
index f12db78..1e4a96d 100644
--- a/src/vivante_accel.c
+++ b/src/vivante_accel.c
@@ -1246,7 +1246,6 @@ static struct vivante_pixmap *vivante_acquire_src(struct vivante *vivante,
if (vivante_picture_is_solid(pict, &colour)) {
*xout = 0;
*yout = 0;
- vTemp->pict_format = vivante_pict_format(PICT_a8r8g8b8, FALSE);
if (PICT_FORMAT_A(pict->format) == 0)
colour |= 0xff000000;
if (!vivante_fill_single(vivante, vTemp, clip, colour))
@@ -1271,8 +1270,7 @@ static struct vivante_pixmap *vivante_acquire_src(struct vivante *vivante,
PicturePtr dest;
int err;
- f = PictureMatchFormat(drawable->pScreen, pict->pFormat->depth,
- PICT_a8r8g8b8);
+ f = PictureMatchFormat(drawable->pScreen, 32, PICT_a8r8g8b8);
if (!f)
return NULL;
@@ -1285,7 +1283,6 @@ static struct vivante_pixmap *vivante_acquire_src(struct vivante *vivante,
FreePicture(dest, 0);
*xout = 0;
*yout = 0;
- vTemp->pict_format = vivante_pict_format(PICT_a8r8g8b8, FALSE);
vSrc = vTemp;
}
@@ -1525,8 +1522,7 @@ fprintf(stderr, "%s: i: op 0x%02x src=%p,%d,%d mask=%p,%d,%d dst=%p,%d,%d %ux%u\
* Get a temporary pixmap. We don't really know yet whether we're
* going to use it or not.
*/
- pPixTemp = pScreen->CreatePixmap(pScreen, width, height,
- pDst->pDrawable->depth, 0);
+ pPixTemp = pScreen->CreatePixmap(pScreen, width, height, 32, 0);
if (!pPixTemp)
goto failed;
@@ -1534,6 +1530,8 @@ fprintf(stderr, "%s: i: op 0x%02x src=%p,%d,%d mask=%p,%d,%d dst=%p,%d,%d %ux%u\
if (!vTemp)
goto failed;
+ vTemp->pict_format = vivante_pict_format(PICT_a8r8g8b8, FALSE);
+
/*
* Get the source. The source image will be described by vSrc with
* offset xSrc/ySrc. This may or may not be the temporary image, and
@@ -1541,7 +1539,6 @@ fprintf(stderr, "%s: i: op 0x%02x src=%p,%d,%d mask=%p,%d,%d dst=%p,%d,%d %ux%u\
* alpha channel is valid.
*/
if (op == PictOpClear) {
- vTemp->pict_format = vivante_pict_format(pSrc->format, TRUE);
if (!vivante_fill_single(vivante, vTemp, &clipTemp, 0))
goto failed;
vivante_flush(vivante);
@@ -1604,8 +1601,6 @@ fprintf(stderr, "%s: 0: OP 0x%02x src=%p[%p,%p,%u,%ux%u]x%dy%d mask=%p[%p,%u,%ux
rdst.bottom = height;
if (vTemp != vSrc) {
- gceSURF_FORMAT fTemp;
-
/* Copy Source to Temp */
rsrc.left = xSrc;
rsrc.top = ySrc;
@@ -1618,9 +1613,6 @@ fprintf(stderr, "%s: 0: OP 0x%02x src=%p[%p,%p,%u,%ux%u]x%dy%d mask=%p[%p,%u,%ux
* while copying. (If this doesn't work, use OR
* in the brush with maximum alpha value.)
*/
- fTemp = vivante_pict_format(pSrc->format, TRUE);
- vTemp->pict_format = fTemp;
-
if (!vivante_blend(vivante, &clipTemp, NULL,
vTemp, &rdst,
vSrc, &rsrc, 1))