summaryrefslogtreecommitdiff
path: root/exa
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-09-21 10:27:53 +0000
committerEric Anholt <anholt@freebsd.org>2005-09-21 10:27:53 +0000
commit361a9eb953aaa38f8ebc057185de29e50f9eef26 (patch)
tree82bf759dc5f2dbac4c21c5bc06629f30f4efd776 /exa
parent6a29c4cec156a135d1d9cdb65995f7a84de7cb56 (diff)
- Change migration-in rule slightly: previously, if your score was less
than the max, it was bumped, and then if you were above the threshhold you got moved in. Instead, do the above-threshhold check separate from score starting out less than max. While this will likely make thrashing cases worse, I hope it will fix some issues with long term performance (think of an xcompmgr with a backbuffer it's doing only accelerated operations to. If some new pixmap comes in and bumps it out, even once, it will never get a chance to re-migrate because its score will be maxed). Change migration-out to be the same way for symmetry, though it shouldn't ever affect anything. - Fix a lot of debugging output, both in terms of printing quality, and completeness. The fallback debugging covers a lot more now, pointing out new areas for improvement. Debugging toggles are now centralized in exaPriv.h.
Diffstat (limited to 'exa')
-rw-r--r--exa/exa.c70
-rw-r--r--exa/exa_accel.c70
-rw-r--r--exa/exa_migration.c70
-rw-r--r--exa/exa_offscreen.c5
-rw-r--r--exa/exa_priv.h15
-rw-r--r--exa/exa_render.c5
-rw-r--r--exa/exa_unaccel.c11
7 files changed, 140 insertions, 106 deletions
diff --git a/exa/exa.c b/exa/exa.c
index 964690ec1..c8c388917 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -32,8 +32,6 @@
#include "xf86.h"
#include "exa.h"
-#define DEBUG_MIGRATE 0
-#define DEBUG_PIXMAP 0
#if DEBUG_MIGRATE
#define DBG_MIGRATE(a) ErrorF a
#else
@@ -210,12 +208,11 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
if (!pExaPixmap->area)
return FALSE;
- DBG_PIXMAP(("++ 0x%p (0x%p) (%dx%d)\n",
- (void*)pPixmap->drawable.id,
- (void*)(ExaGetPixmapPriv(pPixmap)->area ?
- ExaGetPixmapPriv(pPixmap)->area->offset : 0),
- pPixmap->drawable.width,
- pPixmap->drawable.height));
+ DBG_PIXMAP(("++ 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
+ (ExaGetPixmapPriv(pPixmap)->area ?
+ ExaGetPixmapPriv(pPixmap)->area->offset : 0),
+ pPixmap->drawable.width,
+ pPixmap->drawable.height));
pPixmap->devKind = pitch;
pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset);
@@ -233,18 +230,22 @@ exaMoveInPixmap (PixmapPtr pPixmap)
char *dst, *src;
int i;
- DBG_MIGRATE (("-> 0x%p (0x%p) (%dx%d)\n",
- (void*)pPixmap->drawable.id,
- (void*)(ExaGetPixmapPriv(pPixmap)->area ?
- ExaGetPixmapPriv(pPixmap)->area->offset : 0),
+ DBG_MIGRATE (("-> 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
+ (ExaGetPixmapPriv(pPixmap)->area ?
+ ExaGetPixmapPriv(pPixmap)->area->offset : 0),
pPixmap->drawable.width,
pPixmap->drawable.height));
src = pPixmap->devPrivate.ptr;
src_pitch = pPixmap->devKind;
- if (!exaPixmapAllocArea (pPixmap))
+ if (!exaPixmapAllocArea (pPixmap)) {
+ DBG_MIGRATE (("failed to allocate fb for pixmap %p (%dx%dx%d)\n",
+ (pointer)pPixmap,
+ pPixmap->drawable.width, pPixmap->drawable.height,
+ pPixmap->drawable.bitsPerPixel));
return;
+ }
pExaPixmap->dirty = FALSE;
@@ -274,7 +275,6 @@ exaMoveInPixmap (PixmapPtr pPixmap)
dst += dst_pitch;
src += src_pitch;
}
- DBG_PIXMAP("done\n");
}
static void
@@ -332,16 +332,19 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n",
- pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
+ (pointer)pPixmap,
+ exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return;
}
if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED) {
- DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n", pPixmap));
+ DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n",
+ (pointer)pPixmap));
return;
}
- DBG_MIGRATE(("UseScreen %p score %d\n", pPixmap, pExaPixmap->score));
+ DBG_MIGRATE(("UseScreen %p score %d\n",
+ (pointer)pPixmap, pExaPixmap->score));
if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT) {
exaMoveInPixmap(pPixmap);
@@ -349,12 +352,14 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
}
if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX)
- {
pExaPixmap->score++;
- if (!exaPixmapIsOffscreen(pPixmap) &&
- pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN)
- exaMoveInPixmap (pPixmap);
+
+ if (pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN &&
+ !exaPixmapIsOffscreen(pPixmap))
+ {
+ exaMoveInPixmap (pPixmap);
}
+
ExaOffscreenMarkUsed (pPixmap);
}
@@ -365,11 +370,12 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n",
- pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
+ (pointer)pPixmap,
+ exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return;
}
- DBG_MIGRATE(("UseMem: %p score %d\n", pPixmap, pExaPixmap->score));
+ DBG_MIGRATE(("UseMem: %p score %d\n", (pointer)pPixmap, pExaPixmap->score));
if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
return;
@@ -378,12 +384,10 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
pExaPixmap->score = 0;
if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN)
- {
pExaPixmap->score--;
- if (pExaPixmap->area &&
- pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT)
- exaMoveOutPixmap (pPixmap);
- }
+
+ if (pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT && pExaPixmap->area)
+ exaMoveOutPixmap (pPixmap);
}
static Bool
@@ -534,7 +538,8 @@ exaPrepareAccess(DrawablePtr pDrawable, int index)
if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) {
ExaPixmapPriv (pPixmap);
- assert (pExaPixmap->score != EXA_PIXMAP_SCORE_PINNED);
+ if (pExaPixmap->score != EXA_PIXMAP_SCORE_PINNED)
+ FatalError("Driver failed PrepareAccess on a pinned pixmap\n");
exaMoveOutPixmap (pPixmap);
}
}
@@ -728,6 +733,8 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
}
fallback:
+ EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pSrcDrawable,
+ (long)pDstDrawable));
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
@@ -884,6 +891,7 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
{
+ EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
@@ -1011,6 +1019,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
opaque = FALSE;
}
+ EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
ppci = ppciInit;
@@ -1187,6 +1196,7 @@ exaFillRegionSolid (DrawablePtr pDrawable,
}
else
{
+ EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionSolid (pDrawable, pRegion, 0,
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
@@ -1278,6 +1288,7 @@ exaFillRegionTiled (DrawablePtr pDrawable,
}
fallback:
+ EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pTile, (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionTiled (pDrawable, pRegion, pTile);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
@@ -1548,7 +1559,6 @@ exaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
{
static Bool Initialised = FALSE;
- DBG_PIXMAP("exa setup\n");
if (!Initialised) {
Initialised = TRUE;
#ifndef REMOVE_LOADER_CHECK_MODULE_INFO
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 964690ec1..c8c388917 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -32,8 +32,6 @@
#include "xf86.h"
#include "exa.h"
-#define DEBUG_MIGRATE 0
-#define DEBUG_PIXMAP 0
#if DEBUG_MIGRATE
#define DBG_MIGRATE(a) ErrorF a
#else
@@ -210,12 +208,11 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
if (!pExaPixmap->area)
return FALSE;
- DBG_PIXMAP(("++ 0x%p (0x%p) (%dx%d)\n",
- (void*)pPixmap->drawable.id,
- (void*)(ExaGetPixmapPriv(pPixmap)->area ?
- ExaGetPixmapPriv(pPixmap)->area->offset : 0),
- pPixmap->drawable.width,
- pPixmap->drawable.height));
+ DBG_PIXMAP(("++ 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
+ (ExaGetPixmapPriv(pPixmap)->area ?
+ ExaGetPixmapPriv(pPixmap)->area->offset : 0),
+ pPixmap->drawable.width,
+ pPixmap->drawable.height));
pPixmap->devKind = pitch;
pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset);
@@ -233,18 +230,22 @@ exaMoveInPixmap (PixmapPtr pPixmap)
char *dst, *src;
int i;
- DBG_MIGRATE (("-> 0x%p (0x%p) (%dx%d)\n",
- (void*)pPixmap->drawable.id,
- (void*)(ExaGetPixmapPriv(pPixmap)->area ?
- ExaGetPixmapPriv(pPixmap)->area->offset : 0),
+ DBG_MIGRATE (("-> 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
+ (ExaGetPixmapPriv(pPixmap)->area ?
+ ExaGetPixmapPriv(pPixmap)->area->offset : 0),
pPixmap->drawable.width,
pPixmap->drawable.height));
src = pPixmap->devPrivate.ptr;
src_pitch = pPixmap->devKind;
- if (!exaPixmapAllocArea (pPixmap))
+ if (!exaPixmapAllocArea (pPixmap)) {
+ DBG_MIGRATE (("failed to allocate fb for pixmap %p (%dx%dx%d)\n",
+ (pointer)pPixmap,
+ pPixmap->drawable.width, pPixmap->drawable.height,
+ pPixmap->drawable.bitsPerPixel));
return;
+ }
pExaPixmap->dirty = FALSE;
@@ -274,7 +275,6 @@ exaMoveInPixmap (PixmapPtr pPixmap)
dst += dst_pitch;
src += src_pitch;
}
- DBG_PIXMAP("done\n");
}
static void
@@ -332,16 +332,19 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n",
- pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
+ (pointer)pPixmap,
+ exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return;
}
if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED) {
- DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n", pPixmap));
+ DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n",
+ (pointer)pPixmap));
return;
}
- DBG_MIGRATE(("UseScreen %p score %d\n", pPixmap, pExaPixmap->score));
+ DBG_MIGRATE(("UseScreen %p score %d\n",
+ (pointer)pPixmap, pExaPixmap->score));
if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT) {
exaMoveInPixmap(pPixmap);
@@ -349,12 +352,14 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
}
if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX)
- {
pExaPixmap->score++;
- if (!exaPixmapIsOffscreen(pPixmap) &&
- pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN)
- exaMoveInPixmap (pPixmap);
+
+ if (pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN &&
+ !exaPixmapIsOffscreen(pPixmap))
+ {
+ exaMoveInPixmap (pPixmap);
}
+
ExaOffscreenMarkUsed (pPixmap);
}
@@ -365,11 +370,12 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n",
- pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
+ (pointer)pPixmap,
+ exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return;
}
- DBG_MIGRATE(("UseMem: %p score %d\n", pPixmap, pExaPixmap->score));
+ DBG_MIGRATE(("UseMem: %p score %d\n", (pointer)pPixmap, pExaPixmap->score));
if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
return;
@@ -378,12 +384,10 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
pExaPixmap->score = 0;
if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN)
- {
pExaPixmap->score--;
- if (pExaPixmap->area &&
- pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT)
- exaMoveOutPixmap (pPixmap);
- }
+
+ if (pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT && pExaPixmap->area)
+ exaMoveOutPixmap (pPixmap);
}
static Bool
@@ -534,7 +538,8 @@ exaPrepareAccess(DrawablePtr pDrawable, int index)
if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) {
ExaPixmapPriv (pPixmap);
- assert (pExaPixmap->score != EXA_PIXMAP_SCORE_PINNED);
+ if (pExaPixmap->score != EXA_PIXMAP_SCORE_PINNED)
+ FatalError("Driver failed PrepareAccess on a pinned pixmap\n");
exaMoveOutPixmap (pPixmap);
}
}
@@ -728,6 +733,8 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
}
fallback:
+ EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pSrcDrawable,
+ (long)pDstDrawable));
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
@@ -884,6 +891,7 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
{
+ EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
@@ -1011,6 +1019,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
opaque = FALSE;
}
+ EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
ppci = ppciInit;
@@ -1187,6 +1196,7 @@ exaFillRegionSolid (DrawablePtr pDrawable,
}
else
{
+ EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionSolid (pDrawable, pRegion, 0,
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
@@ -1278,6 +1288,7 @@ exaFillRegionTiled (DrawablePtr pDrawable,
}
fallback:
+ EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pTile, (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionTiled (pDrawable, pRegion, pTile);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
@@ -1548,7 +1559,6 @@ exaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
{
static Bool Initialised = FALSE;
- DBG_PIXMAP("exa setup\n");
if (!Initialised) {
Initialised = TRUE;
#ifndef REMOVE_LOADER_CHECK_MODULE_INFO
diff --git a/exa/exa_migration.c b/exa/exa_migration.c
index 964690ec1..c8c388917 100644
--- a/exa/exa_migration.c
+++ b/exa/exa_migration.c
@@ -32,8 +32,6 @@
#include "xf86.h"
#include "exa.h"
-#define DEBUG_MIGRATE 0
-#define DEBUG_PIXMAP 0
#if DEBUG_MIGRATE
#define DBG_MIGRATE(a) ErrorF a
#else
@@ -210,12 +208,11 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
if (!pExaPixmap->area)
return FALSE;
- DBG_PIXMAP(("++ 0x%p (0x%p) (%dx%d)\n",
- (void*)pPixmap->drawable.id,
- (void*)(ExaGetPixmapPriv(pPixmap)->area ?
- ExaGetPixmapPriv(pPixmap)->area->offset : 0),
- pPixmap->drawable.width,
- pPixmap->drawable.height));
+ DBG_PIXMAP(("++ 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
+ (ExaGetPixmapPriv(pPixmap)->area ?
+ ExaGetPixmapPriv(pPixmap)->area->offset : 0),
+ pPixmap->drawable.width,
+ pPixmap->drawable.height));
pPixmap->devKind = pitch;
pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset);
@@ -233,18 +230,22 @@ exaMoveInPixmap (PixmapPtr pPixmap)
char *dst, *src;
int i;
- DBG_MIGRATE (("-> 0x%p (0x%p) (%dx%d)\n",
- (void*)pPixmap->drawable.id,
- (void*)(ExaGetPixmapPriv(pPixmap)->area ?
- ExaGetPixmapPriv(pPixmap)->area->offset : 0),
+ DBG_MIGRATE (("-> 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
+ (ExaGetPixmapPriv(pPixmap)->area ?
+ ExaGetPixmapPriv(pPixmap)->area->offset : 0),
pPixmap->drawable.width,
pPixmap->drawable.height));
src = pPixmap->devPrivate.ptr;
src_pitch = pPixmap->devKind;
- if (!exaPixmapAllocArea (pPixmap))
+ if (!exaPixmapAllocArea (pPixmap)) {
+ DBG_MIGRATE (("failed to allocate fb for pixmap %p (%dx%dx%d)\n",
+ (pointer)pPixmap,
+ pPixmap->drawable.width, pPixmap->drawable.height,
+ pPixmap->drawable.bitsPerPixel));
return;
+ }
pExaPixmap->dirty = FALSE;
@@ -274,7 +275,6 @@ exaMoveInPixmap (PixmapPtr pPixmap)
dst += dst_pitch;
src += src_pitch;
}
- DBG_PIXMAP("done\n");
}
static void
@@ -332,16 +332,19 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n",
- pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
+ (pointer)pPixmap,
+ exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return;
}
if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED) {
- DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n", pPixmap));
+ DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n",
+ (pointer)pPixmap));
return;
}
- DBG_MIGRATE(("UseScreen %p score %d\n", pPixmap, pExaPixmap->score));
+ DBG_MIGRATE(("UseScreen %p score %d\n",
+ (pointer)pPixmap, pExaPixmap->score));
if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT) {
exaMoveInPixmap(pPixmap);
@@ -349,12 +352,14 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
}
if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX)
- {
pExaPixmap->score++;
- if (!exaPixmapIsOffscreen(pPixmap) &&
- pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN)
- exaMoveInPixmap (pPixmap);
+
+ if (pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN &&
+ !exaPixmapIsOffscreen(pPixmap))
+ {
+ exaMoveInPixmap (pPixmap);
}
+
ExaOffscreenMarkUsed (pPixmap);
}
@@ -365,11 +370,12 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n",
- pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
+ (pointer)pPixmap,
+ exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return;
}
- DBG_MIGRATE(("UseMem: %p score %d\n", pPixmap, pExaPixmap->score));
+ DBG_MIGRATE(("UseMem: %p score %d\n", (pointer)pPixmap, pExaPixmap->score));
if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
return;
@@ -378,12 +384,10 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
pExaPixmap->score = 0;
if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN)
- {
pExaPixmap->score--;
- if (pExaPixmap->area &&
- pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT)
- exaMoveOutPixmap (pPixmap);
- }
+
+ if (pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT && pExaPixmap->area)
+ exaMoveOutPixmap (pPixmap);
}
static Bool
@@ -534,7 +538,8 @@ exaPrepareAccess(DrawablePtr pDrawable, int index)
if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) {
ExaPixmapPriv (pPixmap);
- assert (pExaPixmap->score != EXA_PIXMAP_SCORE_PINNED);
+ if (pExaPixmap->score != EXA_PIXMAP_SCORE_PINNED)
+ FatalError("Driver failed PrepareAccess on a pinned pixmap\n");
exaMoveOutPixmap (pPixmap);
}
}
@@ -728,6 +733,8 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
}
fallback:
+ EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pSrcDrawable,
+ (long)pDstDrawable));
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
@@ -884,6 +891,7 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
{
+ EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
@@ -1011,6 +1019,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
opaque = FALSE;
}
+ EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
ppci = ppciInit;
@@ -1187,6 +1196,7 @@ exaFillRegionSolid (DrawablePtr pDrawable,
}
else
{
+ EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionSolid (pDrawable, pRegion, 0,
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
@@ -1278,6 +1288,7 @@ exaFillRegionTiled (DrawablePtr pDrawable,
}
fallback:
+ EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pTile, (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionTiled (pDrawable, pRegion, pTile);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
@@ -1548,7 +1559,6 @@ exaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
{
static Bool Initialised = FALSE;
- DBG_PIXMAP("exa setup\n");
if (!Initialised) {
Initialised = TRUE;
#ifndef REMOVE_LOADER_CHECK_MODULE_INFO
diff --git a/exa/exa_offscreen.c b/exa/exa_offscreen.c
index e55e0ac43..246241ce3 100644
--- a/exa/exa_offscreen.c
+++ b/exa/exa_offscreen.c
@@ -22,7 +22,6 @@
#include "exaPriv.h"
-#define DEBUG_OFFSCREEN 0
#if DEBUG_OFFSCREEN
#define DBG_OFFSCREEN(a) ErrorF a
#else
@@ -85,7 +84,9 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
/* throw out requests that cannot fit */
if (size > (pExaScr->info->card.memorySize - pExaScr->info->card.offScreenBase))
{
- DBG_OFFSCREEN (("Alloc 0x%x -> TOBIG\n", size));
+ DBG_OFFSCREEN (("Alloc 0x%x vs (0x%lx) -> TOBIG\n", size,
+ pExaScr->info->card.memorySize -
+ pExaScr->info->card.offScreenBase));
return NULL;
}
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index 41938a7d9..ca1cdb110 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -52,6 +52,21 @@
#include "fbpict.h"
#endif
+#define DEBUG_TRACE_FALL 0
+#define DEBUG_MIGRATE 0
+#define DEBUG_PIXMAP 0
+#define DEBUG_OFFSCREEN 0
+
+#if DEBUG_TRACE_FALL
+#define EXA_FALLBACK(x) \
+do { \
+ ErrorF("EXA fallback at %s: ", __FUNCTION__); \
+ ErrorF x; \
+} while (0)
+#else
+#define EXA_FALLBACK(x)
+#endif
+
#ifndef EXA_MAX_FB
#define EXA_MAX_FB FB_OVERLAY_MAX
#endif
diff --git a/exa/exa_render.c b/exa/exa_render.c
index c1d6fa63e..f770a154a 100644
--- a/exa/exa_render.c
+++ b/exa/exa_render.c
@@ -33,9 +33,8 @@
#include "xf86str.h"
#include "xf86.h"
-#define EXA_DEBUG_FALLBACKS 0
-#if EXA_DEBUG_FALLBACKS
+#if DEBUG_TRACE_FALL
static void exaCompositeFallbackPictDesc(PicturePtr pict, char *string, int n)
{
char format[20];
@@ -537,7 +536,7 @@ exaComposite(CARD8 op,
exaDrawableUseMemory(pDst->pDrawable);
}
-#if EXA_DEBUG_FALLBACKS
+#if DEBUG_TRACE_FALL
exaPrintCompositeFallback (op, pSrc, pMask, pDst);
#endif
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index 2e0fc2cad..d6e111e79 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -23,17 +23,6 @@
#include "exaPriv.h"
-#define EXA_TRACE_FALL 0
-
-#if EXA_TRACE_FALL
-#define EXA_FALLBACK(x) \
-do { \
- ErrorF("EXA fallback at %s: ", __FUNCTION__); \
- ErrorF x; \
-} while (0)
-#else
-#define EXA_FALLBACK(x)
-#endif
/*
* These functions wrap the low-level fb rendering functions and
* synchronize framebuffer/accelerated drawing by stalling until