diff options
author | Dave Airlie <airlied@redhat.com> | 2011-06-10 14:55:30 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-06-10 14:55:30 +1000 |
commit | ff20983f5adb64665004e6aebb2930b545cec86a (patch) | |
tree | 24b3ce0a88519a3ee92d21fd2cf3d2bd995f5cdd /exa | |
parent | 917a547511ae6d02ae36eb258b3f93e3c1fc9b41 (diff) |
drvmodel: another bunch of changes.
this is all an attempt to get EXA to behave in Xephyr.
Diffstat (limited to 'exa')
-rw-r--r-- | exa/exa.c | 12 | ||||
-rw-r--r-- | exa/exa_accel.c | 17 | ||||
-rw-r--r-- | exa/exa_classic.c | 22 | ||||
-rw-r--r-- | exa/exa_driver.c | 4 | ||||
-rw-r--r-- | exa/exa_glyphs.c | 6 | ||||
-rw-r--r-- | exa/exa_migration_mixed.c | 4 | ||||
-rw-r--r-- | exa/exa_mixed.c | 4 | ||||
-rw-r--r-- | exa/exa_offscreen.c | 2 | ||||
-rw-r--r-- | exa/exa_priv.h | 6 | ||||
-rw-r--r-- | exa/exa_render.c | 47 | ||||
-rw-r--r-- | exa/exa_unaccel.c | 32 |
11 files changed, 84 insertions, 72 deletions
@@ -135,7 +135,15 @@ exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2) return; RegionInit(®ion, &box, 1); - //TODO DamageDamageRegion(pPix, ®ion); + + DrvDamageRegionAppend (pPix, ®ion); + + /* Go back and report this damage for DamagePtrs with reportAfter set, since + * this call isn't part of an in-progress drawing op in the call chain and + * the DDX probably just wants to know about it right away. + */ + DrvDamageRegionProcessPending (pPix); + RegionUninit(®ion); } @@ -815,7 +823,7 @@ exaDriverInit (ScreenPtr pScreen, exaDDXDriverInit(pScreen); - if (!dixRegisterPrivateKey(&exaGCPrivateKeyRec, PRIVATE_GC, sizeof(ExaGCPrivRec))) { + if (!dixRegisterPrivateKey(&exaGCPrivateKeyRec, PRIVATE_DRV_GC, sizeof(ExaGCPrivRec))) { LogMessage(X_WARNING, "EXA(%d): Failed to allocate GC private\n", pScreen->myNum); diff --git a/exa/exa_accel.c b/exa/exa_accel.c index a1029a84b..f1ccad24a 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -668,6 +668,7 @@ exaPolylines(PixmapPtr pPixmap, DrvGCPtr pGC, int mode, int npt, prect[i].height = y1 - y2 + 1; } + fprintf(stderr,"prect %d %dx%d %dx%d\n", i, prect[i].x, prect[i].y, prect[i].width, prect[i].height); x1 = x2; y1 = y2; } @@ -757,7 +758,7 @@ exaPolyFillRect(PixmapPtr pPix, RegionPtr pReg = RegionFromRects(nrect, prect, CT_UNSORTED); /* Compute intersection of rects and clip region */ - // RegionTranslate(pReg, pPixmap->x, pPixmap->y); + // RegionTranslate(pReg, 1, 1);//pPixmap->x, pPixmap->y); RegionIntersect(pReg, pClip, pReg); if (!RegionNumRects(pReg)) { @@ -904,15 +905,15 @@ const GCOps exaOps = { exaPolyPoint, exaPolylines, exaPolySegment, - miPolyRectangle, + drvPolyRectangle, ExaCheckPolyArc, - miFillPolygon, + drvFillPolygon, exaPolyFillRect, - miPolyFillArc, - miPolyText8, - miPolyText16, - miImageText8, - miImageText16, + drvPolyFillArc, + drvPolyText8, + drvPolyText16, + drvImageText8, + drvImageText16, ExaCheckImageGlyphBlt, ExaCheckPolyGlyphBlt, ExaCheckPushPixels, diff --git a/exa/exa_classic.c b/exa/exa_classic.c index 2624997c3..9dc00ebb3 100644 --- a/exa/exa_classic.c +++ b/exa/exa_classic.c @@ -54,7 +54,7 @@ ExaGetPixmapAddress(PixmapPtr p) */ PixmapPtr exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth, - unsigned usage_hint) + unsigned usage_hint, ProtoPixmapPtr parent) { PixmapPtr pPixmap; ExaPixmapPrivPtr pExaPixmap; @@ -66,7 +66,7 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth, return NullPixmap; swap(pExaScr, (&pScreen->gpu), CreatePixmap); - pPixmap = pScreen->gpu.CreatePixmap (pScreen, w, h, depth, usage_hint); + pPixmap = pScreen->gpu.CreatePixmap (pScreen, w, h, depth, usage_hint, parent); swap(pExaScr, (&pScreen->gpu), CreatePixmap); if (!pPixmap) @@ -102,9 +102,9 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth, swap(pExaScr, (&pScreen->gpu), DestroyPixmap); return NULL; } -#if 0 + /* Set up damage tracking */ - pExaPixmap->pDamage = DamageCreate (NULL, NULL, + pExaPixmap->pDamage = DrvDamageCreate (NULL, NULL, DamageReportNone, TRUE, pScreen, pPixmap); @@ -115,11 +115,11 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth, return NULL; } - DamageRegister (pPixmap, pExaPixmap->pDamage); + DrvDamageRegister (pPixmap, pExaPixmap->pDamage); /* This ensures that pending damage reflects the current operation. */ /* This is used by exa to optimize migration. */ - DamageSetReportAfterOp (pExaPixmap->pDamage, TRUE); -#endif + DrvDamageSetReportAfterOp (pExaPixmap->pDamage, TRUE); + pExaPixmap->area = NULL; /* We set the initial pixmap as completely valid for a simple reason. @@ -192,13 +192,11 @@ exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, int dept /* Pixmaps subject to ModifyPixmapHeader will be pinned to system or * gpu memory, so there's no need to track damage. */ -#if 0 if (pExaPixmap->pDamage) { - DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage); - DamageDestroy(pExaPixmap->pDamage); + DrvDamageUnregister(pPixmap, pExaPixmap->pDamage); + DrvDamageDestroy(pExaPixmap->pDamage); pExaPixmap->pDamage = NULL; } -#endif } swap(pExaScr, (&pScreen->gpu), ModifyPixmapHeader); @@ -228,7 +226,7 @@ exaDestroyPixmap_classic (PixmapPtr pPixmap) if (pExaPixmap->area) { DBG_PIXMAP(("-- 0x%p (0x%x) (%dx%d)\n", - (void*)pPixmap->id, + 0, ExaGetPixmapPriv(pPixmap)->area->offset, pPixmap->width, pPixmap->height)); diff --git a/exa/exa_driver.c b/exa/exa_driver.c index 36ddcf6d3..430bfadd5 100644 --- a/exa/exa_driver.c +++ b/exa/exa_driver.c @@ -48,7 +48,7 @@ ExaGetPixmapAddress(PixmapPtr p) */ PixmapPtr exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth, - unsigned usage_hint) + unsigned usage_hint, ProtoPixmapPtr parent) { PixmapPtr pPixmap; ExaPixmapPrivPtr pExaPixmap; @@ -60,7 +60,7 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth, return NullPixmap; swap(pExaScr, (&pScreen->gpu), CreatePixmap); - pPixmap = pScreen->gpu.CreatePixmap(pScreen, 0, 0, depth, usage_hint); + pPixmap = pScreen->gpu.CreatePixmap(pScreen, 0, 0, depth, usage_hint, parent); swap(pExaScr, (&pScreen->gpu), CreatePixmap); if (!pPixmap) diff --git a/exa/exa_glyphs.c b/exa/exa_glyphs.c index 61b46b55e..25ac8d3e3 100644 --- a/exa/exa_glyphs.c +++ b/exa/exa_glyphs.c @@ -185,7 +185,7 @@ exaRealizeGlyphCaches(ScreenPtr pScreen, /* Now allocate the pixmap and picture */ pPixmap = (*pScreen->gpu.CreatePixmap) (pScreen, CACHE_PICTURE_WIDTH, - height, depth, 0); + height, depth, 0 , NULL); if (!pPixmap) return FALSE; @@ -737,7 +737,7 @@ exaGlyphs (CARD8 op, pMaskPixmap = (*pScreen->gpu.CreatePixmap) (pScreen, width, height, maskFormat->depth, - CREATE_PIXMAP_USAGE_SCRATCH); + CREATE_PIXMAP_USAGE_SCRATCH, NULL); if (!pMaskPixmap) return; component_alpha = NeedsComponent(maskFormat->format); @@ -765,7 +765,7 @@ exaGlyphs (CARD8 op, pMaskPixmap = (*pScreen->gpu.CreatePixmap) (pScreen, width, height, maskFormat->depth, - CREATE_PIXMAP_USAGE_SCRATCH); + CREATE_PIXMAP_USAGE_SCRATCH, NULL); if (!pMaskPixmap) return; diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c index 77f2d1527..23e8c3481 100644 --- a/exa/exa_migration_mixed.c +++ b/exa/exa_migration_mixed.c @@ -66,8 +66,8 @@ exaCreateDriverPixmap_mixed(PixmapPtr pPixmap) if (!pExaPixmap->driverPriv) return; - (*pScreen->ModifyPixmapHeader)(pPixmap, w, h, 0, 0, - paddedWidth, NULL); + (*pScreen->gpu.ModifyPixmapHeader)(pPixmap, w, h, 0, 0, + paddedWidth, NULL); } void diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c index 701c7108c..fb1a9fcca 100644 --- a/exa/exa_mixed.c +++ b/exa/exa_mixed.c @@ -47,7 +47,7 @@ ExaGetPixmapAddress(PixmapPtr p) */ PixmapPtr exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth, - unsigned usage_hint) + unsigned usage_hint, ProtoPixmapPtr parent) { PixmapPtr pPixmap; ExaPixmapPrivPtr pExaPixmap; @@ -59,7 +59,7 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth, return NullPixmap; swap(pExaScr, (&pScreen->gpu), CreatePixmap); - pPixmap = pScreen->gpu.CreatePixmap(pScreen, 0, 0, depth, usage_hint); + pPixmap = pScreen->gpu.CreatePixmap(pScreen, 0, 0, depth, usage_hint, parent); swap(pExaScr, (&pScreen->gpu), CreatePixmap); if (!pPixmap) diff --git a/exa/exa_offscreen.c b/exa/exa_offscreen.c index d67cd65d0..d2bc6214d 100644 --- a/exa/exa_offscreen.c +++ b/exa/exa_offscreen.c @@ -493,7 +493,7 @@ ExaOffscreenDefragment (ScreenPtr pScreen) PixmapPtr pDstPix; ExaPixmapPrivPtr pExaDstPix; - pDstPix = (*pScreen->gpu.CreatePixmap) (pScreen, 0, 0, 0, 0); + pDstPix = (*pScreen->gpu.CreatePixmap) (pScreen, 0, 0, 0, 0, NULL); if (!pDstPix) return NULL; diff --git a/exa/exa_priv.h b/exa/exa_priv.h index a73452b6b..a15412f86 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -595,7 +595,7 @@ extern const GCFuncs exaGCFuncs; /* exa_classic.c */ PixmapPtr exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth, - unsigned usage_hint); + unsigned usage_hint, ProtoPixmapPtr parent); Bool exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, int depth, @@ -610,7 +610,7 @@ exaPixmapHasGpuCopy_classic(PixmapPtr pPixmap); /* exa_driver.c */ PixmapPtr exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth, - unsigned usage_hint); + unsigned usage_hint, ProtoPixmapPtr parent); Bool exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height, int depth, @@ -625,7 +625,7 @@ exaPixmapHasGpuCopy_driver(PixmapPtr pPixmap); /* exa_mixed.c */ PixmapPtr exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth, - unsigned usage_hint); + unsigned usage_hint, ProtoPixmapPtr parent); Bool exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth, diff --git a/exa/exa_render.c b/exa/exa_render.c index 7935509b1..ea2702953 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -78,7 +78,7 @@ static void exaCompositeFallbackPictDesc(DrvPicturePtr pict, char *string, int n } if (pict->pPixmap) { - loc = exaGetOffscreenPixmap(pict->pPixmap, &temp, &temp) ? 's' : 'm'; + loc = exaGetOffscreenPixmap(pict->pPixmap) ? 's' : 'm'; snprintf(size, 20, "%dx%d%s", pict->pPixmap->width, pict->pPixmap->height, pict->repeat ? @@ -285,10 +285,12 @@ exaTryDriverSolidFill(DrvPicturePtr pSrc, ySrc += pSrc->pPixmap->y; } #endif - if (!miComputeCompositeRegion (®ion, pSrc, NULL, pDst, - xSrc, ySrc, 0, 0, xDst, yDst, - width, height)) + if (!drvComputeCompositeRegion (®ion, pSrc, NULL, pDst, + xSrc, ySrc, 0, 0, xDst, yDst, + width, height)) { + ErrorF("compute comp failed\n"); return 1; + } if (pSrc->pPixmap) { pSrcPix = pSrc->pPixmap; @@ -301,7 +303,8 @@ exaTryDriverSolidFill(DrvPicturePtr pSrc, !exaGetPixelFromRGBA(&pixel, red, green, blue, alpha, pDst->pFormat)) { - RegionUninit(®ion); + ErrorF("failed to get rgba\n"); + RegionUninit(®ion); return -1; } @@ -317,11 +320,13 @@ exaTryDriverSolidFill(DrvPicturePtr pSrc, if (!exaPixmapHasGpuCopy(pDstPix)) { RegionUninit(®ion); + ErrorF("failed to have gpu copy\n"); return 0; } if (!(*pExaScr->info->PrepareSolid) (pDstPix, GXcopy, 0xffffffff, pixel)) { + ErrorF("failed to prepare solid\n"); RegionUninit(®ion); return -1; } @@ -459,7 +464,7 @@ exaTryDriverCompositeRects(CARD8 op, ySrc += pSrc->pPixmap->y; } #endif - if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, + if (!drvComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, rects->width, rects->height)) goto next_rect; @@ -577,10 +582,10 @@ exaCompositeRects(CARD8 op, /************************************************************/ - ValidatePicture (pSrc); + DrvValidatePicture (pSrc); if (pMask) - ValidatePicture (pMask); - ValidatePicture (pDst); + DrvValidatePicture (pMask); + DrvValidatePicture (pDst); ret = exaTryDriverCompositeRects(op, pSrc, pMask, pDst, nrect, rects); @@ -688,9 +693,9 @@ exaTryDriverComposite(CARD8 op, return -1; } - if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, - xSrc, ySrc, xMask, yMask, xDst, yDst, - width, height)) + if (!drvComputeCompositeRegion (®ion, pSrc, pMask, pDst, + xSrc, ySrc, xMask, yMask, xDst, yDst, + width, height)) return 1; if (pExaScr->do_migration) { @@ -885,7 +890,7 @@ exaComposite(CARD8 op, { ExaScreenPriv (pDst->pPixmap->pScreen); int ret = -1; - Bool saveSrcRepeat = pSrc->repeat; + Bool saveSrcRepeat = pSrc ? pSrc->repeat : 0; Bool saveMaskRepeat = pMask ? pMask->repeat : 0; RegionRec region; @@ -935,9 +940,9 @@ exaComposite(CARD8 op, xSrc += pSrc->pPixmap->x; ySrc += pSrc->pPixmap->y; #endif - if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, - xSrc, ySrc, xMask, yMask, xDst, - yDst, width, height)) + if (!drvComputeCompositeRegion (®ion, pSrc, pMask, pDst, + xSrc, ySrc, xMask, yMask, xDst, + yDst, width, height)) goto done; ret = exaHWCopyNtoN(pSrc->pPixmap, pDst->pPixmap, NULL, @@ -980,9 +985,9 @@ exaComposite(CARD8 op, xSrc += pSrc->pPixmap->x; ySrc += pSrc->pPixmap->y; #endif - if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, - ySrc, xMask, yMask, xDst, yDst, - width, height)) + if (!drvComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, + ySrc, xMask, yMask, xDst, yDst, + width, height)) goto done; /* pattern origin is the point in the destination drawable @@ -1097,7 +1102,7 @@ exaCreateAlphaPicture (ScreenPtr pScreen, } pPixmap = (*pScreen->gpu.CreatePixmap) (pScreen, width, height, - pPictFormat->depth, 0); + pPictFormat->depth, 0, NULL); if (!pPixmap) return 0; pGC = DrvGetScratchGC (pPixmap->depth, pScreen); @@ -1173,7 +1178,7 @@ exaTrapezoids (CARD8 op, DrvPicturePtr pSrc, DrvPicturePtr pDst, xRel, yRel, 0, 0, bounds.x1, bounds.y1, bounds.x2 - bounds.x1, bounds.y2 - bounds.y1); - FreePicture (pPicture, 0); + DrvFreePicture (pPicture); } else { if (pDst->polyEdge == PolyEdgeSharp) maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1); diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index 2f4d0d35e..2faf963dc 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -186,7 +186,7 @@ ExaFallbackPrepareReg(PixmapPtr pPixmap, pGC->clientClipType))) { BoxRec box; RegionRec reg; - PixmapPtr pPixmap = exaGetDrawablePixmap(pPixmap); + // PixmapPtr pPixmap = exaGetDrawablePixmap(pPixmap); box.x1 = x; box.y1 = y; @@ -352,7 +352,7 @@ ExaCheckPushPixels (DrvGCPtr pGC, PixmapPtr pBitmap, { EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("from %p to %p (%c,%c)\n", pBitmap, pPixmap, - exaDrawableLocation(&pBitmap->drawable), + exaDrawableLocation(pBitmap), exaDrawableLocation(pPixmap))); ExaFallbackPrepareReg(pPixmap, pGC, x, y, w, h, EXA_PREPARE_DEST, TRUE); @@ -471,8 +471,8 @@ ExaPrepareCompositeReg(ScreenPtr pScreen, RegionNull(&pExaScr->srcReg); srcReg = &pExaScr->srcReg; pExaScr->srcPix = pSrcPix; - if (pSrc != pDst) - RegionTranslate(pSrc->pCompositeClip, 0 , 0); + // if (pSrc != pDst) + // RegionTranslate(pSrc->pCompositeClip, 0 , 0); // -pSrc->pPixmap->x, // -pSrc->pPixmap->y); } @@ -481,35 +481,35 @@ ExaPrepareCompositeReg(ScreenPtr pScreen, pMaskPix = exaGetDrawablePixmap(pMask->pPixmap); RegionNull(&pExaScr->maskReg); maskReg = &pExaScr->maskReg; - if (pMask != pDst && pMask != pSrc) - RegionTranslate(pMask->pCompositeClip, 0, 0); + // if (pMask != pDst && pMask != pSrc) + // RegionTranslate(pMask->pCompositeClip, 0, 0); // -pMask->pPixmap->x, // -pMask->pPixmap->y); } - RegionTranslate(pDst->pCompositeClip, 0, 0); + // RegionTranslate(pDst->pCompositeClip, 0, 0); // -pDst->pPixmap->x, // -pDst->pPixmap->y); pExaScr->SavedSourceValidate = ExaSrcValidate; swap(pExaScr, pScreen, SourceValidate); - ret = miComputeCompositeRegion (®ion, pSrc, pMask, pDst, - xSrc, ySrc, xMask, yMask, - xDst, - yDst, + ret = drvComputeCompositeRegion (®ion, pSrc, pMask, pDst, + xSrc, ySrc, xMask, yMask, + xDst, + yDst, width, height); swap(pExaScr, pScreen, SourceValidate); - RegionTranslate(pDst->pCompositeClip, 0, 0); + // RegionTranslate(pDst->pCompositeClip, 0, 0); // pDst->pPixmap->x, // pDst->pPixmap->y); - if (pSrc->pPixmap && pSrc != pDst) - RegionTranslate(pSrc->pCompositeClip, 0, 0); + // if (pSrc->pPixmap && pSrc != pDst) + // RegionTranslate(pSrc->pCompositeClip, 0, 0); // pSrc->pPixmap->x, // pSrc->pPixmap->y); - if (pMask && pMask->pPixmap && pMask != pDst && pMask != pSrc) - RegionTranslate(pMask->pCompositeClip, 0, 0); + // if (pMask && pMask->pPixmap && pMask != pDst && pMask != pSrc) + // RegionTranslate(pMask->pCompositeClip, 0, 0); /// pMask->pPixmap->x, ///pMask->pPixmap->y); |