diff options
author | Eric Anholt <anholt@freebsd.org> | 2005-08-30 04:41:04 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2005-08-30 04:41:04 +0000 |
commit | 0c74799af4f924ba64ebd6052802b73547f55c72 (patch) | |
tree | 7dad282a6a084ad34da3c801c810da33ed7914bb /hw/xfree86/exa/exa_migration.c | |
parent | f20e845b04dee5fc0780811f565180e322b60b73 (diff) |
Remove existing broken maxX/maxY code for composite (results in infinite
loops, doesn't deal with failure, doesn't present the interface to
drivers that I expected) and instead replace it with a simple fallback
to software when coordinate limits could be violated. Act similarly in
other acceleration cases as well.
The solution I want to see (and intend to do soon) is to (when necessary)
create temporary pictures/pixmaps pointing towards the real ones' bits,
with the offsets adjusted, then render from/to those using adjusted
coordinates.
Diffstat (limited to 'hw/xfree86/exa/exa_migration.c')
-rw-r--r-- | hw/xfree86/exa/exa_migration.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/hw/xfree86/exa/exa_migration.c b/hw/xfree86/exa/exa_migration.c index 9c608d6ab..29a94b31d 100644 --- a/hw/xfree86/exa/exa_migration.c +++ b/hw/xfree86/exa/exa_migration.c @@ -517,6 +517,8 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, STRACE; if (pGC->fillStyle != FillSolid || + pDrawable->width > pExaScr->info->card.maxX || + pDrawable->height > pExaScr->info->card.maxY || !(pPixmap = exaGetOffscreenPixmap (pDrawable, &off_x, &off_y)) || !(*pExaScr->info->accel.PrepareSolid) (pPixmap, pGC->alu, @@ -605,6 +607,25 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, int dst_off_x, dst_off_y; STRACE; + /* Respect maxX/maxY in a trivial way: don't set up drawing when we might + * violate the limits. The proper solution would be a temporary pixmap + * adjusted so that the drawing happened within limits. + */ + if (pSrcDrawable->width > pExaScr->info->card.maxX || + pSrcDrawable->height > pExaScr->info->card.maxY || + pDstDrawable->width > pExaScr->info->card.maxX || + pDstDrawable->height > pExaScr->info->card.maxY) + { + if (pSrcDrawable->type == DRAWABLE_PIXMAP) + exaPixmapUseMemory ((PixmapPtr) pSrcDrawable); + if (pDstDrawable->type == DRAWABLE_PIXMAP) + exaPixmapUseMemory ((PixmapPtr) pDstDrawable); + exaWaitSync (pDstDrawable->pScreen); + fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, + pbox, nbox, dx, dy, reverse, upsidedown, + bitplane, closure); + } + /* If either drawable is already in framebuffer, try to get both of them * there. Otherwise, be happy with where they are. */ @@ -691,6 +712,8 @@ exaPolyFillRect(DrawablePtr pDrawable, STRACE; if (!pScrn->vtSema || pGC->fillStyle != FillSolid || + pDrawable->width > pExaScr->info->card.maxX || + pDrawable->height > pExaScr->info->card.maxY || !(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) || !(*pExaScr->info->accel.PrepareSolid) (pPixmap, pGC->alu, @@ -794,6 +817,8 @@ exaSolidBoxClipped (DrawablePtr pDrawable, STRACE; if (!pScrn->vtSema || + pDrawable->width > pExaScr->info->card.maxX || + pDrawable->height > pExaScr->info->card.maxY || !(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) || !(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg)) { @@ -1079,7 +1104,9 @@ exaFillRegionSolid (DrawablePtr pDrawable, int xoff, yoff; STRACE; - if ((pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) && + if (pDrawable->width <= pExaScr->info->card.maxX && + pDrawable->height <= pExaScr->info->card.maxY && + (pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) && (*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, FB_ALLONES, pixel)) { int nbox = REGION_NUM_RECTS (pRegion); |