summaryrefslogtreecommitdiff
path: root/exa/exa_accel.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-09-17 20:02:02 +0000
committerEric Anholt <anholt@freebsd.org>2005-09-17 20:02:02 +0000
commit074913c8a9c1f66c8752387db2c81ad669e91878 (patch)
tree45d455c785882a669e729b88f919138b723488ef /exa/exa_accel.c
parentbe2bdab4339e493bb0ac3d0e36508b7aa1cd6e92 (diff)
- Don't try to upload 0 byte-per-pixel (PICT_a1) data using
RADEONHostDataBlit. - Disable the shortcut for switching from 3d to 3d in radeon_exa.c. It appears that we do need the cache flush here, thought it's not clear why. Disable the 2d to 2d shortcut while here, since I'm unsure of what we're doing. Exposed by the following bit: - Bug #4485: Add a new routine, exaGlyphs, to handle font drawing. Glyphs were being accumulated in from non-migratable scratch pixmaps, causing the destination pixmap to move towards screen but the migration necessary for source never to happen, leading to abysmal performance. Instead, copy the scratch glyph data into a real pixmap first, then composite from that into the destination, allowing for migration. time ls -lR from programs/Xserver showed 26.9% (+/- 6.3%) decrease in wall time (n=3). - Create exaDrawableUse* wrapping exaPixmapUse*, but which are aware of windows needing backing store. Makes migration code prettier, and ensures that composited windows will be migrated as normal when we turn off cw for EXA. (issue brought up by keithp)
Diffstat (limited to 'exa/exa_accel.c')
-rw-r--r--exa/exa_accel.c69
1 files changed, 53 insertions, 16 deletions
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 22f5edd37..e3e4ecfcf 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -119,7 +119,7 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
char *dst, *src;
int i;
- DBG_MIGRATE (("Save 0x%08p (0x%p) (%dx%d)\n",
+ DBG_MIGRATE (("Save %p (%p) (%dx%d)\n",
(void*)pPixmap->drawable.id,
(void*)(ExaGetPixmapPriv(pPixmap)->area ?
ExaGetPixmapPriv(pPixmap)->area->offset : 0),
@@ -295,17 +295,50 @@ exaMoveOutPixmap (PixmapPtr pPixmap)
}
void
+exaDrawableUseScreen(DrawablePtr pDrawable)
+{
+ PixmapPtr pPixmap;
+
+ if (pDrawable->type == DRAWABLE_WINDOW)
+ pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
+ else
+ pPixmap = (PixmapPtr) pDrawable;
+
+ exaPixmapUseScreen (pPixmap);
+}
+
+void
+exaDrawableUseMemory(DrawablePtr pDrawable)
+{
+ PixmapPtr pPixmap;
+
+ if (pDrawable->type == DRAWABLE_WINDOW)
+ pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
+ else
+ pPixmap = (PixmapPtr) pDrawable;
+
+ exaPixmapUseMemory (pPixmap);
+}
+
+void
exaPixmapUseScreen (PixmapPtr pPixmap)
{
ExaPixmapPriv (pPixmap);
STRACE;
- if (pExaPixmap == NULL)
+ if (pExaPixmap == NULL) {
+ DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n",
+ pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return;
+ }
- if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
+ if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED) {
+ DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n", pPixmap));
return;
+ }
+
+ DBG_MIGRATE(("UseScreen %p score %d\n", pPixmap, pExaPixmap->score));
if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT) {
exaMoveInPixmap(pPixmap);
@@ -327,8 +360,13 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
{
ExaPixmapPriv (pPixmap);
- if (pExaPixmap == NULL)
+ if (pExaPixmap == NULL) {
+ DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n",
+ pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return;
+ }
+
+ DBG_MIGRATE(("UseMem: %p score %d\n", pPixmap, pExaPixmap->score));
if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
return;
@@ -399,6 +437,8 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
if (!pPixmap)
return NULL;
pExaPixmap = ExaGetPixmapPriv(pPixmap);
+
+ /* Glyphs have w/h equal to zero, and may not be migrated. See exaGlyphs. */
if (!w || !h)
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
else
@@ -687,10 +727,8 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
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);
+ exaDrawableUseMemory (pSrcDrawable);
+ exaDrawableUseMemory (pDstDrawable);
goto fallback;
}
@@ -700,15 +738,11 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
if (exaDrawableIsOffscreen(pDstDrawable) ||
exaDrawableIsOffscreen(pSrcDrawable))
{
- if (pSrcDrawable->type == DRAWABLE_PIXMAP)
- exaPixmapUseScreen ((PixmapPtr) pSrcDrawable);
- if (pDstDrawable->type == DRAWABLE_PIXMAP)
- exaPixmapUseScreen ((PixmapPtr) pDstDrawable);
+ exaDrawableUseScreen (pSrcDrawable);
+ exaDrawableUseScreen (pDstDrawable);
} else {
- if (pSrcDrawable->type == DRAWABLE_PIXMAP)
- exaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
- if (pDstDrawable->type == DRAWABLE_PIXMAP)
- exaPixmapUseMemory ((PixmapPtr) pDstDrawable);
+ exaDrawableUseMemory (pSrcDrawable);
+ exaDrawableUseMemory (pDstDrawable);
}
if ((pSrcPixmap = exaGetOffscreenPixmap (pSrcDrawable, &src_off_x, &src_off_y)) &&
@@ -1347,6 +1381,9 @@ exaDriverInit (ScreenPtr pScreen,
if (ps) {
pExaScr->SavedComposite = ps->Composite;
ps->Composite = exaComposite;
+
+ pExaScr->SavedGlyphs = ps->Glyphs;
+ ps->Glyphs = exaGlyphs;
}
#endif