Move the draw tracing supplies into ati_draw.h, and do some touchups on it.

(When tracing drawing, I want to know what I'm drawing to, at a
    minimum).
This commit is contained in:
Eric Anholt 2005-02-21 03:44:10 +00:00
parent de34b0eefc
commit c4b3fcda98
3 changed files with 26 additions and 27 deletions

View File

@ -342,22 +342,6 @@ ATIUnmapReg(KdCardInfo *card, ATICardInfo *atic);
void
R300CGWorkaround(ATIScreenInfo *atis);
#define ATI_TRACE 0
#if ATI_TRACE
#define ENTER_DRAW(pix) ATIEnterDraw(pix, __FUNCTION__)
#define LEAVE_DRAW(pix) ATILeaveDraw(pix, __FUNCTION__)
void
ATIEnterDraw (PixmapPtr pPixmap, char *function);
void
ATILeaveDraw (PixmapPtr pPixmap, char *function);
#else
#define ENTER_DRAW(pix)
#define LEAVE_DRAW(pix)
#endif
/* ati_draw.c */
void
ATIDrawSetup(ScreenPtr pScreen);

View File

@ -221,29 +221,28 @@ RadeonSwitchTo3D(ATIScreenInfo *atis)
LEAVE_DRAW(0);
}
#if ATI_TRACE
#if ATI_TRACE_DRAW
void
ATIEnterDraw (PixmapPtr pPix, char *function)
{
if (pPix)
{
if (pPix != NULL) {
KdScreenPriv(pPix->drawable.pScreen);
CARD32 offset;
offset = ((CARD8 *)pPix->devPrivate.ptr -
pScreenPriv->screen->memory_base);
ErrorF ("Enter %s 0x%x\n", function, offset);
}
else
ErrorF ("Enter %s 0x%x (%dx%dx%d/%d)\n", function, offset,
pPix->drawable.width, pPix->drawable.height, pPix->drawable.depth,
pPix->drawable.bitsPerPixel);
} else
ErrorF ("Enter %s\n", function);
}
void
ATILeaveDraw (PixmapPtr pPix, char *function)
{
if (pPix)
{
if (pPix != NULL) {
KdScreenPriv(pPix->drawable.pScreen);
CARD32 offset;
@ -251,8 +250,7 @@ ATILeaveDraw (PixmapPtr pPix, char *function)
pScreenPriv->screen->memory_base);
ErrorF ("Leave %s 0x%x\n", function, offset);
}
else
} else
ErrorF ("Leave %s\n", function);
}
#endif

View File

@ -63,7 +63,10 @@ void RadeonSwitchTo2D(ATIScreenInfo *atis);
void RadeonSwitchTo3D(ATIScreenInfo *atis);
void ATIWaitIdle(ATIScreenInfo *atis);
#if 0
#define ATI_TRACE_FALL 0
#define ATI_TRACE_DRAW 0
#if ATI_TRACE_FALL
#define ATI_FALLBACK(x) \
do { \
ErrorF("%s: ", __FUNCTION__); \
@ -74,4 +77,18 @@ do { \
#define ATI_FALLBACK(x) return FALSE
#endif
#if ATI_TRACE_DRAW
#define ENTER_DRAW(pix) ATIEnterDraw(pix, __FUNCTION__)
#define LEAVE_DRAW(pix) ATILeaveDraw(pix, __FUNCTION__)
void
ATIEnterDraw (PixmapPtr pPixmap, char *function);
void
ATILeaveDraw (PixmapPtr pPixmap, char *function);
#else /* ATI_TRACE */
#define ENTER_DRAW(pix)
#define LEAVE_DRAW(pix)
#endif /* !ATI_TRACE */
#endif /* _ATI_DRAW_H_ */