diff options
author | Eric Anholt <anholt@freebsd.org> | 2005-02-21 03:44:10 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2005-02-21 03:44:10 +0000 |
commit | c4b3fcda98a92c204534f04bd386ace5d3620d86 (patch) | |
tree | a5d8f237ea104ff7aa89867c44dfa344c16c17bd | |
parent | de34b0eefc9f8a29147659454398cabb187c7cb6 (diff) |
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).
-rw-r--r-- | hw/kdrive/ati/ati.h | 16 | ||||
-rw-r--r-- | hw/kdrive/ati/ati_draw.c | 18 | ||||
-rw-r--r-- | hw/kdrive/ati/ati_draw.h | 19 |
3 files changed, 26 insertions, 27 deletions
diff --git a/hw/kdrive/ati/ati.h b/hw/kdrive/ati/ati.h index cf14b81b3..cf7525b96 100644 --- a/hw/kdrive/ati/ati.h +++ b/hw/kdrive/ati/ati.h @@ -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); diff --git a/hw/kdrive/ati/ati_draw.c b/hw/kdrive/ati/ati_draw.c index 12b85ed9b..99b1b8ef2 100644 --- a/hw/kdrive/ati/ati_draw.c +++ b/hw/kdrive/ati/ati_draw.c @@ -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 diff --git a/hw/kdrive/ati/ati_draw.h b/hw/kdrive/ati/ati_draw.h index 4727d3590..addaa0ee0 100644 --- a/hw/kdrive/ati/ati_draw.h +++ b/hw/kdrive/ati/ati_draw.h @@ -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_ */ |