summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--exa/exa.c29
-rw-r--r--exa/exa_accel.c29
-rw-r--r--exa/exa_migration.c29
-rw-r--r--exa/exa_render.c67
-rw-r--r--hw/xfree86/exa/exa.c29
-rw-r--r--hw/xfree86/exa/exa_accel.c29
-rw-r--r--hw/xfree86/exa/exa_migration.c29
-rw-r--r--hw/xfree86/exa/exa_render.c67
-rw-r--r--hw/xfree86/exa/exapict.c67
9 files changed, 201 insertions, 174 deletions
diff --git a/exa/exa.c b/exa/exa.c
index 9c608d6ab..29a94b31d 100644
--- a/exa/exa.c
+++ b/exa/exa.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);
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 9c608d6ab..29a94b31d 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.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);
diff --git a/exa/exa_migration.c b/exa/exa_migration.c
index 9c608d6ab..29a94b31d 100644
--- a/exa/exa_migration.c
+++ b/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);
diff --git a/exa/exa_render.c b/exa/exa_render.c
index 438c876e8..9909d7f46 100644
--- a/exa/exa_render.c
+++ b/exa/exa_render.c
@@ -327,65 +327,20 @@ exaTryDriverComposite(CARD8 op,
PixmapPtr pSrcPix, pMaskPix = NULL, pDstPix;
struct _Pixmap scratch;
- if (pExaScr->info->card.maxX < width ||
- pExaScr->info->card.maxY < height)
+ /* Bail if we might exceed coord limits by rendering from/to these. We
+ * should really be making some scratch pixmaps with offsets and coords
+ * adjusted to deal with this, but it hasn't been done yet.
+ */
+ if (pSrc->pDrawable->width > pExaScr->info->card.maxX ||
+ pSrc->pDrawable->height > pExaScr->info->card.maxY ||
+ pDst->pDrawable->width > pExaScr->info->card.maxX ||
+ pDst->pDrawable->height > pExaScr->info->card.maxY ||
+ (pMask && (pMask->pDrawable->width > pExaScr->info->card.maxX ||
+ pMask->pDrawable->height > pExaScr->info->card.maxY)))
{
- int total_width = width;
- int total_height = height;
- int xOff = 0;
- int yOff = 0;
- while (total_width > pExaScr->info->card.maxX) {
- while (total_height > pExaScr->info->card.maxY) {
- exaTryDriverComposite(op,
- pSrc,
- pMask,
- pDst,
- xSrc + xOff,
- ySrc + yOff,
- xMask + xOff,
- yMask + yOff,
- xDst + xOff,
- yDst + yOff,
- pExaScr->info->card.maxX,
- pExaScr->info->card.maxY);
- total_width -= pExaScr->info->card.maxX;
- xOff += pExaScr->info->card.maxX;
- yOff = 0;
- }
- if (total_height)
- exaTryDriverComposite(op,
- pSrc,
- pMask,
- pDst,
- xSrc + xOff,
- ySrc + yOff,
- xMask + xOff,
- yMask + yOff,
- xDst + xOff,
- yDst + yOff,
- pExaScr->info->card.maxX,
- total_height);
- total_height -= pExaScr->info->card.maxY;
- yOff += pExaScr->info->card.maxY;
- }
- if (total_width && total_height)
- exaTryDriverComposite(op,
- pSrc,
- pMask,
- pDst,
- xSrc + xOff,
- ySrc + yOff,
- xMask + xOff,
- yMask + yOff,
- xDst + xOff,
- yDst + yOff,
- total_width,
- total_height);
-
- return -1;
+ return -1;
}
-
xDst += pDst->pDrawable->x;
yDst += pDst->pDrawable->y;
diff --git a/hw/xfree86/exa/exa.c b/hw/xfree86/exa/exa.c
index 9c608d6ab..29a94b31d 100644
--- a/hw/xfree86/exa/exa.c
+++ b/hw/xfree86/exa/exa.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);
diff --git a/hw/xfree86/exa/exa_accel.c b/hw/xfree86/exa/exa_accel.c
index 9c608d6ab..29a94b31d 100644
--- a/hw/xfree86/exa/exa_accel.c
+++ b/hw/xfree86/exa/exa_accel.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);
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);
diff --git a/hw/xfree86/exa/exa_render.c b/hw/xfree86/exa/exa_render.c
index 438c876e8..9909d7f46 100644
--- a/hw/xfree86/exa/exa_render.c
+++ b/hw/xfree86/exa/exa_render.c
@@ -327,65 +327,20 @@ exaTryDriverComposite(CARD8 op,
PixmapPtr pSrcPix, pMaskPix = NULL, pDstPix;
struct _Pixmap scratch;
- if (pExaScr->info->card.maxX < width ||
- pExaScr->info->card.maxY < height)
+ /* Bail if we might exceed coord limits by rendering from/to these. We
+ * should really be making some scratch pixmaps with offsets and coords
+ * adjusted to deal with this, but it hasn't been done yet.
+ */
+ if (pSrc->pDrawable->width > pExaScr->info->card.maxX ||
+ pSrc->pDrawable->height > pExaScr->info->card.maxY ||
+ pDst->pDrawable->width > pExaScr->info->card.maxX ||
+ pDst->pDrawable->height > pExaScr->info->card.maxY ||
+ (pMask && (pMask->pDrawable->width > pExaScr->info->card.maxX ||
+ pMask->pDrawable->height > pExaScr->info->card.maxY)))
{
- int total_width = width;
- int total_height = height;
- int xOff = 0;
- int yOff = 0;
- while (total_width > pExaScr->info->card.maxX) {
- while (total_height > pExaScr->info->card.maxY) {
- exaTryDriverComposite(op,
- pSrc,
- pMask,
- pDst,
- xSrc + xOff,
- ySrc + yOff,
- xMask + xOff,
- yMask + yOff,
- xDst + xOff,
- yDst + yOff,
- pExaScr->info->card.maxX,
- pExaScr->info->card.maxY);
- total_width -= pExaScr->info->card.maxX;
- xOff += pExaScr->info->card.maxX;
- yOff = 0;
- }
- if (total_height)
- exaTryDriverComposite(op,
- pSrc,
- pMask,
- pDst,
- xSrc + xOff,
- ySrc + yOff,
- xMask + xOff,
- yMask + yOff,
- xDst + xOff,
- yDst + yOff,
- pExaScr->info->card.maxX,
- total_height);
- total_height -= pExaScr->info->card.maxY;
- yOff += pExaScr->info->card.maxY;
- }
- if (total_width && total_height)
- exaTryDriverComposite(op,
- pSrc,
- pMask,
- pDst,
- xSrc + xOff,
- ySrc + yOff,
- xMask + xOff,
- yMask + yOff,
- xDst + xOff,
- yDst + yOff,
- total_width,
- total_height);
-
- return -1;
+ return -1;
}
-
xDst += pDst->pDrawable->x;
yDst += pDst->pDrawable->y;
diff --git a/hw/xfree86/exa/exapict.c b/hw/xfree86/exa/exapict.c
index 438c876e8..9909d7f46 100644
--- a/hw/xfree86/exa/exapict.c
+++ b/hw/xfree86/exa/exapict.c
@@ -327,65 +327,20 @@ exaTryDriverComposite(CARD8 op,
PixmapPtr pSrcPix, pMaskPix = NULL, pDstPix;
struct _Pixmap scratch;
- if (pExaScr->info->card.maxX < width ||
- pExaScr->info->card.maxY < height)
+ /* Bail if we might exceed coord limits by rendering from/to these. We
+ * should really be making some scratch pixmaps with offsets and coords
+ * adjusted to deal with this, but it hasn't been done yet.
+ */
+ if (pSrc->pDrawable->width > pExaScr->info->card.maxX ||
+ pSrc->pDrawable->height > pExaScr->info->card.maxY ||
+ pDst->pDrawable->width > pExaScr->info->card.maxX ||
+ pDst->pDrawable->height > pExaScr->info->card.maxY ||
+ (pMask && (pMask->pDrawable->width > pExaScr->info->card.maxX ||
+ pMask->pDrawable->height > pExaScr->info->card.maxY)))
{
- int total_width = width;
- int total_height = height;
- int xOff = 0;
- int yOff = 0;
- while (total_width > pExaScr->info->card.maxX) {
- while (total_height > pExaScr->info->card.maxY) {
- exaTryDriverComposite(op,
- pSrc,
- pMask,
- pDst,
- xSrc + xOff,
- ySrc + yOff,
- xMask + xOff,
- yMask + yOff,
- xDst + xOff,
- yDst + yOff,
- pExaScr->info->card.maxX,
- pExaScr->info->card.maxY);
- total_width -= pExaScr->info->card.maxX;
- xOff += pExaScr->info->card.maxX;
- yOff = 0;
- }
- if (total_height)
- exaTryDriverComposite(op,
- pSrc,
- pMask,
- pDst,
- xSrc + xOff,
- ySrc + yOff,
- xMask + xOff,
- yMask + yOff,
- xDst + xOff,
- yDst + yOff,
- pExaScr->info->card.maxX,
- total_height);
- total_height -= pExaScr->info->card.maxY;
- yOff += pExaScr->info->card.maxY;
- }
- if (total_width && total_height)
- exaTryDriverComposite(op,
- pSrc,
- pMask,
- pDst,
- xSrc + xOff,
- ySrc + yOff,
- xMask + xOff,
- yMask + yOff,
- xDst + xOff,
- yDst + yOff,
- total_width,
- total_height);
-
- return -1;
+ return -1;
}
-
xDst += pDst->pDrawable->x;
yDst += pDst->pDrawable->y;