- 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.
This commit is contained in:
Eric Anholt 2005-09-21 10:27:53 +00:00
parent 6a29c4cec1
commit 361a9eb953
18 changed files with 300 additions and 228 deletions

View File

@ -32,8 +32,6 @@
#include "xf86.h" #include "xf86.h"
#include "exa.h" #include "exa.h"
#define DEBUG_MIGRATE 0
#define DEBUG_PIXMAP 0
#if DEBUG_MIGRATE #if DEBUG_MIGRATE
#define DBG_MIGRATE(a) ErrorF a #define DBG_MIGRATE(a) ErrorF a
#else #else
@ -210,12 +208,11 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
if (!pExaPixmap->area) if (!pExaPixmap->area)
return FALSE; return FALSE;
DBG_PIXMAP(("++ 0x%p (0x%p) (%dx%d)\n", DBG_PIXMAP(("++ 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
(void*)pPixmap->drawable.id, (ExaGetPixmapPriv(pPixmap)->area ?
(void*)(ExaGetPixmapPriv(pPixmap)->area ? ExaGetPixmapPriv(pPixmap)->area->offset : 0),
ExaGetPixmapPriv(pPixmap)->area->offset : 0), pPixmap->drawable.width,
pPixmap->drawable.width, pPixmap->drawable.height));
pPixmap->drawable.height));
pPixmap->devKind = pitch; pPixmap->devKind = pitch;
pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset); pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset);
@ -233,18 +230,22 @@ exaMoveInPixmap (PixmapPtr pPixmap)
char *dst, *src; char *dst, *src;
int i; int i;
DBG_MIGRATE (("-> 0x%p (0x%p) (%dx%d)\n", DBG_MIGRATE (("-> 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
(void*)pPixmap->drawable.id, (ExaGetPixmapPriv(pPixmap)->area ?
(void*)(ExaGetPixmapPriv(pPixmap)->area ? ExaGetPixmapPriv(pPixmap)->area->offset : 0),
ExaGetPixmapPriv(pPixmap)->area->offset : 0),
pPixmap->drawable.width, pPixmap->drawable.width,
pPixmap->drawable.height)); pPixmap->drawable.height));
src = pPixmap->devPrivate.ptr; src = pPixmap->devPrivate.ptr;
src_pitch = pPixmap->devKind; 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; return;
}
pExaPixmap->dirty = FALSE; pExaPixmap->dirty = FALSE;
@ -274,7 +275,6 @@ exaMoveInPixmap (PixmapPtr pPixmap)
dst += dst_pitch; dst += dst_pitch;
src += src_pitch; src += src_pitch;
} }
DBG_PIXMAP("done\n");
} }
static void static void
@ -332,16 +332,19 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
if (pExaPixmap == NULL) { if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n", DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n",
pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m")); (pointer)pPixmap,
exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return; 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)); DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n",
(pointer)pPixmap));
return; 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) { if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT) {
exaMoveInPixmap(pPixmap); exaMoveInPixmap(pPixmap);
@ -349,12 +352,14 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
} }
if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX) if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX)
{
pExaPixmap->score++; pExaPixmap->score++;
if (!exaPixmapIsOffscreen(pPixmap) &&
pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN) if (pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN &&
exaMoveInPixmap (pPixmap); !exaPixmapIsOffscreen(pPixmap))
{
exaMoveInPixmap (pPixmap);
} }
ExaOffscreenMarkUsed (pPixmap); ExaOffscreenMarkUsed (pPixmap);
} }
@ -365,11 +370,12 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
if (pExaPixmap == NULL) { if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n", DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n",
pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m")); (pointer)pPixmap,
exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return; 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) if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
return; return;
@ -378,12 +384,10 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
pExaPixmap->score = 0; pExaPixmap->score = 0;
if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN) if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN)
{
pExaPixmap->score--; pExaPixmap->score--;
if (pExaPixmap->area &&
pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT) if (pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT && pExaPixmap->area)
exaMoveOutPixmap (pPixmap); exaMoveOutPixmap (pPixmap);
}
} }
static Bool static Bool
@ -534,7 +538,8 @@ exaPrepareAccess(DrawablePtr pDrawable, int index)
if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) { if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) {
ExaPixmapPriv (pPixmap); 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); exaMoveOutPixmap (pPixmap);
} }
} }
@ -728,6 +733,8 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
} }
fallback: fallback:
EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pSrcDrawable,
(long)pDstDrawable));
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC); exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
@ -884,6 +891,7 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) || !(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg)) !(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
{ {
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel); fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2, fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
@ -1011,6 +1019,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
opaque = FALSE; opaque = FALSE;
} }
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
ppci = ppciInit; ppci = ppciInit;
@ -1187,6 +1196,7 @@ exaFillRegionSolid (DrawablePtr pDrawable,
} }
else else
{ {
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionSolid (pDrawable, pRegion, 0, fbFillRegionSolid (pDrawable, pRegion, 0,
fbReplicatePixel (pixel, pDrawable->bitsPerPixel)); fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
@ -1278,6 +1288,7 @@ exaFillRegionTiled (DrawablePtr pDrawable,
} }
fallback: fallback:
EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pTile, (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionTiled (pDrawable, pRegion, pTile); fbFillRegionTiled (pDrawable, pRegion, pTile);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
@ -1548,7 +1559,6 @@ exaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
{ {
static Bool Initialised = FALSE; static Bool Initialised = FALSE;
DBG_PIXMAP("exa setup\n");
if (!Initialised) { if (!Initialised) {
Initialised = TRUE; Initialised = TRUE;
#ifndef REMOVE_LOADER_CHECK_MODULE_INFO #ifndef REMOVE_LOADER_CHECK_MODULE_INFO

View File

@ -32,8 +32,6 @@
#include "xf86.h" #include "xf86.h"
#include "exa.h" #include "exa.h"
#define DEBUG_MIGRATE 0
#define DEBUG_PIXMAP 0
#if DEBUG_MIGRATE #if DEBUG_MIGRATE
#define DBG_MIGRATE(a) ErrorF a #define DBG_MIGRATE(a) ErrorF a
#else #else
@ -210,12 +208,11 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
if (!pExaPixmap->area) if (!pExaPixmap->area)
return FALSE; return FALSE;
DBG_PIXMAP(("++ 0x%p (0x%p) (%dx%d)\n", DBG_PIXMAP(("++ 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
(void*)pPixmap->drawable.id, (ExaGetPixmapPriv(pPixmap)->area ?
(void*)(ExaGetPixmapPriv(pPixmap)->area ? ExaGetPixmapPriv(pPixmap)->area->offset : 0),
ExaGetPixmapPriv(pPixmap)->area->offset : 0), pPixmap->drawable.width,
pPixmap->drawable.width, pPixmap->drawable.height));
pPixmap->drawable.height));
pPixmap->devKind = pitch; pPixmap->devKind = pitch;
pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset); pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset);
@ -233,18 +230,22 @@ exaMoveInPixmap (PixmapPtr pPixmap)
char *dst, *src; char *dst, *src;
int i; int i;
DBG_MIGRATE (("-> 0x%p (0x%p) (%dx%d)\n", DBG_MIGRATE (("-> 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
(void*)pPixmap->drawable.id, (ExaGetPixmapPriv(pPixmap)->area ?
(void*)(ExaGetPixmapPriv(pPixmap)->area ? ExaGetPixmapPriv(pPixmap)->area->offset : 0),
ExaGetPixmapPriv(pPixmap)->area->offset : 0),
pPixmap->drawable.width, pPixmap->drawable.width,
pPixmap->drawable.height)); pPixmap->drawable.height));
src = pPixmap->devPrivate.ptr; src = pPixmap->devPrivate.ptr;
src_pitch = pPixmap->devKind; 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; return;
}
pExaPixmap->dirty = FALSE; pExaPixmap->dirty = FALSE;
@ -274,7 +275,6 @@ exaMoveInPixmap (PixmapPtr pPixmap)
dst += dst_pitch; dst += dst_pitch;
src += src_pitch; src += src_pitch;
} }
DBG_PIXMAP("done\n");
} }
static void static void
@ -332,16 +332,19 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
if (pExaPixmap == NULL) { if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n", DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n",
pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m")); (pointer)pPixmap,
exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return; 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)); DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n",
(pointer)pPixmap));
return; 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) { if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT) {
exaMoveInPixmap(pPixmap); exaMoveInPixmap(pPixmap);
@ -349,12 +352,14 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
} }
if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX) if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX)
{
pExaPixmap->score++; pExaPixmap->score++;
if (!exaPixmapIsOffscreen(pPixmap) &&
pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN) if (pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN &&
exaMoveInPixmap (pPixmap); !exaPixmapIsOffscreen(pPixmap))
{
exaMoveInPixmap (pPixmap);
} }
ExaOffscreenMarkUsed (pPixmap); ExaOffscreenMarkUsed (pPixmap);
} }
@ -365,11 +370,12 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
if (pExaPixmap == NULL) { if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n", DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n",
pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m")); (pointer)pPixmap,
exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return; 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) if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
return; return;
@ -378,12 +384,10 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
pExaPixmap->score = 0; pExaPixmap->score = 0;
if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN) if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN)
{
pExaPixmap->score--; pExaPixmap->score--;
if (pExaPixmap->area &&
pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT) if (pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT && pExaPixmap->area)
exaMoveOutPixmap (pPixmap); exaMoveOutPixmap (pPixmap);
}
} }
static Bool static Bool
@ -534,7 +538,8 @@ exaPrepareAccess(DrawablePtr pDrawable, int index)
if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) { if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) {
ExaPixmapPriv (pPixmap); 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); exaMoveOutPixmap (pPixmap);
} }
} }
@ -728,6 +733,8 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
} }
fallback: fallback:
EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pSrcDrawable,
(long)pDstDrawable));
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC); exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
@ -884,6 +891,7 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) || !(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg)) !(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
{ {
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel); fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2, fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
@ -1011,6 +1019,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
opaque = FALSE; opaque = FALSE;
} }
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
ppci = ppciInit; ppci = ppciInit;
@ -1187,6 +1196,7 @@ exaFillRegionSolid (DrawablePtr pDrawable,
} }
else else
{ {
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionSolid (pDrawable, pRegion, 0, fbFillRegionSolid (pDrawable, pRegion, 0,
fbReplicatePixel (pixel, pDrawable->bitsPerPixel)); fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
@ -1278,6 +1288,7 @@ exaFillRegionTiled (DrawablePtr pDrawable,
} }
fallback: fallback:
EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pTile, (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionTiled (pDrawable, pRegion, pTile); fbFillRegionTiled (pDrawable, pRegion, pTile);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
@ -1548,7 +1559,6 @@ exaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
{ {
static Bool Initialised = FALSE; static Bool Initialised = FALSE;
DBG_PIXMAP("exa setup\n");
if (!Initialised) { if (!Initialised) {
Initialised = TRUE; Initialised = TRUE;
#ifndef REMOVE_LOADER_CHECK_MODULE_INFO #ifndef REMOVE_LOADER_CHECK_MODULE_INFO

View File

@ -32,8 +32,6 @@
#include "xf86.h" #include "xf86.h"
#include "exa.h" #include "exa.h"
#define DEBUG_MIGRATE 0
#define DEBUG_PIXMAP 0
#if DEBUG_MIGRATE #if DEBUG_MIGRATE
#define DBG_MIGRATE(a) ErrorF a #define DBG_MIGRATE(a) ErrorF a
#else #else
@ -210,12 +208,11 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
if (!pExaPixmap->area) if (!pExaPixmap->area)
return FALSE; return FALSE;
DBG_PIXMAP(("++ 0x%p (0x%p) (%dx%d)\n", DBG_PIXMAP(("++ 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
(void*)pPixmap->drawable.id, (ExaGetPixmapPriv(pPixmap)->area ?
(void*)(ExaGetPixmapPriv(pPixmap)->area ? ExaGetPixmapPriv(pPixmap)->area->offset : 0),
ExaGetPixmapPriv(pPixmap)->area->offset : 0), pPixmap->drawable.width,
pPixmap->drawable.width, pPixmap->drawable.height));
pPixmap->drawable.height));
pPixmap->devKind = pitch; pPixmap->devKind = pitch;
pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset); pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset);
@ -233,18 +230,22 @@ exaMoveInPixmap (PixmapPtr pPixmap)
char *dst, *src; char *dst, *src;
int i; int i;
DBG_MIGRATE (("-> 0x%p (0x%p) (%dx%d)\n", DBG_MIGRATE (("-> 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
(void*)pPixmap->drawable.id, (ExaGetPixmapPriv(pPixmap)->area ?
(void*)(ExaGetPixmapPriv(pPixmap)->area ? ExaGetPixmapPriv(pPixmap)->area->offset : 0),
ExaGetPixmapPriv(pPixmap)->area->offset : 0),
pPixmap->drawable.width, pPixmap->drawable.width,
pPixmap->drawable.height)); pPixmap->drawable.height));
src = pPixmap->devPrivate.ptr; src = pPixmap->devPrivate.ptr;
src_pitch = pPixmap->devKind; 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; return;
}
pExaPixmap->dirty = FALSE; pExaPixmap->dirty = FALSE;
@ -274,7 +275,6 @@ exaMoveInPixmap (PixmapPtr pPixmap)
dst += dst_pitch; dst += dst_pitch;
src += src_pitch; src += src_pitch;
} }
DBG_PIXMAP("done\n");
} }
static void static void
@ -332,16 +332,19 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
if (pExaPixmap == NULL) { if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n", DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n",
pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m")); (pointer)pPixmap,
exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return; 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)); DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n",
(pointer)pPixmap));
return; 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) { if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT) {
exaMoveInPixmap(pPixmap); exaMoveInPixmap(pPixmap);
@ -349,12 +352,14 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
} }
if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX) if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX)
{
pExaPixmap->score++; pExaPixmap->score++;
if (!exaPixmapIsOffscreen(pPixmap) &&
pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN) if (pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN &&
exaMoveInPixmap (pPixmap); !exaPixmapIsOffscreen(pPixmap))
{
exaMoveInPixmap (pPixmap);
} }
ExaOffscreenMarkUsed (pPixmap); ExaOffscreenMarkUsed (pPixmap);
} }
@ -365,11 +370,12 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
if (pExaPixmap == NULL) { if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n", DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n",
pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m")); (pointer)pPixmap,
exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return; 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) if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
return; return;
@ -378,12 +384,10 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
pExaPixmap->score = 0; pExaPixmap->score = 0;
if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN) if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN)
{
pExaPixmap->score--; pExaPixmap->score--;
if (pExaPixmap->area &&
pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT) if (pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT && pExaPixmap->area)
exaMoveOutPixmap (pPixmap); exaMoveOutPixmap (pPixmap);
}
} }
static Bool static Bool
@ -534,7 +538,8 @@ exaPrepareAccess(DrawablePtr pDrawable, int index)
if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) { if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) {
ExaPixmapPriv (pPixmap); 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); exaMoveOutPixmap (pPixmap);
} }
} }
@ -728,6 +733,8 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
} }
fallback: fallback:
EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pSrcDrawable,
(long)pDstDrawable));
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC); exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
@ -884,6 +891,7 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) || !(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg)) !(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
{ {
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel); fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2, fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
@ -1011,6 +1019,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
opaque = FALSE; opaque = FALSE;
} }
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
ppci = ppciInit; ppci = ppciInit;
@ -1187,6 +1196,7 @@ exaFillRegionSolid (DrawablePtr pDrawable,
} }
else else
{ {
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionSolid (pDrawable, pRegion, 0, fbFillRegionSolid (pDrawable, pRegion, 0,
fbReplicatePixel (pixel, pDrawable->bitsPerPixel)); fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
@ -1278,6 +1288,7 @@ exaFillRegionTiled (DrawablePtr pDrawable,
} }
fallback: fallback:
EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pTile, (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionTiled (pDrawable, pRegion, pTile); fbFillRegionTiled (pDrawable, pRegion, pTile);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
@ -1548,7 +1559,6 @@ exaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
{ {
static Bool Initialised = FALSE; static Bool Initialised = FALSE;
DBG_PIXMAP("exa setup\n");
if (!Initialised) { if (!Initialised) {
Initialised = TRUE; Initialised = TRUE;
#ifndef REMOVE_LOADER_CHECK_MODULE_INFO #ifndef REMOVE_LOADER_CHECK_MODULE_INFO

View File

@ -22,7 +22,6 @@
#include "exaPriv.h" #include "exaPriv.h"
#define DEBUG_OFFSCREEN 0
#if DEBUG_OFFSCREEN #if DEBUG_OFFSCREEN
#define DBG_OFFSCREEN(a) ErrorF a #define DBG_OFFSCREEN(a) ErrorF a
#else #else
@ -85,7 +84,9 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
/* throw out requests that cannot fit */ /* throw out requests that cannot fit */
if (size > (pExaScr->info->card.memorySize - pExaScr->info->card.offScreenBase)) 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; return NULL;
} }

View File

@ -52,6 +52,21 @@
#include "fbpict.h" #include "fbpict.h"
#endif #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 #ifndef EXA_MAX_FB
#define EXA_MAX_FB FB_OVERLAY_MAX #define EXA_MAX_FB FB_OVERLAY_MAX
#endif #endif

View File

@ -33,9 +33,8 @@
#include "xf86str.h" #include "xf86str.h"
#include "xf86.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) static void exaCompositeFallbackPictDesc(PicturePtr pict, char *string, int n)
{ {
char format[20]; char format[20];
@ -537,7 +536,7 @@ exaComposite(CARD8 op,
exaDrawableUseMemory(pDst->pDrawable); exaDrawableUseMemory(pDst->pDrawable);
} }
#if EXA_DEBUG_FALLBACKS #if DEBUG_TRACE_FALL
exaPrintCompositeFallback (op, pSrc, pMask, pDst); exaPrintCompositeFallback (op, pSrc, pMask, pDst);
#endif #endif

View File

@ -23,17 +23,6 @@
#include "exaPriv.h" #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 * These functions wrap the low-level fb rendering functions and
* synchronize framebuffer/accelerated drawing by stalling until * synchronize framebuffer/accelerated drawing by stalling until

View File

@ -32,8 +32,6 @@
#include "xf86.h" #include "xf86.h"
#include "exa.h" #include "exa.h"
#define DEBUG_MIGRATE 0
#define DEBUG_PIXMAP 0
#if DEBUG_MIGRATE #if DEBUG_MIGRATE
#define DBG_MIGRATE(a) ErrorF a #define DBG_MIGRATE(a) ErrorF a
#else #else
@ -210,12 +208,11 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
if (!pExaPixmap->area) if (!pExaPixmap->area)
return FALSE; return FALSE;
DBG_PIXMAP(("++ 0x%p (0x%p) (%dx%d)\n", DBG_PIXMAP(("++ 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
(void*)pPixmap->drawable.id, (ExaGetPixmapPriv(pPixmap)->area ?
(void*)(ExaGetPixmapPriv(pPixmap)->area ? ExaGetPixmapPriv(pPixmap)->area->offset : 0),
ExaGetPixmapPriv(pPixmap)->area->offset : 0), pPixmap->drawable.width,
pPixmap->drawable.width, pPixmap->drawable.height));
pPixmap->drawable.height));
pPixmap->devKind = pitch; pPixmap->devKind = pitch;
pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset); pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset);
@ -233,18 +230,22 @@ exaMoveInPixmap (PixmapPtr pPixmap)
char *dst, *src; char *dst, *src;
int i; int i;
DBG_MIGRATE (("-> 0x%p (0x%p) (%dx%d)\n", DBG_MIGRATE (("-> 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
(void*)pPixmap->drawable.id, (ExaGetPixmapPriv(pPixmap)->area ?
(void*)(ExaGetPixmapPriv(pPixmap)->area ? ExaGetPixmapPriv(pPixmap)->area->offset : 0),
ExaGetPixmapPriv(pPixmap)->area->offset : 0),
pPixmap->drawable.width, pPixmap->drawable.width,
pPixmap->drawable.height)); pPixmap->drawable.height));
src = pPixmap->devPrivate.ptr; src = pPixmap->devPrivate.ptr;
src_pitch = pPixmap->devKind; 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; return;
}
pExaPixmap->dirty = FALSE; pExaPixmap->dirty = FALSE;
@ -274,7 +275,6 @@ exaMoveInPixmap (PixmapPtr pPixmap)
dst += dst_pitch; dst += dst_pitch;
src += src_pitch; src += src_pitch;
} }
DBG_PIXMAP("done\n");
} }
static void static void
@ -332,16 +332,19 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
if (pExaPixmap == NULL) { if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n", DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n",
pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m")); (pointer)pPixmap,
exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return; 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)); DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n",
(pointer)pPixmap));
return; 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) { if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT) {
exaMoveInPixmap(pPixmap); exaMoveInPixmap(pPixmap);
@ -349,12 +352,14 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
} }
if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX) if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX)
{
pExaPixmap->score++; pExaPixmap->score++;
if (!exaPixmapIsOffscreen(pPixmap) &&
pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN) if (pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN &&
exaMoveInPixmap (pPixmap); !exaPixmapIsOffscreen(pPixmap))
{
exaMoveInPixmap (pPixmap);
} }
ExaOffscreenMarkUsed (pPixmap); ExaOffscreenMarkUsed (pPixmap);
} }
@ -365,11 +370,12 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
if (pExaPixmap == NULL) { if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n", DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n",
pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m")); (pointer)pPixmap,
exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return; 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) if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
return; return;
@ -378,12 +384,10 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
pExaPixmap->score = 0; pExaPixmap->score = 0;
if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN) if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN)
{
pExaPixmap->score--; pExaPixmap->score--;
if (pExaPixmap->area &&
pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT) if (pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT && pExaPixmap->area)
exaMoveOutPixmap (pPixmap); exaMoveOutPixmap (pPixmap);
}
} }
static Bool static Bool
@ -534,7 +538,8 @@ exaPrepareAccess(DrawablePtr pDrawable, int index)
if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) { if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) {
ExaPixmapPriv (pPixmap); 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); exaMoveOutPixmap (pPixmap);
} }
} }
@ -728,6 +733,8 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
} }
fallback: fallback:
EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pSrcDrawable,
(long)pDstDrawable));
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC); exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
@ -884,6 +891,7 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) || !(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg)) !(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
{ {
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel); fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2, fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
@ -1011,6 +1019,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
opaque = FALSE; opaque = FALSE;
} }
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
ppci = ppciInit; ppci = ppciInit;
@ -1187,6 +1196,7 @@ exaFillRegionSolid (DrawablePtr pDrawable,
} }
else else
{ {
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionSolid (pDrawable, pRegion, 0, fbFillRegionSolid (pDrawable, pRegion, 0,
fbReplicatePixel (pixel, pDrawable->bitsPerPixel)); fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
@ -1278,6 +1288,7 @@ exaFillRegionTiled (DrawablePtr pDrawable,
} }
fallback: fallback:
EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pTile, (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionTiled (pDrawable, pRegion, pTile); fbFillRegionTiled (pDrawable, pRegion, pTile);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
@ -1548,7 +1559,6 @@ exaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
{ {
static Bool Initialised = FALSE; static Bool Initialised = FALSE;
DBG_PIXMAP("exa setup\n");
if (!Initialised) { if (!Initialised) {
Initialised = TRUE; Initialised = TRUE;
#ifndef REMOVE_LOADER_CHECK_MODULE_INFO #ifndef REMOVE_LOADER_CHECK_MODULE_INFO

View File

@ -52,6 +52,21 @@
#include "fbpict.h" #include "fbpict.h"
#endif #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 #ifndef EXA_MAX_FB
#define EXA_MAX_FB FB_OVERLAY_MAX #define EXA_MAX_FB FB_OVERLAY_MAX
#endif #endif

View File

@ -32,8 +32,6 @@
#include "xf86.h" #include "xf86.h"
#include "exa.h" #include "exa.h"
#define DEBUG_MIGRATE 0
#define DEBUG_PIXMAP 0
#if DEBUG_MIGRATE #if DEBUG_MIGRATE
#define DBG_MIGRATE(a) ErrorF a #define DBG_MIGRATE(a) ErrorF a
#else #else
@ -210,12 +208,11 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
if (!pExaPixmap->area) if (!pExaPixmap->area)
return FALSE; return FALSE;
DBG_PIXMAP(("++ 0x%p (0x%p) (%dx%d)\n", DBG_PIXMAP(("++ 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
(void*)pPixmap->drawable.id, (ExaGetPixmapPriv(pPixmap)->area ?
(void*)(ExaGetPixmapPriv(pPixmap)->area ? ExaGetPixmapPriv(pPixmap)->area->offset : 0),
ExaGetPixmapPriv(pPixmap)->area->offset : 0), pPixmap->drawable.width,
pPixmap->drawable.width, pPixmap->drawable.height));
pPixmap->drawable.height));
pPixmap->devKind = pitch; pPixmap->devKind = pitch;
pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset); pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset);
@ -233,18 +230,22 @@ exaMoveInPixmap (PixmapPtr pPixmap)
char *dst, *src; char *dst, *src;
int i; int i;
DBG_MIGRATE (("-> 0x%p (0x%p) (%dx%d)\n", DBG_MIGRATE (("-> 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
(void*)pPixmap->drawable.id, (ExaGetPixmapPriv(pPixmap)->area ?
(void*)(ExaGetPixmapPriv(pPixmap)->area ? ExaGetPixmapPriv(pPixmap)->area->offset : 0),
ExaGetPixmapPriv(pPixmap)->area->offset : 0),
pPixmap->drawable.width, pPixmap->drawable.width,
pPixmap->drawable.height)); pPixmap->drawable.height));
src = pPixmap->devPrivate.ptr; src = pPixmap->devPrivate.ptr;
src_pitch = pPixmap->devKind; 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; return;
}
pExaPixmap->dirty = FALSE; pExaPixmap->dirty = FALSE;
@ -274,7 +275,6 @@ exaMoveInPixmap (PixmapPtr pPixmap)
dst += dst_pitch; dst += dst_pitch;
src += src_pitch; src += src_pitch;
} }
DBG_PIXMAP("done\n");
} }
static void static void
@ -332,16 +332,19 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
if (pExaPixmap == NULL) { if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n", DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n",
pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m")); (pointer)pPixmap,
exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return; 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)); DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n",
(pointer)pPixmap));
return; 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) { if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT) {
exaMoveInPixmap(pPixmap); exaMoveInPixmap(pPixmap);
@ -349,12 +352,14 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
} }
if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX) if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX)
{
pExaPixmap->score++; pExaPixmap->score++;
if (!exaPixmapIsOffscreen(pPixmap) &&
pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN) if (pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN &&
exaMoveInPixmap (pPixmap); !exaPixmapIsOffscreen(pPixmap))
{
exaMoveInPixmap (pPixmap);
} }
ExaOffscreenMarkUsed (pPixmap); ExaOffscreenMarkUsed (pPixmap);
} }
@ -365,11 +370,12 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
if (pExaPixmap == NULL) { if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n", DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n",
pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m")); (pointer)pPixmap,
exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return; 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) if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
return; return;
@ -378,12 +384,10 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
pExaPixmap->score = 0; pExaPixmap->score = 0;
if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN) if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN)
{
pExaPixmap->score--; pExaPixmap->score--;
if (pExaPixmap->area &&
pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT) if (pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT && pExaPixmap->area)
exaMoveOutPixmap (pPixmap); exaMoveOutPixmap (pPixmap);
}
} }
static Bool static Bool
@ -534,7 +538,8 @@ exaPrepareAccess(DrawablePtr pDrawable, int index)
if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) { if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) {
ExaPixmapPriv (pPixmap); 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); exaMoveOutPixmap (pPixmap);
} }
} }
@ -728,6 +733,8 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
} }
fallback: fallback:
EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pSrcDrawable,
(long)pDstDrawable));
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC); exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
@ -884,6 +891,7 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) || !(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg)) !(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
{ {
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel); fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2, fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
@ -1011,6 +1019,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
opaque = FALSE; opaque = FALSE;
} }
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
ppci = ppciInit; ppci = ppciInit;
@ -1187,6 +1196,7 @@ exaFillRegionSolid (DrawablePtr pDrawable,
} }
else else
{ {
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionSolid (pDrawable, pRegion, 0, fbFillRegionSolid (pDrawable, pRegion, 0,
fbReplicatePixel (pixel, pDrawable->bitsPerPixel)); fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
@ -1278,6 +1288,7 @@ exaFillRegionTiled (DrawablePtr pDrawable,
} }
fallback: fallback:
EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pTile, (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionTiled (pDrawable, pRegion, pTile); fbFillRegionTiled (pDrawable, pRegion, pTile);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
@ -1548,7 +1559,6 @@ exaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
{ {
static Bool Initialised = FALSE; static Bool Initialised = FALSE;
DBG_PIXMAP("exa setup\n");
if (!Initialised) { if (!Initialised) {
Initialised = TRUE; Initialised = TRUE;
#ifndef REMOVE_LOADER_CHECK_MODULE_INFO #ifndef REMOVE_LOADER_CHECK_MODULE_INFO

View File

@ -32,8 +32,6 @@
#include "xf86.h" #include "xf86.h"
#include "exa.h" #include "exa.h"
#define DEBUG_MIGRATE 0
#define DEBUG_PIXMAP 0
#if DEBUG_MIGRATE #if DEBUG_MIGRATE
#define DBG_MIGRATE(a) ErrorF a #define DBG_MIGRATE(a) ErrorF a
#else #else
@ -210,12 +208,11 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
if (!pExaPixmap->area) if (!pExaPixmap->area)
return FALSE; return FALSE;
DBG_PIXMAP(("++ 0x%p (0x%p) (%dx%d)\n", DBG_PIXMAP(("++ 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
(void*)pPixmap->drawable.id, (ExaGetPixmapPriv(pPixmap)->area ?
(void*)(ExaGetPixmapPriv(pPixmap)->area ? ExaGetPixmapPriv(pPixmap)->area->offset : 0),
ExaGetPixmapPriv(pPixmap)->area->offset : 0), pPixmap->drawable.width,
pPixmap->drawable.width, pPixmap->drawable.height));
pPixmap->drawable.height));
pPixmap->devKind = pitch; pPixmap->devKind = pitch;
pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset); pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pExaScr->info->card.memoryBase + pExaPixmap->area->offset);
@ -233,18 +230,22 @@ exaMoveInPixmap (PixmapPtr pPixmap)
char *dst, *src; char *dst, *src;
int i; int i;
DBG_MIGRATE (("-> 0x%p (0x%p) (%dx%d)\n", DBG_MIGRATE (("-> 0x%lx (0x%x) (%dx%d)\n", pPixmap->drawable.id,
(void*)pPixmap->drawable.id, (ExaGetPixmapPriv(pPixmap)->area ?
(void*)(ExaGetPixmapPriv(pPixmap)->area ? ExaGetPixmapPriv(pPixmap)->area->offset : 0),
ExaGetPixmapPriv(pPixmap)->area->offset : 0),
pPixmap->drawable.width, pPixmap->drawable.width,
pPixmap->drawable.height)); pPixmap->drawable.height));
src = pPixmap->devPrivate.ptr; src = pPixmap->devPrivate.ptr;
src_pitch = pPixmap->devKind; 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; return;
}
pExaPixmap->dirty = FALSE; pExaPixmap->dirty = FALSE;
@ -274,7 +275,6 @@ exaMoveInPixmap (PixmapPtr pPixmap)
dst += dst_pitch; dst += dst_pitch;
src += src_pitch; src += src_pitch;
} }
DBG_PIXMAP("done\n");
} }
static void static void
@ -332,16 +332,19 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
if (pExaPixmap == NULL) { if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n", DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n",
pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m")); (pointer)pPixmap,
exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return; 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)); DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n",
(pointer)pPixmap));
return; 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) { if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT) {
exaMoveInPixmap(pPixmap); exaMoveInPixmap(pPixmap);
@ -349,12 +352,14 @@ exaPixmapUseScreen (PixmapPtr pPixmap)
} }
if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX) if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX)
{
pExaPixmap->score++; pExaPixmap->score++;
if (!exaPixmapIsOffscreen(pPixmap) &&
pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN) if (pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN &&
exaMoveInPixmap (pPixmap); !exaPixmapIsOffscreen(pPixmap))
{
exaMoveInPixmap (pPixmap);
} }
ExaOffscreenMarkUsed (pPixmap); ExaOffscreenMarkUsed (pPixmap);
} }
@ -365,11 +370,12 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
if (pExaPixmap == NULL) { if (pExaPixmap == NULL) {
DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n", DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n",
pPixmap, exaPixmapIsOffscreen(pPixmap) ? "s" : "m")); (pointer)pPixmap,
exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
return; 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) if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
return; return;
@ -378,12 +384,10 @@ exaPixmapUseMemory (PixmapPtr pPixmap)
pExaPixmap->score = 0; pExaPixmap->score = 0;
if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN) if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN)
{
pExaPixmap->score--; pExaPixmap->score--;
if (pExaPixmap->area &&
pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT) if (pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT && pExaPixmap->area)
exaMoveOutPixmap (pPixmap); exaMoveOutPixmap (pPixmap);
}
} }
static Bool static Bool
@ -534,7 +538,8 @@ exaPrepareAccess(DrawablePtr pDrawable, int index)
if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) { if (!(*pExaScr->info->accel.PrepareAccess) (pPixmap, index)) {
ExaPixmapPriv (pPixmap); 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); exaMoveOutPixmap (pPixmap);
} }
} }
@ -728,6 +733,8 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
} }
fallback: fallback:
EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pSrcDrawable,
(long)pDstDrawable));
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC); exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
@ -884,6 +891,7 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) || !(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
!(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg)) !(*pExaScr->info->accel.PrepareSolid) (pPixmap, GXcopy, pm, fg))
{ {
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel); fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2, fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
@ -1011,6 +1019,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
opaque = FALSE; opaque = FALSE;
} }
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
ppci = ppciInit; ppci = ppciInit;
@ -1187,6 +1196,7 @@ exaFillRegionSolid (DrawablePtr pDrawable,
} }
else else
{ {
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionSolid (pDrawable, pRegion, 0, fbFillRegionSolid (pDrawable, pRegion, 0,
fbReplicatePixel (pixel, pDrawable->bitsPerPixel)); fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
@ -1278,6 +1288,7 @@ exaFillRegionTiled (DrawablePtr pDrawable,
} }
fallback: fallback:
EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pTile, (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbFillRegionTiled (pDrawable, pRegion, pTile); fbFillRegionTiled (pDrawable, pRegion, pTile);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
@ -1548,7 +1559,6 @@ exaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
{ {
static Bool Initialised = FALSE; static Bool Initialised = FALSE;
DBG_PIXMAP("exa setup\n");
if (!Initialised) { if (!Initialised) {
Initialised = TRUE; Initialised = TRUE;
#ifndef REMOVE_LOADER_CHECK_MODULE_INFO #ifndef REMOVE_LOADER_CHECK_MODULE_INFO

View File

@ -22,7 +22,6 @@
#include "exaPriv.h" #include "exaPriv.h"
#define DEBUG_OFFSCREEN 0
#if DEBUG_OFFSCREEN #if DEBUG_OFFSCREEN
#define DBG_OFFSCREEN(a) ErrorF a #define DBG_OFFSCREEN(a) ErrorF a
#else #else
@ -85,7 +84,9 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
/* throw out requests that cannot fit */ /* throw out requests that cannot fit */
if (size > (pExaScr->info->card.memorySize - pExaScr->info->card.offScreenBase)) 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; return NULL;
} }

View File

@ -52,6 +52,21 @@
#include "fbpict.h" #include "fbpict.h"
#endif #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 #ifndef EXA_MAX_FB
#define EXA_MAX_FB FB_OVERLAY_MAX #define EXA_MAX_FB FB_OVERLAY_MAX
#endif #endif

View File

@ -33,9 +33,8 @@
#include "xf86str.h" #include "xf86str.h"
#include "xf86.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) static void exaCompositeFallbackPictDesc(PicturePtr pict, char *string, int n)
{ {
char format[20]; char format[20];
@ -537,7 +536,7 @@ exaComposite(CARD8 op,
exaDrawableUseMemory(pDst->pDrawable); exaDrawableUseMemory(pDst->pDrawable);
} }
#if EXA_DEBUG_FALLBACKS #if DEBUG_TRACE_FALL
exaPrintCompositeFallback (op, pSrc, pMask, pDst); exaPrintCompositeFallback (op, pSrc, pMask, pDst);
#endif #endif

View File

@ -23,17 +23,6 @@
#include "exaPriv.h" #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 * These functions wrap the low-level fb rendering functions and
* synchronize framebuffer/accelerated drawing by stalling until * synchronize framebuffer/accelerated drawing by stalling until

View File

@ -23,17 +23,6 @@
#include "exaPriv.h" #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 * These functions wrap the low-level fb rendering functions and
* synchronize framebuffer/accelerated drawing by stalling until * synchronize framebuffer/accelerated drawing by stalling until

View File

@ -22,7 +22,6 @@
#include "exaPriv.h" #include "exaPriv.h"
#define DEBUG_OFFSCREEN 0
#if DEBUG_OFFSCREEN #if DEBUG_OFFSCREEN
#define DBG_OFFSCREEN(a) ErrorF a #define DBG_OFFSCREEN(a) ErrorF a
#else #else
@ -85,7 +84,9 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
/* throw out requests that cannot fit */ /* throw out requests that cannot fit */
if (size > (pExaScr->info->card.memorySize - pExaScr->info->card.offScreenBase)) 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; return NULL;
} }

View File

@ -33,9 +33,8 @@
#include "xf86str.h" #include "xf86str.h"
#include "xf86.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) static void exaCompositeFallbackPictDesc(PicturePtr pict, char *string, int n)
{ {
char format[20]; char format[20];
@ -537,7 +536,7 @@ exaComposite(CARD8 op,
exaDrawableUseMemory(pDst->pDrawable); exaDrawableUseMemory(pDst->pDrawable);
} }
#if EXA_DEBUG_FALLBACKS #if DEBUG_TRACE_FALL
exaPrintCompositeFallback (op, pSrc, pMask, pDst); exaPrintCompositeFallback (op, pSrc, pMask, pDst);
#endif #endif