From ecaa46380ed0a920186407b9294c5c60f75f1a13 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 2 Oct 2005 08:28:27 +0000 Subject: [PATCH] Bugzilla #4616: - Merge various fb/ bits of COMPOSITE support from xserver, which weren't necessary before due to cw hiding the issues. Fixes offset calculations for a number of operations, and may pull some fixes that cairo has wanted for XAA as well. - Add a new call, miDisableCompositeWrapper(), which a DDX can call to keep cw from getting initialized from the damage code. While it would be cleaner to have each DDX initialize it if it needs it, we don't have control over all of them (e.g. nvidia). - Use the miDisableCompositeWrapper() to keep cw from getting set up for screens using EXA, because EXA is already aware of composite. Avoiding cw improved performance 0-35% on operations tested by ajax in x11perf. --- exa/exa.c | 15 +++++----- exa/exa_accel.c | 15 +++++----- exa/exa_migration.c | 15 +++++----- fb/fb.h | 52 +++++++++++++++++++++++++--------- fb/fbbits.h | 10 +++++-- fb/fbcopy.c | 8 +++--- fb/fbfill.c | 6 ++-- fb/fbmmx.c | 36 ++++++----------------- fb/fbpict.h | 2 +- fb/fbpoint.c | 14 +++++---- fb/fbwindow.c | 4 +-- hw/xfree86/exa/exa.c | 15 +++++----- hw/xfree86/exa/exa_accel.c | 15 +++++----- hw/xfree86/exa/exa_migration.c | 15 +++++----- miext/cw/cw.c | 10 +++++++ miext/cw/cw.h | 5 ++++ 16 files changed, 137 insertions(+), 100 deletions(-) diff --git a/exa/exa.c b/exa/exa.c index b7ba3b319a..fb46f4449c 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -31,6 +31,7 @@ #include "xf86str.h" #include "xf86.h" #include "exa.h" +#include "cw.h" #if DEBUG_MIGRATE #define DBG_MIGRATE(a) ErrorF a @@ -1232,19 +1233,17 @@ exaFillRegionTiled (DrawablePtr pDrawable, { int nbox = REGION_NUM_RECTS (pRegion); BoxPtr pBox = REGION_RECTS (pRegion); - int xRot = pDrawable->x + xoff; - int yRot = pDrawable->y + yoff; while (nbox--) { int height = pBox->y2 - pBox->y1; - int dstY = pBox->y1 + yoff; + int dstY = pBox->y1; int tileY; - modulus (dstY - yRot, tileHeight, tileY); + tileY = (dstY - pDrawable->y) % tileHeight; while (height > 0) { int width = pBox->x2 - pBox->x1; - int dstX = pBox->x1 + xoff; + int dstX = pBox->x1; int tileX; int h = tileHeight - tileY; @@ -1252,7 +1251,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, h = height; height -= h; - modulus (dstX - xRot, tileWidth, tileX); + tileX = (dstX - pDrawable->x) % tileWidth; while (width > 0) { int w = tileWidth - tileX; if (w > width) @@ -1261,7 +1260,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, (*pExaScr->info->accel.Copy) (pPixmap, tileX, tileY, - dstX, dstY, + dstX + xoff, dstY + yoff, w, h); dstX += w; tileX = 0; @@ -1428,6 +1427,8 @@ exaDriverInit (ScreenPtr pScreen, } #endif + miDisableCompositeWrapper(pScreen); + /* * Hookup offscreen pixmaps */ diff --git a/exa/exa_accel.c b/exa/exa_accel.c index b7ba3b319a..fb46f4449c 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -31,6 +31,7 @@ #include "xf86str.h" #include "xf86.h" #include "exa.h" +#include "cw.h" #if DEBUG_MIGRATE #define DBG_MIGRATE(a) ErrorF a @@ -1232,19 +1233,17 @@ exaFillRegionTiled (DrawablePtr pDrawable, { int nbox = REGION_NUM_RECTS (pRegion); BoxPtr pBox = REGION_RECTS (pRegion); - int xRot = pDrawable->x + xoff; - int yRot = pDrawable->y + yoff; while (nbox--) { int height = pBox->y2 - pBox->y1; - int dstY = pBox->y1 + yoff; + int dstY = pBox->y1; int tileY; - modulus (dstY - yRot, tileHeight, tileY); + tileY = (dstY - pDrawable->y) % tileHeight; while (height > 0) { int width = pBox->x2 - pBox->x1; - int dstX = pBox->x1 + xoff; + int dstX = pBox->x1; int tileX; int h = tileHeight - tileY; @@ -1252,7 +1251,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, h = height; height -= h; - modulus (dstX - xRot, tileWidth, tileX); + tileX = (dstX - pDrawable->x) % tileWidth; while (width > 0) { int w = tileWidth - tileX; if (w > width) @@ -1261,7 +1260,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, (*pExaScr->info->accel.Copy) (pPixmap, tileX, tileY, - dstX, dstY, + dstX + xoff, dstY + yoff, w, h); dstX += w; tileX = 0; @@ -1428,6 +1427,8 @@ exaDriverInit (ScreenPtr pScreen, } #endif + miDisableCompositeWrapper(pScreen); + /* * Hookup offscreen pixmaps */ diff --git a/exa/exa_migration.c b/exa/exa_migration.c index b7ba3b319a..fb46f4449c 100644 --- a/exa/exa_migration.c +++ b/exa/exa_migration.c @@ -31,6 +31,7 @@ #include "xf86str.h" #include "xf86.h" #include "exa.h" +#include "cw.h" #if DEBUG_MIGRATE #define DBG_MIGRATE(a) ErrorF a @@ -1232,19 +1233,17 @@ exaFillRegionTiled (DrawablePtr pDrawable, { int nbox = REGION_NUM_RECTS (pRegion); BoxPtr pBox = REGION_RECTS (pRegion); - int xRot = pDrawable->x + xoff; - int yRot = pDrawable->y + yoff; while (nbox--) { int height = pBox->y2 - pBox->y1; - int dstY = pBox->y1 + yoff; + int dstY = pBox->y1; int tileY; - modulus (dstY - yRot, tileHeight, tileY); + tileY = (dstY - pDrawable->y) % tileHeight; while (height > 0) { int width = pBox->x2 - pBox->x1; - int dstX = pBox->x1 + xoff; + int dstX = pBox->x1; int tileX; int h = tileHeight - tileY; @@ -1252,7 +1251,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, h = height; height -= h; - modulus (dstX - xRot, tileWidth, tileX); + tileX = (dstX - pDrawable->x) % tileWidth; while (width > 0) { int w = tileWidth - tileX; if (w > width) @@ -1261,7 +1260,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, (*pExaScr->info->accel.Copy) (pPixmap, tileX, tileY, - dstX, dstY, + dstX + xoff, dstY + yoff, w, h); dstX += w; tileX = 0; @@ -1428,6 +1427,8 @@ exaDriverInit (ScreenPtr pScreen, } #endif + miDisableCompositeWrapper(pScreen); + /* * Hookup offscreen pixmaps */ diff --git a/fb/fb.h b/fb/fb.h index 42e167777a..ae2ab33e63 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -22,7 +22,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $XdotOrg: xc/programs/Xserver/fb/fb.h,v 1.9 2005/04/20 12:25:19 daniels Exp $ */ +/* $XdotOrg: xc/programs/Xserver/fb/fb.h,v 1.12 2005/08/24 11:18:33 daniels Exp $ */ #ifndef _FB_H_ #define _FB_H_ @@ -648,37 +648,53 @@ typedef struct { #endif #ifdef ROOTLESS -#define __fbPixOriginX(pPix) ((pPix)->drawable.x) -#define __fbPixOriginY(pPix) ((pPix)->drawable.y) +#define __fbPixDrawableX(pPix) ((pPix)->drawable.x) +#define __fbPixDrawableY(pPix) ((pPix)->drawable.y) #else -#define __fbPixOriginX(pPix) 0 -#define __fbPixOriginY(pPix) 0 +#define __fbPixDrawableX(pPix) 0 +#define __fbPixDrawableY(pPix) 0 #endif +#ifdef COMPOSITE +#define __fbPixOffXWin(pPix) (__fbPixDrawableX(pPix) - (pPix)->screen_x) +#define __fbPixOffYWin(pPix) (__fbPixDrawableY(pPix) - (pPix)->screen_y) +#else +#define __fbPixOffXWin(pPix) (__fbPixDrawableX(pPix)) +#define __fbPixOffYWin(pPix) (__fbPixDrawableY(pPix)) +#endif +#define __fbPixOffXPix(pPix) (__fbPixDrawableX(pPix)) +#define __fbPixOffYPix(pPix) (__fbPixDrawableY(pPix)) + #define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \ PixmapPtr _pPix; \ - if ((pDrawable)->type != DRAWABLE_PIXMAP) \ + if ((pDrawable)->type != DRAWABLE_PIXMAP) { \ _pPix = fbGetWindowPixmap(pDrawable); \ - else \ + (xoff) = __fbPixOffXWin(_pPix); \ + (yoff) = __fbPixOffYWin(_pPix); \ + } else { \ _pPix = (PixmapPtr) (pDrawable); \ + (xoff) = __fbPixOffXPix(_pPix); \ + (yoff) = __fbPixOffYPix(_pPix); \ + } \ (pointer) = (FbBits *) _pPix->devPrivate.ptr; \ (stride) = ((int) _pPix->devKind) / sizeof (FbBits); (void)(stride); \ (bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \ - (xoff) = __fbPixOriginX(_pPix); (void)(xoff); \ - (yoff) = __fbPixOriginY(_pPix); (void)(yoff); \ } #define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \ PixmapPtr _pPix; \ - if ((pDrawable)->type != DRAWABLE_PIXMAP) \ + if ((pDrawable)->type != DRAWABLE_PIXMAP) { \ _pPix = fbGetWindowPixmap(pDrawable); \ - else \ + (xoff) = __fbPixOffXWin(_pPix); \ + (yoff) = __fbPixOffYWin(_pPix); \ + } else { \ _pPix = (PixmapPtr) (pDrawable); \ + (xoff) = __fbPixOffXPix(_pPix); \ + (yoff) = __fbPixOffYPix(_pPix); \ + } \ (pointer) = (FbStip *) _pPix->devPrivate.ptr; \ (stride) = ((int) _pPix->devKind) / sizeof (FbStip); (void)(stride); \ (bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \ - (xoff) = __fbPixOriginX(_pPix); (void)(xoff); \ - (yoff) = __fbPixOriginY(_pPix); (void)(yoff); \ } /* @@ -836,6 +852,8 @@ fbDots8 (FbBits *dst, BoxPtr pBox, xPoint *pts, int npt, + int xorg, + int yorg, int xoff, int yoff, FbBits and, @@ -908,6 +926,8 @@ fbDots16(FbBits *dst, BoxPtr pBox, xPoint *pts, int npt, + int xorg, + int yorg, int xoff, int yoff, FbBits and, @@ -981,6 +1001,8 @@ fbDots24(FbBits *dst, BoxPtr pBox, xPoint *pts, int npt, + int xorg, + int yorg, int xoff, int yoff, FbBits and, @@ -1054,6 +1076,8 @@ fbDots32(FbBits *dst, BoxPtr pBox, xPoint *pts, int npt, + int xorg, + int yorg, int xoff, int yoff, FbBits and, @@ -1600,6 +1624,8 @@ fbDots (FbBits *dstOrig, BoxPtr pBox, xPoint *pts, int npt, + int xorg, + int yorg, int xoff, int yoff, FbBits andOrig, diff --git a/fb/fbbits.h b/fb/fbbits.h index 6997822293..7dfff58b4f 100644 --- a/fb/fbbits.h +++ b/fb/fbbits.h @@ -274,6 +274,8 @@ DOTS (FbBits *dst, BoxPtr pBox, xPoint *ptsOrig, int npt, + int xorg, + int yorg, int xoff, int yoff, FbBits and, @@ -288,10 +290,10 @@ DOTS (FbBits *dst, INT32 ul, lr; INT32 pt; - ul = coordToInt(pBox->x1 - xoff, pBox->y1 - yoff); - lr = coordToInt(pBox->x2 - xoff - 1, pBox->y2 - yoff - 1); + ul = coordToInt(pBox->x1 - xorg, pBox->y1 - yorg); + lr = coordToInt(pBox->x2 - xorg - 1, pBox->y2 - yorg - 1); - bits += bitsStride * yoff + xoff * MUL; + bits += bitsStride * (yorg + yoff) + (xorg + xoff) * MUL; if (and == 0) { @@ -827,6 +829,8 @@ POLYSEGMENT (DrawablePtr pDrawable, ul = coordToInt(pBox->x1 - xoff, pBox->y1 - yoff); lr = coordToInt(pBox->x2 - xoff - 1, pBox->y2 - yoff - 1); + bits += bitsStride * yoff + xoff * MUL; + capNotLast = pGC->capStyle == CapNotLast; while (nseg--) diff --git a/fb/fbcopy.c b/fb/fbcopy.c index eb295a3976..510af19a35 100644 --- a/fb/fbcopy.c +++ b/fb/fbcopy.c @@ -68,11 +68,11 @@ fbCopyNtoN (DrawablePtr pSrcDrawable, if (!fbCopyAreammx (pSrcDrawable, pDstDrawable, - (pbox->x1 + dx + srcXoff), - (pbox->y1 + dy + srcYoff), + (pbox->x1 + dx), + (pbox->y1 + dy), - (pbox->x1 + dstXoff), - (pbox->y1 + dstYoff), + (pbox->x1), + (pbox->y1), (pbox->x2 - pbox->x1), (pbox->y2 - pbox->y1))) diff --git a/fb/fbfill.c b/fb/fbfill.c index 3c49599595..c61ff3b4c6 100644 --- a/fb/fbfill.c +++ b/fb/fbfill.c @@ -92,7 +92,7 @@ fbFill (DrawablePtr pDrawable, dstBpp, (pGC->patOrg.x + pDrawable->x + dstXoff), - pGC->patOrg.y + pDrawable->y + dstYoff - y); + pGC->patOrg.y + pDrawable->y - y); } else { @@ -129,7 +129,7 @@ fbFill (DrawablePtr pDrawable, fgand, fgxor, bgand, bgxor, pGC->patOrg.x + pDrawable->x + dstXoff, - pGC->patOrg.y + pDrawable->y + dstYoff - y); + pGC->patOrg.y + pDrawable->y - y); } break; } @@ -157,7 +157,7 @@ fbFill (DrawablePtr pDrawable, pPriv->pm, dstBpp, (pGC->patOrg.x + pDrawable->x + dstXoff) * dstBpp, - pGC->patOrg.y + pDrawable->y + dstYoff - y); + pGC->patOrg.y + pDrawable->y - y); break; } } diff --git a/fb/fbmmx.c b/fb/fbmmx.c index a1cad900ad..c3aff3d2c4 100644 --- a/fb/fbmmx.c +++ b/fb/fbmmx.c @@ -2034,16 +2034,6 @@ fbCompositeSrcAdd_8888x8888mmx (CARD8 op, _mm_empty(); } -#define GetStart(drw,x,y,type,stride,line,bpp) {\ - FbBits *__bits__; \ - FbStride __stride__; \ - int __xoff__,__yoff__; \ - \ - fbGetDrawable((drw),__bits__,__stride__,bpp,__xoff__,__yoff__); \ - (stride) = __stride__ * sizeof (FbBits) / sizeof (type); \ - (line) = ((type *) __bits__) + (stride) * ((y) - __yoff__) + ((x) - __xoff__); \ -} - Bool fbSolidFillmmx (DrawablePtr pDraw, int x, @@ -2074,14 +2064,14 @@ fbSolidFillmmx (DrawablePtr pDraw, if (bpp == 16) { stride = stride * sizeof (FbBits) / 2; - byte_line = (CARD8 *)(((CARD16 *)bits) + stride * (y - yoff) + (x - xoff)); + byte_line = (CARD8 *)(((CARD16 *)bits) + stride * (y + yoff) + (x + xoff)); byte_width = 2 * width; stride *= 2; } else { stride = stride * sizeof (FbBits) / 4; - byte_line = (CARD8 *)(((CARD32 *)bits) + stride * (y - yoff) + (x - xoff)); + byte_line = (CARD8 *)(((CARD32 *)bits) + stride * (y + yoff) + (x + xoff)); byte_width = 4 * width; stride *= 4; } @@ -2173,36 +2163,28 @@ fbCopyAreammx (DrawablePtr pSrc, fbGetDrawable(pSrc, src_bits, src_stride, src_bpp, src_xoff, src_yoff); fbGetDrawable(pDst, dst_bits, dst_stride, dst_bpp, dst_xoff, dst_yoff); - if (src_bpp != 16 && src_bpp != 32) - return FALSE; - - if (dst_bpp != 16 && dst_bpp != 32) - return FALSE; - if (src_bpp != dst_bpp) - { return FALSE; - } if (src_bpp == 16) { src_stride = src_stride * sizeof (FbBits) / 2; dst_stride = dst_stride * sizeof (FbBits) / 2; - src_bytes = (CARD8 *)(((CARD16 *)src_bits) + src_stride * (src_y - src_yoff) + (src_x - src_xoff)); - dst_bytes = (CARD8 *)(((CARD16 *)dst_bits) + dst_stride * (dst_y - dst_yoff) + (dst_x - dst_xoff)); + src_bytes = (CARD8 *)(((CARD16 *)src_bits) + src_stride * (src_y + src_yoff) + (src_x + src_xoff)); + dst_bytes = (CARD8 *)(((CARD16 *)dst_bits) + dst_stride * (dst_y + dst_yoff) + (dst_x + dst_xoff)); byte_width = 2 * width; src_stride *= 2; dst_stride *= 2; - } - else - { + } else if (src_bpp == 32) { src_stride = src_stride * sizeof (FbBits) / 4; dst_stride = dst_stride * sizeof (FbBits) / 4; - src_bytes = (CARD8 *)(((CARD32 *)src_bits) + src_stride * (src_y - src_yoff) + (src_x - src_xoff)); - dst_bytes = (CARD8 *)(((CARD32 *)dst_bits) + dst_stride * (dst_y - dst_yoff) + (dst_x - dst_xoff)); + src_bytes = (CARD8 *)(((CARD32 *)src_bits) + src_stride * (src_y + src_yoff) + (src_x + src_xoff)); + dst_bytes = (CARD8 *)(((CARD32 *)dst_bits) + dst_stride * (dst_y + dst_yoff) + (dst_x + dst_xoff)); byte_width = 4 * width; src_stride *= 4; dst_stride *= 4; + } else { + return FALSE; } while (height--) diff --git a/fb/fbpict.h b/fb/fbpict.h index 0e6a7f4ffe..665b92dd18 100644 --- a/fb/fbpict.h +++ b/fb/fbpict.h @@ -110,7 +110,7 @@ \ fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \ (stride) = __stride__ * sizeof (FbBits) / sizeof (type); \ - (line) = ((type *) __bits__) + (stride) * ((y) - __yoff__) + (mul) * ((x) - __xoff__); \ + (line) = ((type *) __bits__) + (stride) * ((y) + __yoff__) + (mul) * ((x) + __xoff__); \ } #define cvt8888to0565(s) ((((s) >> 3) & 0x001f) | \ (((s) >> 5) & 0x07e0) | \ diff --git a/fb/fbpoint.c b/fb/fbpoint.c index 5ba24e0e5b..5229d69703 100644 --- a/fb/fbpoint.c +++ b/fb/fbpoint.c @@ -35,6 +35,8 @@ typedef void (*FbDots) (FbBits *dst, BoxPtr pBox, xPoint *pts, int npt, + int xorg, + int yorg, int xoff, int yoff, FbBits and, @@ -47,6 +49,8 @@ fbDots (FbBits *dstOrig, BoxPtr pBox, xPoint *pts, int npt, + int xorg, + int yorg, int xoff, int yoff, FbBits andOrig, @@ -66,13 +70,13 @@ fbDots (FbBits *dstOrig, y2 = pBox->y2; while (npt--) { - x = pts->x + xoff; - y = pts->y + yoff; + x = pts->x + xorg; + y = pts->y + yorg; pts++; if (x1 <= x && x < x2 && y1 <= y && y < y2) { - x *= dstBpp; - d = dst + (y * dstStride) + (x >> FB_STIP_SHIFT); + x = (x + xoff) * dstBpp; + d = dst + ((y + yoff) * dstStride) + (x >> FB_STIP_SHIFT); x &= FB_STIP_MASK; #ifdef FB_24BIT if (dstBpp == 24) @@ -156,5 +160,5 @@ fbPolyPoint (DrawablePtr pDrawable, for (nBox = REGION_NUM_RECTS (pClip), pBox = REGION_RECTS (pClip); nBox--; pBox++) (*dots) (dst, dstStride, dstBpp, pBox, pptInit, nptInit, - pDrawable->x + dstXoff, pDrawable->y + dstYoff, and, xor); + pDrawable->x, pDrawable->y, dstXoff, dstYoff, and, xor); } diff --git a/fb/fbwindow.c b/fb/fbwindow.c index 8820856b06..7b96f18c34 100644 --- a/fb/fbwindow.c +++ b/fb/fbwindow.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/fb/fbwindow.c,v 1.6 2004/12/06 15:53:00 eich Exp $ */ +/* $XdotOrg: xc/programs/Xserver/fb/fbwindow.c,v 1.8 2005/07/03 07:01:23 daniels Exp $ */ /* * Id: fbwindow.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ * @@ -291,7 +291,7 @@ fbFillRegionTiled (DrawablePtr pDrawable, FB_ALLONES, dstBpp, xRot * dstBpp, - yRot - pbox->y1); + yRot - (pbox->y1 + dstYoff)); pbox++; } } diff --git a/hw/xfree86/exa/exa.c b/hw/xfree86/exa/exa.c index b7ba3b319a..fb46f4449c 100644 --- a/hw/xfree86/exa/exa.c +++ b/hw/xfree86/exa/exa.c @@ -31,6 +31,7 @@ #include "xf86str.h" #include "xf86.h" #include "exa.h" +#include "cw.h" #if DEBUG_MIGRATE #define DBG_MIGRATE(a) ErrorF a @@ -1232,19 +1233,17 @@ exaFillRegionTiled (DrawablePtr pDrawable, { int nbox = REGION_NUM_RECTS (pRegion); BoxPtr pBox = REGION_RECTS (pRegion); - int xRot = pDrawable->x + xoff; - int yRot = pDrawable->y + yoff; while (nbox--) { int height = pBox->y2 - pBox->y1; - int dstY = pBox->y1 + yoff; + int dstY = pBox->y1; int tileY; - modulus (dstY - yRot, tileHeight, tileY); + tileY = (dstY - pDrawable->y) % tileHeight; while (height > 0) { int width = pBox->x2 - pBox->x1; - int dstX = pBox->x1 + xoff; + int dstX = pBox->x1; int tileX; int h = tileHeight - tileY; @@ -1252,7 +1251,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, h = height; height -= h; - modulus (dstX - xRot, tileWidth, tileX); + tileX = (dstX - pDrawable->x) % tileWidth; while (width > 0) { int w = tileWidth - tileX; if (w > width) @@ -1261,7 +1260,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, (*pExaScr->info->accel.Copy) (pPixmap, tileX, tileY, - dstX, dstY, + dstX + xoff, dstY + yoff, w, h); dstX += w; tileX = 0; @@ -1428,6 +1427,8 @@ exaDriverInit (ScreenPtr pScreen, } #endif + miDisableCompositeWrapper(pScreen); + /* * Hookup offscreen pixmaps */ diff --git a/hw/xfree86/exa/exa_accel.c b/hw/xfree86/exa/exa_accel.c index b7ba3b319a..fb46f4449c 100644 --- a/hw/xfree86/exa/exa_accel.c +++ b/hw/xfree86/exa/exa_accel.c @@ -31,6 +31,7 @@ #include "xf86str.h" #include "xf86.h" #include "exa.h" +#include "cw.h" #if DEBUG_MIGRATE #define DBG_MIGRATE(a) ErrorF a @@ -1232,19 +1233,17 @@ exaFillRegionTiled (DrawablePtr pDrawable, { int nbox = REGION_NUM_RECTS (pRegion); BoxPtr pBox = REGION_RECTS (pRegion); - int xRot = pDrawable->x + xoff; - int yRot = pDrawable->y + yoff; while (nbox--) { int height = pBox->y2 - pBox->y1; - int dstY = pBox->y1 + yoff; + int dstY = pBox->y1; int tileY; - modulus (dstY - yRot, tileHeight, tileY); + tileY = (dstY - pDrawable->y) % tileHeight; while (height > 0) { int width = pBox->x2 - pBox->x1; - int dstX = pBox->x1 + xoff; + int dstX = pBox->x1; int tileX; int h = tileHeight - tileY; @@ -1252,7 +1251,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, h = height; height -= h; - modulus (dstX - xRot, tileWidth, tileX); + tileX = (dstX - pDrawable->x) % tileWidth; while (width > 0) { int w = tileWidth - tileX; if (w > width) @@ -1261,7 +1260,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, (*pExaScr->info->accel.Copy) (pPixmap, tileX, tileY, - dstX, dstY, + dstX + xoff, dstY + yoff, w, h); dstX += w; tileX = 0; @@ -1428,6 +1427,8 @@ exaDriverInit (ScreenPtr pScreen, } #endif + miDisableCompositeWrapper(pScreen); + /* * Hookup offscreen pixmaps */ diff --git a/hw/xfree86/exa/exa_migration.c b/hw/xfree86/exa/exa_migration.c index b7ba3b319a..fb46f4449c 100644 --- a/hw/xfree86/exa/exa_migration.c +++ b/hw/xfree86/exa/exa_migration.c @@ -31,6 +31,7 @@ #include "xf86str.h" #include "xf86.h" #include "exa.h" +#include "cw.h" #if DEBUG_MIGRATE #define DBG_MIGRATE(a) ErrorF a @@ -1232,19 +1233,17 @@ exaFillRegionTiled (DrawablePtr pDrawable, { int nbox = REGION_NUM_RECTS (pRegion); BoxPtr pBox = REGION_RECTS (pRegion); - int xRot = pDrawable->x + xoff; - int yRot = pDrawable->y + yoff; while (nbox--) { int height = pBox->y2 - pBox->y1; - int dstY = pBox->y1 + yoff; + int dstY = pBox->y1; int tileY; - modulus (dstY - yRot, tileHeight, tileY); + tileY = (dstY - pDrawable->y) % tileHeight; while (height > 0) { int width = pBox->x2 - pBox->x1; - int dstX = pBox->x1 + xoff; + int dstX = pBox->x1; int tileX; int h = tileHeight - tileY; @@ -1252,7 +1251,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, h = height; height -= h; - modulus (dstX - xRot, tileWidth, tileX); + tileX = (dstX - pDrawable->x) % tileWidth; while (width > 0) { int w = tileWidth - tileX; if (w > width) @@ -1261,7 +1260,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, (*pExaScr->info->accel.Copy) (pPixmap, tileX, tileY, - dstX, dstY, + dstX + xoff, dstY + yoff, w, h); dstX += w; tileX = 0; @@ -1428,6 +1427,8 @@ exaDriverInit (ScreenPtr pScreen, } #endif + miDisableCompositeWrapper(pScreen); + /* * Hookup offscreen pixmaps */ diff --git a/miext/cw/cw.c b/miext/cw/cw.c index 2b8010f503..4ebf8ab8a1 100644 --- a/miext/cw/cw.c +++ b/miext/cw/cw.c @@ -48,6 +48,7 @@ int cwWindowIndex; #ifdef RENDER int cwPictureIndex; #endif +static Bool cwDisabled[MAXSCREENS]; static unsigned long cwGeneration = 0; extern GCOps cwGCOps; @@ -617,6 +618,9 @@ miInitializeCompositeWrapper(ScreenPtr pScreen) { cwScreenPtr pScreenPriv; + if (cwDisabled[pScreen->myNum]) + return; + if (cwGeneration != serverGeneration) { cwScreenIndex = AllocateScreenPrivateIndex(); @@ -660,6 +664,12 @@ miInitializeCompositeWrapper(ScreenPtr pScreen) #endif } +void +miDisableCompositeWrapper(ScreenPtr pScreen) +{ + cwDisabled[pScreen->myNum] = TRUE; +} + static Bool cwCloseScreen (int i, ScreenPtr pScreen) { diff --git a/miext/cw/cw.h b/miext/cw/cw.h index 1f8c400e2b..67ce9cd314 100644 --- a/miext/cw/cw.h +++ b/miext/cw/cw.h @@ -164,5 +164,10 @@ void cwFiniRender (ScreenPtr pScreen); /* cw.c */ + void miInitializeCompositeWrapper(ScreenPtr pScreen); + +/* Must be called before miInitializeCompositeWrapper */ +void +miDisableCompositeWrapper(ScreenPtr pScreen);