From 83ca378f89553ff838bac9858dea66d03bc170c7 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 30 Nov 2007 10:11:01 +0100 Subject: EXA: Always fall back for pixmaps that can't be accelerated. The previous backport of the fix for https://bugs.freedesktop.org/show_bug.cgi?id=12815 was incomplete. --- exa/exa_accel.c | 8 ++++++-- exa/exa_render.c | 14 +++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/exa/exa_accel.c b/exa/exa_accel.c index aed4e42..46f7347 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -143,7 +143,7 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *bits) { ExaScreenPriv (pDrawable->pScreen); - PixmapPtr pPix; + PixmapPtr pPix = exaGetDrawablePixmap (pDrawable); ExaMigrationRec pixmaps[1]; RegionPtr pClip; BoxPtr pbox; @@ -151,9 +151,13 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int xoff, yoff; int src_stride, bpp = pDrawable->bitsPerPixel; + if (pPix->drawable.width > pExaScr->info->maxX || + pPix->drawable.height > pExaScr->info->maxY) + goto fallback; + pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); + pixmaps[0].pPix = pPix; /* Don't bother with under 8bpp, XYPixmaps. */ if (format != ZPixmap || bpp < 8) diff --git a/exa/exa_render.c b/exa/exa_render.c index 2dd3fc1..9327468 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -251,6 +251,19 @@ exaTryDriverSolidFill(PicturePtr pSrc, CARD16 red, green, blue, alpha; ExaMigrationRec pixmaps[1]; + pDstPix = exaGetDrawablePixmap (pDst->pDrawable); + pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable); + + /* Check whether the accelerator can use these pixmaps. + */ + if (pSrcPix->drawable.width > pExaScr->info->maxX || + pSrcPix->drawable.height > pExaScr->info->maxY || + pDstPix->drawable.width > pExaScr->info->maxX || + pDstPix->drawable.height > pExaScr->info->maxY) + { + return -1; + } + xDst += pDst->pDrawable->x; yDst += pDst->pDrawable->y; xSrc += pSrc->pDrawable->x; @@ -261,7 +274,6 @@ exaTryDriverSolidFill(PicturePtr pSrc, width, height)) return 1; - pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable); pixel = exaGetPixmapFirstPixel (pSrcPix); pixmaps[0].as_dst = TRUE; -- 1.5.3.6