From 5d74416740de883b7ef0994afea4bbd4d3901be0 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 18 Oct 2007 17:44:14 +0200 Subject: EXA: Don't attempt to move in pixmaps that can't be accelerated. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=12815 . --- exa/exa_accel.c | 3 +++ exa/exa_migration.c | 3 +++ exa/exa_render.c | 16 ++++++++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/exa/exa_accel.c b/exa/exa_accel.c index 8bbf036e4..52cc5c40a 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -152,6 +152,9 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int bpp = pDrawable->bitsPerPixel; Bool access_prepared = FALSE; + if (pExaPixmap->accel_blocked) + return FALSE; + /* Don't bother with under 8bpp, XYPixmaps. */ if (format != ZPixmap || bpp < 8) return FALSE; diff --git a/exa/exa_migration.c b/exa/exa_migration.c index 7968521c5..d69526b7f 100644 --- a/exa/exa_migration.c +++ b/exa/exa_migration.c @@ -299,6 +299,9 @@ exaDoMoveInPixmap (ExaMigrationPtr migrate) if (pPixmap->drawable.bitsPerPixel < 8) return; + if (pExaPixmap->accel_blocked) + return; + if (pExaPixmap->area == NULL) { pExaPixmap->area = exaOffscreenAlloc (pScreen, pExaPixmap->fb_size, diff --git a/exa/exa_render.c b/exa/exa_render.c index 2ad53041a..65e67d8d9 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -247,10 +247,24 @@ exaTryDriverSolidFill(PicturePtr pSrc, int nbox; int dst_off_x, dst_off_y; PixmapPtr pSrcPix, pDstPix; + ExaPixmapPrivPtr pSrcExaPix, pDstExaPix; CARD32 pixel; CARD16 red, green, blue, alpha; ExaMigrationRec pixmaps[1]; + pDstPix = exaGetDrawablePixmap (pDst->pDrawable); + pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable); + + pSrcExaPix = ExaGetPixmapPriv(pSrcPix); + pDstExaPix = ExaGetPixmapPriv(pDstPix); + + /* Check whether the accelerator can use these pixmaps. + */ + if (pSrcExaPix->accel_blocked || pDstExaPix->accel_blocked) + { + return -1; + } + xDst += pDst->pDrawable->x; yDst += pDst->pDrawable->y; xSrc += pSrc->pDrawable->x; @@ -261,12 +275,10 @@ exaTryDriverSolidFill(PicturePtr pSrc, width, height)) return 1; - pDstPix = exaGetDrawablePixmap (pDst->pDrawable); exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y); REGION_TRANSLATE(pScreen, ®ion, dst_off_x, dst_off_y); - pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable); pixel = exaGetPixmapFirstPixel (pSrcPix); pixmaps[0].as_dst = TRUE; -- cgit v1.2.3