Index: programs/Xserver/fb/fb.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/fb/fb.h,v retrieving revision 1.12 diff -u -r1.12 fb.h --- programs/Xserver/fb/fb.h 24 Aug 2005 11:18:33 -0000 1.12 +++ programs/Xserver/fb/fb.h 29 Sep 2005 10:38:10 -0000 @@ -648,37 +648,53 @@ #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 @@ BoxPtr pBox, xPoint *pts, int npt, + int xorg, + int yorg, int xoff, int yoff, FbBits and, @@ -908,6 +926,8 @@ BoxPtr pBox, xPoint *pts, int npt, + int xorg, + int yorg, int xoff, int yoff, FbBits and, @@ -981,6 +1001,8 @@ BoxPtr pBox, xPoint *pts, int npt, + int xorg, + int yorg, int xoff, int yoff, FbBits and, @@ -1054,6 +1076,8 @@ BoxPtr pBox, xPoint *pts, int npt, + int xorg, + int yorg, int xoff, int yoff, FbBits and, @@ -1600,6 +1624,8 @@ BoxPtr pBox, xPoint *pts, int npt, + int xorg, + int yorg, int xoff, int yoff, FbBits andOrig, Index: programs/Xserver/fb/fbbits.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/fb/fbbits.h,v retrieving revision 1.4 diff -u -r1.4 fbbits.h --- programs/Xserver/fb/fbbits.h 3 Jul 2005 07:01:18 -0000 1.4 +++ programs/Xserver/fb/fbbits.h 29 Sep 2005 10:12:42 -0000 @@ -274,6 +274,8 @@ BoxPtr pBox, xPoint *ptsOrig, int npt, + int xorg, + int yorg, int xoff, int yoff, FbBits and, @@ -288,10 +290,10 @@ 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 @@ 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--) Index: programs/Xserver/fb/fbcopy.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/fb/fbcopy.c,v retrieving revision 1.5 diff -u -r1.5 fbcopy.c --- programs/Xserver/fb/fbcopy.c 3 Jul 2005 07:01:21 -0000 1.5 +++ programs/Xserver/fb/fbcopy.c 29 Sep 2005 09:58:33 -0000 @@ -68,11 +68,11 @@ 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))) Index: programs/Xserver/fb/fbfill.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/fb/fbfill.c,v retrieving revision 1.6 diff -u -r1.6 fbfill.c --- programs/Xserver/fb/fbfill.c 3 Jul 2005 07:01:22 -0000 1.6 +++ programs/Xserver/fb/fbfill.c 29 Sep 2005 10:18:16 -0000 @@ -92,7 +92,7 @@ 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 @@ 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 @@ pPriv->pm, dstBpp, (pGC->patOrg.x + pDrawable->x + dstXoff) * dstBpp, - pGC->patOrg.y + pDrawable->y + dstYoff - y); + pGC->patOrg.y + pDrawable->y - y); break; } } Index: programs/Xserver/fb/fbmmx.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/fb/fbmmx.c,v retrieving revision 1.19 diff -u -r1.19 fbmmx.c --- programs/Xserver/fb/fbmmx.c 23 Sep 2005 23:04:04 -0000 1.19 +++ programs/Xserver/fb/fbmmx.c 29 Sep 2005 10:47:16 -0000 @@ -2034,16 +2034,6 @@ _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 @@ 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 @@ 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--) Index: programs/Xserver/fb/fbpict.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/fb/fbpict.h,v retrieving revision 1.17 diff -u -r1.17 fbpict.h --- programs/Xserver/fb/fbpict.h 12 Aug 2005 18:47:17 -0000 1.17 +++ programs/Xserver/fb/fbpict.h 29 Sep 2005 10:24:18 -0000 @@ -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) | \ Index: programs/Xserver/fb/fbpoint.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/fb/fbpoint.c,v retrieving revision 1.4 diff -u -r1.4 fbpoint.c --- programs/Xserver/fb/fbpoint.c 3 Jul 2005 07:01:23 -0000 1.4 +++ programs/Xserver/fb/fbpoint.c 29 Sep 2005 10:27:28 -0000 @@ -35,6 +35,8 @@ BoxPtr pBox, xPoint *pts, int npt, + int xorg, + int yorg, int xoff, int yoff, FbBits and, @@ -47,6 +49,8 @@ BoxPtr pBox, xPoint *pts, int npt, + int xorg, + int yorg, int xoff, int yoff, FbBits andOrig, @@ -66,13 +70,13 @@ 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 @@ 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); } Index: programs/Xserver/fb/fbwindow.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/fb/fbwindow.c,v retrieving revision 1.8 diff -u -r1.8 fbwindow.c --- programs/Xserver/fb/fbwindow.c 3 Jul 2005 07:01:23 -0000 1.8 +++ programs/Xserver/fb/fbwindow.c 29 Sep 2005 10:29:53 -0000 @@ -291,7 +291,7 @@ FB_ALLONES, dstBpp, xRot * dstBpp, - yRot - pbox->y1); + yRot - (pbox->y1 + dstYoff)); pbox++; } } Index: programs/Xserver/hw/xfree86/exa/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/exa/Imakefile,v retrieving revision 1.1 diff -u -r1.1 Imakefile --- programs/Xserver/hw/xfree86/exa/Imakefile 1 Jul 2005 08:56:12 -0000 1.1 +++ programs/Xserver/hw/xfree86/exa/Imakefile 29 Sep 2005 03:18:47 -0000 @@ -16,7 +16,7 @@ INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(EXTINCSRC) \ -I$(SERVERSRC)/cfb -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(FONTINCSRC) \ - -I$(SERVERSRC)/fb \ + -I$(SERVERSRC)/fb -I$(SERVERSRC)/miext/cw \ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render -I$(SERVERSRC)/randr ModuleObjectRule() Index: programs/Xserver/hw/xfree86/exa/exa.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/exa/exa.c,v retrieving revision 1.23 diff -u -r1.23 exa.c --- programs/Xserver/hw/xfree86/exa/exa.c 28 Sep 2005 20:01:37 -0000 1.23 +++ programs/Xserver/hw/xfree86/exa/exa.c 29 Sep 2005 09:06:13 -0000 @@ -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 @@ { 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 @@ 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 @@ (*pExaScr->info->accel.Copy) (pPixmap, tileX, tileY, - dstX, dstY, + dstX + xoff, dstY + yoff, w, h); dstX += w; tileX = 0; @@ -1428,6 +1427,8 @@ } #endif + miDisableCompositeWrapper(pScreen); + /* * Hookup offscreen pixmaps */ Index: programs/Xserver/miext/cw/cw.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/miext/cw/cw.c,v retrieving revision 1.22 diff -u -r1.22 cw.c --- programs/Xserver/miext/cw/cw.c 3 Jul 2005 07:02:01 -0000 1.22 +++ programs/Xserver/miext/cw/cw.c 29 Sep 2005 03:18:47 -0000 @@ -48,6 +48,7 @@ #ifdef RENDER int cwPictureIndex; #endif +static Bool cwDisabled[MAXSCREENS]; static unsigned long cwGeneration = 0; extern GCOps cwGCOps; @@ -617,6 +618,9 @@ { cwScreenPtr pScreenPriv; + if (cwDisabled[pScreen->myNum]) + return; + if (cwGeneration != serverGeneration) { cwScreenIndex = AllocateScreenPrivateIndex(); @@ -660,6 +664,12 @@ #endif } +void +miDisableCompositeWrapper(ScreenPtr pScreen) +{ + cwDisabled[pScreen->myNum] = TRUE; +} + static Bool cwCloseScreen (int i, ScreenPtr pScreen) { Index: programs/Xserver/miext/cw/cw.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/miext/cw/cw.h,v retrieving revision 1.12 diff -u -r1.12 cw.h --- programs/Xserver/miext/cw/cw.h 3 Jul 2005 07:02:01 -0000 1.12 +++ programs/Xserver/miext/cw/cw.h 29 Sep 2005 03:18:47 -0000 @@ -164,5 +164,10 @@ cwFiniRender (ScreenPtr pScreen); /* cw.c */ + void miInitializeCompositeWrapper(ScreenPtr pScreen); + +/* Must be called before miInitializeCompositeWrapper */ +void +miDisableCompositeWrapper(ScreenPtr pScreen);