summaryrefslogtreecommitdiff
path: root/exa
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2008-08-27 16:05:47 -0400
committerAdam Jackson <ajax@redhat.com>2008-08-28 10:12:28 -0400
commitee7c684f21d220d5e046bab31ae617a7d64d60f6 (patch)
tree92a290b945986fe642d81ab6f86f17e62ea3436a /exa
parent2db1afbf2e56d8743c701d81a5797001ce9e5c52 (diff)
Reimplement ShmPutImage.
There's no reason to not just dispatch this straight into the GC. As a bonus, if you do so, damage wraps correctly, and thus swcursor works. The side effect is it's no longer possible to override ShmPutImage with ShmRegisterFuncs(). Also remove the (broken) damage tracking for same from EXA, since it didn't work right, and is now superfluous.
Diffstat (limited to 'exa')
-rw-r--r--exa/exa.c7
-rw-r--r--exa/exa_accel.c88
-rw-r--r--exa/exa_priv.h9
3 files changed, 0 insertions, 104 deletions
diff --git a/exa/exa.c b/exa/exa.c
index ab7aab330..12c154960 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -936,13 +936,6 @@ exaDriverInit (ScreenPtr pScreen,
}
#endif
-#ifdef MITSHM
- /* Re-register with the MI funcs, which don't allow shared pixmaps.
- * Shared pixmaps are almost always a performance loss for us, but this
- * still allows for SHM PutImage.
- */
- ShmRegisterFuncs(pScreen, &exaShmFuncs);
-#endif
/*
* Hookup offscreen pixmaps
*/
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index c3cf36541..1c07a0b36 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -249,100 +249,12 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
return TRUE;
}
-#ifdef MITSHM
-
-static Bool
-exaDoShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
- unsigned int format, int w, int h, int sx, int sy, int sw,
- int sh, int dx, int dy, char *data)
-{
- int src_stride = PixmapBytePad(w, depth);
-
- if (exaDoPutImage(pDrawable, pGC, depth, dx, dy, sw, sh, format, data +
- sy * src_stride + sx * BitsPerPixel(depth) / 8,
- src_stride))
- return TRUE;
-
- if (format == ZPixmap)
- {
- PixmapPtr pPixmap =
- GetScratchPixmapHeader(pDrawable->pScreen, w, h, depth,
- BitsPerPixel(depth), PixmapBytePad(w, depth),
- (pointer)data);
-
- if (!pPixmap)
- return FALSE;
-
- pGC->ops->CopyArea(&pPixmap->drawable, pDrawable, pGC, sx, sy, sw, sh,
- dx, dy);
-
- FreeScratchPixmapHeader(pPixmap);
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-/* The actual ShmPutImage isn't wrapped by the damage layer, so we need to
- * inform any interested parties of the damage incurred to the drawable.
- *
- * We also need to set the pending damage to ensure correct migration in all
- * cases.
- */
-void
-exaShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int format,
- int w, int h, int sx, int sy, int sw, int sh, int dx, int dy,
- char *data)
-{
- PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
- ExaPixmapPriv(pPixmap);
- BoxRec box = { .x1 = pDrawable->x + dx, .y1 = pDrawable->y + dy,
- .x2 = pDrawable->x + dx + sw, .y2 = pDrawable->y + dy + sh };
- RegionRec region;
- RegionPtr pending_damage = NULL;
-
- if (pExaPixmap->pDamage)
- pending_damage = DamagePendingRegion(pExaPixmap->pDamage);
-
- if (pending_damage) {
- REGION_INIT(pScreen, &region, &box, 1);
- exaDamageDestForMigration(pDrawable, pPixmap, &region);
- }
-
- if (!exaDoShmPutImage(pDrawable, pGC, depth, format, w, h, sx, sy, sw, sh,
- dx, dy, data)) {
- if (exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle,
- pGC->alu))
- exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
- else
- exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, &region);
- fbShmPutImage(pDrawable, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy,
- data);
- exaFinishAccess(pDrawable, EXA_PREPARE_DEST);
- }
-
- if (pending_damage) {
- DamageDamageRegion(pDrawable, &region);
- REGION_UNINIT(pScreen, &region);
- }
-}
-
-ShmFuncs exaShmFuncs = { NULL, exaShmPutImage };
-
-#endif
-
static void
exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
int w, int h, int leftPad, int format, char *bits)
{
-#ifdef MITSHM
- if (!exaDoShmPutImage(pDrawable, pGC, depth, format, w, h, 0, 0, w, h, x, y,
- bits))
-#else
if (!exaDoPutImage(pDrawable, pGC, depth, x, y, w, h, format, bits,
PixmapBytePad(w, pDrawable->depth)))
-#endif
ExaCheckPutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format,
bits);
}
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index ca7122be9..0ebe07bd5 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -351,20 +351,11 @@ exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
DDXPointPtr pPatOrg, CARD32 planemask, CARD32 alu);
void
-exaShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int format,
- int w, int h, int sx, int sy, int sw, int sh, int dx, int dy,
- char *data);
-
-void
exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h,
unsigned int format, unsigned long planeMask, char *d);
extern const GCOps exaOps;
-#ifdef MITSHM
-extern ShmFuncs exaShmFuncs;
-#endif
-
#ifdef RENDER
void
ExaCheckComposite (CARD8 op,