diff options
author | Dave Airlie <airlied@redhat.com> | 2011-08-15 14:59:22 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-08-15 14:59:22 +0100 |
commit | 709cd63721851e65b52e10c591148b5a42596acd (patch) | |
tree | 1514f5b049d1b7faa0328bfb99c16d8cac71b08d | |
parent | a98de686043679c05ddcb00e2d4145cd00d34645 (diff) |
drvmodel: oops I accidentally shatter
-rw-r--r-- | drv/drv_imped.h | 1 | ||||
-rw-r--r-- | drv/drv_pixmap.c | 1 | ||||
-rw-r--r-- | drv/drv_pixmapstr.h | 3 | ||||
-rw-r--r-- | drv/fb/drvfb.h | 4 | ||||
-rw-r--r-- | drv/fb/fbpixmap.c | 4 | ||||
-rw-r--r-- | drv/impedgc.c | 197 | ||||
-rw-r--r-- | drv/impedscrn.c | 7 | ||||
-rw-r--r-- | hw/kdrive/ephyr/ephyr.c | 20 | ||||
-rw-r--r-- | hw/kdrive/src/kdrive.c | 26 |
9 files changed, 140 insertions, 123 deletions
diff --git a/drv/drv_imped.h b/drv/drv_imped.h index 6c8673567..5d4897beb 100644 --- a/drv/drv_imped.h +++ b/drv/drv_imped.h @@ -20,6 +20,7 @@ typedef struct _impedScreenPriv { typedef struct _impedPixmapPriv { DrvPixmapPtr gpu[MAX_GPU]; + Bool shattered; /* the root pixmap is shattered */ } impedPixmapPrivRec, *impedPixmapPrivPtr; typedef struct _impedGCPriv { diff --git a/drv/drv_pixmap.c b/drv/drv_pixmap.c index 38e1b0829..b7e4526db 100644 --- a/drv/drv_pixmap.c +++ b/drv/drv_pixmap.c @@ -52,6 +52,7 @@ DrvAllocatePixmap(DrvScreenPtr pScreen, int pixDataSize) return NullDrvPixmap; dixInitPrivates(pPixmap, pPixmap + 1, PRIVATE_DRV_PIXMAP); + pPixmap->shatter_next = NULL; return pPixmap; } diff --git a/drv/drv_pixmapstr.h b/drv/drv_pixmapstr.h index 2b5e5a87a..20b6c16dc 100644 --- a/drv/drv_pixmapstr.h +++ b/drv/drv_pixmapstr.h @@ -67,6 +67,9 @@ typedef struct _DrvPixmap { int refcnt; PixmapPtr protoPixmap; + int shattered_x, shattered_y; + + struct _DrvPixmap *shatter_next; /* list of pixmaps for this gpu */ } DrvPixmapRec; #endif diff --git a/drv/fb/drvfb.h b/drv/fb/drvfb.h index 5e06fbd2c..88b5c6a6a 100644 --- a/drv/fb/drvfb.h +++ b/drv/fb/drvfb.h @@ -666,8 +666,8 @@ typedef struct { #define __fbPixDrawableY(pPix) 0 #endif -#define __fbPixOffXPix(pPix) (__fbPixDrawableX(pPix)) -#define __fbPixOffYPix(pPix) (__fbPixDrawableY(pPix)) +#define __fbPixOffXPix(pPix) (__fbPixDrawableX(pPix) - pPix->shattered_x) +#define __fbPixOffYPix(pPix) (__fbPixDrawableY(pPix) - pPix->shattered_y) #define fbGetDrawablePixmap(pDrawable, pixmap, xoff, yoff) { \ (pixmap) = (DrvPixmapPtr) (pDrawable); \ diff --git a/drv/fb/fbpixmap.c b/drv/fb/fbpixmap.c index 7d01bc826..3856436ac 100644 --- a/drv/fb/fbpixmap.c +++ b/drv/fb/fbpixmap.c @@ -60,8 +60,8 @@ fbCreatePixmapBpp (DrvScreenPtr pDrvScreen, int width, int height, int depth, in pPixmap->bitsPerPixel = bpp; // pPixmap->id = 0; // pPixmap->serialNumber = NEXT_SERIAL_NUMBER; - // pPixmap->x = 0; - // pPixmap->y = 0; + pPixmap->shattered_x = 0; + pPixmap->shattered_y = 0; pPixmap->width = width; pPixmap->height = height; pPixmap->devKind = paddedWidth; diff --git a/drv/impedgc.c b/drv/impedgc.c index ca9324695..54674d1cb 100644 --- a/drv/impedgc.c +++ b/drv/impedgc.c @@ -12,6 +12,7 @@ #include "gcstruct.h" #include "drv_gcstruct.h" +#include "drv_pixmapstr.h" #include "gc.h" #include "migc.h" #include "mi.h" @@ -47,6 +48,41 @@ static void SyncDrvGC(GCPtr pGC, DrvGCPtr pDrvGC, int index) } } +static void setup_shatter_clip(RegionPtr orig_region, DrvGCPtr pDrvGC, DrvPixmapPtr pDrvPixmap) +{ + BoxRec pixbox; + RegionRec pixclip; + + pixbox.x1 = pDrvPixmap->shattered_x; + pixbox.x2 = pDrvPixmap->shattered_x + pDrvPixmap->width; + pixbox.y1 = pDrvPixmap->shattered_y; + pixbox.y2 = pDrvPixmap->shattered_y + pDrvPixmap->height; + + /* adjust the composite clip */ + RegionInit(&pixclip, &pixbox, 1); + + RegionNull(orig_region); + RegionCopy(orig_region, pDrvGC->pCompositeClip); + RegionIntersect(pDrvGC->pCompositeClip, orig_region, &pixclip); +} + +static void finish_shatter_clip(RegionPtr orig_region, DrvGCPtr pDrvGC) +{ + RegionCopy(pDrvGC->pCompositeClip, orig_region); +} + +#define FOR_EACH_PIXMAP(op) for (int _i = 0; _i < imped_screen->num_gpu; _i++) { \ + DrvGCPtr _pDrvGC = imped_gc->gpu[_i]; \ + DrvPixmapPtr _pDrvPixmap = imped_pixmap->gpu[_i]; \ + RegionRec orig_region; \ + while (_pDrvPixmap) { \ + if (imped_pixmap->shattered) setup_shatter_clip(&orig_region, _pDrvGC, _pDrvPixmap); \ + op; \ + if (imped_pixmap->shattered) finish_shatter_clip(&orig_region, _pDrvGC); \ + _pDrvPixmap = _pDrvPixmap->shatter_next; \ + } \ + } + void impedValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { @@ -95,7 +131,6 @@ impedFillSpans (DrawablePtr pDrawable, int i; int x_off, y_off; PixmapPtr pPixmap = GetDrawablePixmap(pDrawable); - DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); @@ -105,15 +140,12 @@ impedFillSpans (DrawablePtr pDrawable, pptInit[i].y += y_off; } - for (i = 0; i < imped_screen->num_gpu; i++) { - pDrvGC = imped_gc->gpu[i]; - pDrvGC->ops->FillSpans(imped_pixmap->gpu[i], - pDrvGC, - nInit, - pptInit, - pwidthInit, - fSorted); - } + FOR_EACH_PIXMAP(_pDrvGC->ops->FillSpans(_pDrvPixmap, + _pDrvGC, + nInit, + pptInit, + pwidthInit, + fSorted)); } static void @@ -128,7 +160,6 @@ impedSetSpans (DrawablePtr pDrawable, int i; int x_off, y_off; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); - DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); @@ -139,16 +170,14 @@ impedSetSpans (DrawablePtr pDrawable, ppt[i].y += y_off; } - for (i = 0; i < imped_screen->num_gpu; i++) { - pDrvGC = imped_gc->gpu[i]; - pDrvGC->ops->SetSpans(imped_pixmap->gpu[i], - pDrvGC, - src, - ppt, - pwidth, - nspans, - fSorted); - } + + FOR_EACH_PIXMAP(_pDrvGC->ops->SetSpans(_pDrvPixmap, + _pDrvGC, + src, + ppt, + pwidth, + nspans, + fSorted)); } static void @@ -165,22 +194,18 @@ impedPutImage (DrawablePtr pDrawable, { int x_off, y_off; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); - DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); - int i; impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); x += x_off; y += y_off; - for (i = 0; i < imped_screen->num_gpu; i++) { - pDrvGC = imped_gc->gpu[i]; - pDrvGC->ops->PutImage(imped_pixmap->gpu[i], - pDrvGC, - depth, x, y, w, h, - leftPad, format, pImage); - } + + FOR_EACH_PIXMAP(_pDrvGC->ops->PutImage(_pDrvPixmap, + _pDrvGC, + depth, x, y, w, h, + leftPad, format, pImage)); } @@ -194,7 +219,6 @@ impedPolyPoint (DrawablePtr pDrawable, int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; - DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); @@ -209,11 +233,8 @@ impedPolyPoint (DrawablePtr pDrawable, pptInit[i].y += y_off; } } - for (i = 0; i < imped_screen->num_gpu; i++) { - pDrvGC = imped_gc->gpu[i]; - pDrvGC->ops->PolyPoint(imped_pixmap->gpu[i], - pDrvGC, mode, npt, pptInit); - } + FOR_EACH_PIXMAP(_pDrvGC->ops->PolyPoint(_pDrvPixmap, + _pDrvGC, mode, npt, pptInit)); } static void @@ -226,7 +247,6 @@ impedPolyLines (DrawablePtr pDrawable, int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; - DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); @@ -242,11 +262,9 @@ impedPolyLines (DrawablePtr pDrawable, ppt[i].y += y_off; } } - for (i = 0; i < imped_screen->num_gpu; i++) { - pDrvGC = imped_gc->gpu[i]; - pDrvGC->ops->Polylines(imped_pixmap->gpu[i], - pDrvGC, mode, npt, ppt); - } + + FOR_EACH_PIXMAP(_pDrvGC->ops->Polylines(_pDrvPixmap, + _pDrvGC, mode, npt, ppt)); } static void @@ -258,7 +276,6 @@ impedPolySegment (DrawablePtr pDrawable, int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; - DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); @@ -270,11 +287,8 @@ impedPolySegment (DrawablePtr pDrawable, pSegs[i].y1 += y_off; pSegs[i].y2 += y_off; } - for (i = 0; i < imped_screen->num_gpu; i++) { - pDrvGC = imped_gc->gpu[i]; - pDrvGC->ops->PolySegment(imped_pixmap->gpu[i], - pDrvGC, nseg, pSegs); - } + FOR_EACH_PIXMAP(_pDrvGC->ops->PolySegment(_pDrvPixmap, + _pDrvGC, nseg, pSegs)); } static void @@ -283,7 +297,6 @@ impedPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects, xRectangle *pRe int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; - DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); @@ -293,10 +306,8 @@ impedPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects, xRectangle *pRe pRects[i].x += x_off; pRects[i].y += y_off; } - for (i = 0; i < imped_screen->num_gpu; i++) { - pDrvGC = imped_gc->gpu[i]; - pDrvGC->ops->PolyRectangle(imped_pixmap->gpu[i], pDrvGC, nrects, pRects); - } + + FOR_EACH_PIXMAP(_pDrvGC->ops->PolyRectangle(_pDrvPixmap, _pDrvGC, nrects, pRects)); } static void impedPolyArc (DrawablePtr pDrawable, @@ -307,7 +318,6 @@ static void impedPolyArc (DrawablePtr pDrawable, int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; - DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); @@ -317,10 +327,7 @@ static void impedPolyArc (DrawablePtr pDrawable, parcs[i].x += x_off; parcs[i].y += y_off; } - for (i = 0; i < imped_screen->num_gpu; i++) { - pDrvGC = imped_gc->gpu[i]; - pDrvGC->ops->PolyArc(imped_pixmap->gpu[i], pDrvGC, narcs, parcs); - } + FOR_EACH_PIXMAP(_pDrvGC->ops->PolyArc(_pDrvPixmap, _pDrvGC, narcs, parcs)); } static void impedFillPolygon( DrawablePtr pDrawable, GCPtr pGC, @@ -330,7 +337,6 @@ static void impedFillPolygon( DrawablePtr pDrawable, GCPtr pGC, int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; - DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); @@ -340,11 +346,8 @@ static void impedFillPolygon( DrawablePtr pDrawable, GCPtr pGC, pPts[i].x += x_off; pPts[i].y += y_off; } - for (i = 0; i < imped_screen->num_gpu; i++) { - pDrvGC = imped_gc->gpu[i]; - pDrvGC->ops->FillPolygon(imped_pixmap->gpu[i], pDrvGC, shape, - mode, count, pPts); - } + FOR_EACH_PIXMAP(_pDrvGC->ops->FillPolygon(_pDrvPixmap, _pDrvGC, shape, + mode, count, pPts)); } static void impedPolyFillRect(DrawablePtr pDrawable, @@ -355,7 +358,6 @@ static void impedPolyFillRect(DrawablePtr pDrawable, int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; - DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); @@ -366,10 +368,7 @@ static void impedPolyFillRect(DrawablePtr pDrawable, prectInit[i].y += y_off; } - for (i = 0; i < imped_screen->num_gpu; i++) { - pDrvGC = imped_gc->gpu[i]; - pDrvGC->ops->PolyFillRect(imped_pixmap->gpu[i], pDrvGC, nrectFill, prectInit); - } + FOR_EACH_PIXMAP(_pDrvGC->ops->PolyFillRect(_pDrvPixmap, _pDrvGC, nrectFill, prectInit)); } static void impedPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) @@ -377,7 +376,6 @@ static void impedPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; - DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); @@ -388,16 +386,14 @@ static void impedPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * parcs[i].x += x_off; parcs[i].y += y_off; } - for (i = 0; i < imped_screen->num_gpu; i++) { - pDrvGC = imped_gc->gpu[i]; - pDrvGC->ops->PolyFillArc(imped_pixmap->gpu[i], pDrvGC, narcs, parcs); - } + + FOR_EACH_PIXMAP(_pDrvGC->ops->PolyFillArc(_pDrvPixmap, _pDrvGC, narcs, parcs)); } static int impedPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *chars) { - int i, ret; + int i, ret = 0; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; DrvGCPtr pDrvGC; @@ -405,6 +401,7 @@ impedPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char * impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); + for (i = 0; i < imped_screen->num_gpu; i++) { pDrvGC = imped_gc->gpu[i]; ret = pDrvGC->ops->PolyText8(imped_pixmap->gpu[i], pDrvGC, x, y, count, chars); @@ -422,7 +419,7 @@ impedPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsig impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); - int ret; + int ret = 0; impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); @@ -438,38 +435,28 @@ impedPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsig static void impedImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *chars) { - int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; - DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); - for (i = 0; i < imped_screen->num_gpu; i++) { - pDrvGC = imped_gc->gpu[i]; - pDrvGC->ops->ImageText8(imped_pixmap->gpu[i], pDrvGC, x, y, count, chars); - } + FOR_EACH_PIXMAP(_pDrvGC->ops->ImageText8(_pDrvPixmap, _pDrvGC, x, y, count, chars)); } static void impedImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *chars) { - int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; - DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); - for (i = 0; i < imped_screen->num_gpu; i++) { - pDrvGC = imped_gc->gpu[i]; - pDrvGC->ops->ImageText16(imped_pixmap->gpu[i], pDrvGC, x, y, count, chars); - } + FOR_EACH_PIXMAP(_pDrvGC->ops->ImageText16(_pDrvPixmap, _pDrvGC, x, y, count, chars)); } static void @@ -483,21 +470,17 @@ impedPolyGlyphBlt (DrawablePtr pDrawable, { int x_off, y_off; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); - DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); - int i; impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); x += x_off; y += y_off; - for (i = 0; i < imped_screen->num_gpu; i++) { - pDrvGC = imped_gc->gpu[i]; - pDrvGC->ops->PolyGlyphBlt(imped_pixmap->gpu[i], pDrvGC, - x, y, nglyph, - ppci, pglyphBase); - } + + FOR_EACH_PIXMAP(_pDrvGC->ops->PolyGlyphBlt(_pDrvPixmap, _pDrvGC, + x, y, nglyph, + ppci, pglyphBase)); } static void @@ -511,20 +494,16 @@ impedImageGlyphBlt (DrawablePtr pDrawable, { int x_off, y_off; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); - DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); - int i; impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); + impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); x += x_off; y += y_off; - for (i = 0; i < imped_screen->num_gpu; i++) { - pDrvGC = imped_gc->gpu[i]; - pDrvGC->ops->ImageGlyphBlt(imped_pixmap->gpu[i], pDrvGC, - x, y, nglyph, - ppciInit, pglyphBase); - } + FOR_EACH_PIXMAP(_pDrvGC->ops->ImageGlyphBlt(_pDrvPixmap, _pDrvGC, + x, y, nglyph, + ppciInit, pglyphBase)); } void @@ -700,22 +679,18 @@ impedPushPixels (GCPtr pGC, { int x_off, y_off; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); - DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedPixmapPrivPtr imped_bitmap = impedGetPixmap(pBitmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); - int i; impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); xOrg += x_off; yOrg += y_off; - for (i = 0; i < imped_screen->num_gpu; i++) { - pDrvGC = imped_gc->gpu[i]; - pDrvGC->ops->PushPixels(pDrvGC, imped_bitmap->gpu[i], imped_pixmap->gpu[i], - dx, dy, xOrg, yOrg); - } + FOR_EACH_PIXMAP(_pDrvGC->ops->PushPixels(_pDrvGC, imped_bitmap->gpu[_i], _pDrvPixmap, + dx, dy, xOrg, yOrg)); + } const GCOps impedGCOps = { diff --git a/drv/impedscrn.c b/drv/impedscrn.c index 44a193015..f4d86c696 100644 --- a/drv/impedscrn.c +++ b/drv/impedscrn.c @@ -86,8 +86,13 @@ impedCreateScreenResources(ScreenPtr pScreen) pPixmap = pScreen->GetScreenPixmap(pScreen); imped_pixmap = impedGetPixmap(pPixmap); + imped_pixmap->shattered = TRUE; for (i = 0; i < imped_screen->num_gpu; i++) { (imped_screen->gpu[i]->SetScreenPixmap)(imped_screen->gpu[i], imped_pixmap->gpu[i]); + imped_pixmap->gpu[i]->shattered_x = imped_screen->gpu[i]->x; + imped_pixmap->gpu[i]->width = imped_screen->gpu[i]->width; + imped_pixmap->gpu[i]->shattered_y = imped_screen->gpu[i]->y; + imped_pixmap->gpu[i]->height = imped_screen->gpu[i]->height; } for (i = 0; i < imped_screen->num_gpu; i++) { @@ -299,7 +304,7 @@ impedCreatePixmap (ScreenPtr pScreen, int width, int height, int depth, { impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); int i; - + imped_pixmap->shattered = FALSE; for (i = 0; i < imped_screen->num_gpu; i++) { imped_pixmap->gpu[i] = imped_screen->gpu[i]->CreatePixmap(imped_screen->gpu[i], width, height, depth, usage_hint, pPixmap); } diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index 086ea4fda..eb0dc265a 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -347,13 +347,24 @@ ephyrInternalDamageRedisplay (DrvScreenPtr pScreen) KdDrvScreenPriv(pScreen); KdDrvScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; - RegionPtr pRegion; - + RegionPtr pRegion, pScrRegion; + BoxRec screenbox; + if (!scrpriv || !scrpriv->pDamage) return; pRegion = DrvDamageRegion (scrpriv->pDamage); + /* intersect the region with this screen */ + screenbox.x1 = screen->origin.x; + screenbox.x2 = screen->origin.x + screen->width; + screenbox.y1 = screen->origin.y; + screenbox.y2 = screen->origin.y + screen->height; + + RegionInit(&pScrRegion, &screenbox, 1); + + RegionIntersect(pRegion, pRegion, &pScrRegion); + if (RegionNotEmpty(pRegion)) { int nbox; @@ -364,6 +375,11 @@ ephyrInternalDamageRedisplay (DrvScreenPtr pScreen) while (nbox--) { + + pbox->x1 -= screen->origin.x; + pbox->x2 -= screen->origin.x; + pbox->y1 -= screen->origin.y; + pbox->y2 -= screen->origin.y; hostx_paint_rect(screen, pbox->x1, pbox->y1, pbox->x1, pbox->y1, diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c index c9c6082b1..e3a2ce0e2 100644 --- a/hw/kdrive/src/kdrive.c +++ b/hw/kdrive/src/kdrive.c @@ -990,6 +990,8 @@ KdDrvScreenInit(KdDrvScreenInfo *screen, int argc, char **argv) pScreenPriv->dpmsState = KD_DPMS_NORMAL; pScreen->x = screen->origin.x; pScreen->y = screen->origin.y; + pScreen->width = screen->width; + pScreen->height = screen->height; if (!monitorResolution) monitorResolution = 75; @@ -1206,10 +1208,9 @@ KdScreenInit(int index, ScreenPtr pScreen, KdCardInfo *card; KdDrvScreenInfo *drvscreen, *first = NULL; Bool rotated; - int width, height; + int width = 0, height = 0; KdAllocatePrivates (pScreen); - if (!impedSetupScreen(index, pScreen)) return FALSE; @@ -1217,11 +1218,25 @@ KdScreenInit(int index, ScreenPtr pScreen, for (card = kdCardInfo; card; card = card->next) for (drvscreen = card->drv_screenList; drvscreen; drvscreen = drvscreen->next) if (drvscreen->proto_screen == screen->mynum) { - if (!first) - first = drvscreen; - impedAttachDrvScreen(pScreen, drvscreen->pDrvScreen); + int tw, th; + fprintf(stderr,"drvscreen %d x %d @ %d x %d\n", drvscreen->width, drvscreen->height, drvscreen->origin.x, drvscreen->origin.y); + + tw = drvscreen->width + drvscreen->origin.x; + th = drvscreen->height + drvscreen->origin.y; + + if (tw > width) + width = tw; + + if (th > height) + height = th; + + if (!first) + first = drvscreen; + impedAttachDrvScreen(pScreen, drvscreen->pDrvScreen); } + fprintf(stderr,"final width/height %dx%d\n", width, height); +#if 0 rotated = first->randr & (RR_Rotate_90 | RR_Rotate_270); if (!rotated) { width = first->width; @@ -1230,6 +1245,7 @@ KdScreenInit(int index, ScreenPtr pScreen, width = first->height; height = first->width; } +#endif pScreen->InstallColormap = KdInstallColormap; pScreen->UninstallColormap = KdUninstallColormap; |