summaryrefslogtreecommitdiff
path: root/exa
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-10-19 15:44:17 -0700
committerEric Anholt <eric@anholt.net>2007-10-19 15:44:17 -0700
commita3a95d3475dc91ed2e8a55bf484a6b3f2b5ac32a (patch)
tree8ad023078041200816ec76c4d83d04fd46799655 /exa
parenta358b87f45ce75e5d013fc904a07dfe394f74387 (diff)
parent7e1cada6c6b9fa41ef3ead00bf7725d626dda193 (diff)
Merge branch 'master' into glyph-pixmaps
Conflicts: configure.ac
Diffstat (limited to 'exa')
-rw-r--r--exa/exa.c12
-rw-r--r--exa/exa.h7
-rw-r--r--exa/exa_accel.c6
-rw-r--r--exa/exa_migration.c6
-rw-r--r--exa/exa_render.c17
5 files changed, 39 insertions, 9 deletions
diff --git a/exa/exa.c b/exa/exa.c
index 3e8054da9..7ad226fba 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -286,8 +286,9 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
(*pScreen->ModifyPixmapHeader)(pPixmap, w, h, 0, 0,
paddedWidth, NULL);
- pExaPixmap->driverPriv = driver_priv;
- pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
+ pExaPixmap->driverPriv = driver_priv;
+ pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
+ pExaPixmap->fb_ptr = NULL;
} else {
pExaPixmap->driverPriv = NULL;
/* Glyphs have w/h equal to zero, and may not be migrated. See exaGlyphs. */
@@ -409,7 +410,7 @@ exaPixmapIsOffscreen(PixmapPtr p)
save_ptr = p->devPrivate.ptr;
- if (!save_ptr && pExaPixmap)
+ if (!save_ptr && pExaPixmap && !(pExaScr->info->flags & EXA_HANDLES_PIXMAPS))
p->devPrivate.ptr = ExaGetPixmapAddress(p);
if (pExaScr->info->PixmapIsOffscreen)
@@ -459,7 +460,7 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index)
Bool offscreen = exaPixmapIsOffscreen(pPixmap);
/* Unhide pixmap pointer */
- if (pPixmap->devPrivate.ptr == NULL) {
+ if (pPixmap->devPrivate.ptr == NULL && !(pExaScr->info->flags & EXA_HANDLES_PIXMAPS)) {
pPixmap->devPrivate.ptr = ExaGetPixmapAddress(pPixmap);
}
@@ -520,8 +521,7 @@ exaFinishAccess(DrawablePtr pDrawable, int index)
ExaPixmapPriv (pPixmap);
/* Rehide pixmap pointer if we're doing that. */
- if (pExaPixmap)
- {
+ if (pExaPixmap && !(pExaScr->info->flags & EXA_HANDLES_PIXMAPS)) {
pPixmap->devPrivate.ptr = NULL;
}
diff --git a/exa/exa.h b/exa/exa.h
index f852df482..1ff0518e4 100644
--- a/exa/exa.h
+++ b/exa/exa.h
@@ -733,6 +733,13 @@ typedef struct _ExaDriver {
* (right-to-left, bottom-to-top).
*/
#define EXA_TWO_BITBLT_DIRECTIONS (1 << 2)
+
+/**
+ * EXA_HANDLES_PIXMAPS indicates to EXA that the driver can handle
+ * all pixmap addressing and migration.
+ */
+#define EXA_HANDLES_PIXMAPS (1 << 3)
+
/** @} */
ExaDriverPtr
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index abe5c204f..52cc5c40a 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -152,6 +152,9 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
int bpp = pDrawable->bitsPerPixel;
Bool access_prepared = FALSE;
+ if (pExaPixmap->accel_blocked)
+ return FALSE;
+
/* Don't bother with under 8bpp, XYPixmaps. */
if (format != ZPixmap || bpp < 8)
return FALSE;
@@ -1134,7 +1137,8 @@ exaFillRegionSolid (DrawablePtr pDrawable,
(*pExaScr->info->DoneSolid) (pPixmap);
exaMarkSync(pDrawable->pScreen);
- if (pDrawable->width == 1 && pDrawable->height == 1 &&
+ if (!(pExaScr->info->flags & EXA_HANDLES_PIXMAPS) &&
+ pDrawable->width == 1 && pDrawable->height == 1 &&
pDrawable->bitsPerPixel != 24) {
ExaPixmapPriv(pPixmap);
diff --git a/exa/exa_migration.c b/exa/exa_migration.c
index c0e022ca7..d69526b7f 100644
--- a/exa/exa_migration.c
+++ b/exa/exa_migration.c
@@ -299,6 +299,9 @@ exaDoMoveInPixmap (ExaMigrationPtr migrate)
if (pPixmap->drawable.bitsPerPixel < 8)
return;
+ if (pExaPixmap->accel_blocked)
+ return;
+
if (pExaPixmap->area == NULL) {
pExaPixmap->area =
exaOffscreenAlloc (pScreen, pExaPixmap->fb_size,
@@ -553,6 +556,9 @@ exaDoMigration (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel)
ExaScreenPriv(pScreen);
int i, j;
+ if (pExaScr->info->flags & EXA_HANDLES_PIXMAPS)
+ return;
+
/* If this debugging flag is set, check each pixmap for whether it is marked
* as clean, and if so, actually check if that's the case. This should help
* catch issues with failing to mark a drawable as dirty. While it will
diff --git a/exa/exa_render.c b/exa/exa_render.c
index 98fc884b6..847a36182 100644
--- a/exa/exa_render.c
+++ b/exa/exa_render.c
@@ -247,10 +247,24 @@ exaTryDriverSolidFill(PicturePtr pSrc,
int nbox;
int dst_off_x, dst_off_y;
PixmapPtr pSrcPix, pDstPix;
+ ExaPixmapPrivPtr pSrcExaPix, pDstExaPix;
CARD32 pixel;
CARD16 red, green, blue, alpha;
ExaMigrationRec pixmaps[1];
+ pDstPix = exaGetDrawablePixmap (pDst->pDrawable);
+ pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable);
+
+ pSrcExaPix = ExaGetPixmapPriv(pSrcPix);
+ pDstExaPix = ExaGetPixmapPriv(pDstPix);
+
+ /* Check whether the accelerator can use these pixmaps.
+ */
+ if (pSrcExaPix->accel_blocked || pDstExaPix->accel_blocked)
+ {
+ return -1;
+ }
+
xDst += pDst->pDrawable->x;
yDst += pDst->pDrawable->y;
xSrc += pSrc->pDrawable->x;
@@ -261,12 +275,10 @@ exaTryDriverSolidFill(PicturePtr pSrc,
width, height))
return 1;
- pDstPix = exaGetDrawablePixmap (pDst->pDrawable);
exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y);
REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
- pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable);
pixel = exaGetPixmapFirstPixel (pSrcPix);
pixmaps[0].as_dst = TRUE;
@@ -1202,6 +1214,7 @@ exaGlyphs (CARD8 op,
y1 = y - glyph->info.y;
if (x1 >= pCmpDrw->width || y1 >= pCmpDrw->height ||
+ glyph->info.width == 0 || glyph->info.height == 0 ||
(x1 + glyph->info.width) <= 0 || (y1 + glyph->info.height) <= 0)
goto nextglyph;