summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-02-10 15:35:20 -0800
committerEric Anholt <eric@anholt.net>2009-02-10 15:35:20 -0800
commit5212ec6515c6562f66b86fc16928b601bf04e49b (patch)
tree576328595abb84a842691f5560429276b0ce5f0f
parent3aa8591abfbe8db0f13912910c850fdd748808df (diff)
uxa: hook up the fallback debug to the driver's fallback debug option.
-rw-r--r--src/i830_exa.c2
-rw-r--r--uxa/uxa-accel.c6
-rw-r--r--uxa/uxa-priv.h7
-rw-r--r--uxa/uxa-unaccel.c32
-rw-r--r--uxa/uxa.c8
-rw-r--r--uxa/uxa.h3
6 files changed, 50 insertions, 8 deletions
diff --git a/src/i830_exa.c b/src/i830_exa.c
index 28be786b..d18bcd2d 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -1007,6 +1007,8 @@ i830_uxa_init (ScreenPtr pScreen)
I830SelectBuffer(scrn, I830_SELECT_FRONT);
+ uxa_set_fallback_debug(pI830->fallback_debug);
+
return TRUE;
}
#endif /* I830_USE_UXA */
diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c
index f42e0e24..785855cc 100644
--- a/uxa/uxa-accel.c
+++ b/uxa/uxa-accel.c
@@ -424,7 +424,8 @@ uxa_copy_n_to_n (DrawablePtr pSrcDrawable,
Pixel bitplane,
void *closure)
{
- uxa_screen_t *uxa_screen = uxa_get_screen(pDstDrawable->pScreen);
+ ScreenPtr screen = pDstDrawable->pScreen;
+ uxa_screen_t *uxa_screen = uxa_get_screen(screen);
int src_off_x, src_off_y;
int dst_off_x, dst_off_y;
PixmapPtr pSrcPixmap, pDstPixmap;
@@ -988,7 +989,8 @@ void
uxa_get_image (DrawablePtr pDrawable, int x, int y, int w, int h,
unsigned int format, unsigned long planeMask, char *d)
{
- uxa_screen_t *uxa_screen = uxa_get_screen(pDrawable->pScreen);
+ ScreenPtr screen = pDrawable->pScreen;
+ uxa_screen_t *uxa_screen = uxa_get_screen(screen);
BoxRec Box;
PixmapPtr pPix = uxa_get_drawable_pixmap (pDrawable);
int xoff, yoff;
diff --git a/uxa/uxa-priv.h b/uxa/uxa-priv.h
index f4b3ceef..463749a7 100644
--- a/uxa/uxa-priv.h
+++ b/uxa/uxa-priv.h
@@ -67,18 +67,14 @@
#define DEBUG_OFFSCREEN 0
#define DEBUG_GLYPH_CACHE 0
-#if DEBUG_TRACE_FALL
#define UXA_FALLBACK(x) \
-do { \
+if (uxa_get_screen(screen)->fallback_debug) { \
ErrorF("UXA fallback at %s: ", __FUNCTION__); \
ErrorF x; \
} while (0)
char
uxa_drawable_location(DrawablePtr pDrawable);
-#else
-#define UXA_FALLBACK(x)
-#endif
#if DEBUG_PIXMAP
#define DBG_PIXMAP(a) ErrorF a
@@ -139,6 +135,7 @@ typedef struct {
#endif
EnableDisableFBAccessProcPtr SavedEnableDisableFBAccess;
+ Bool fallback_debug;
Bool swappedOut;
unsigned disableFbCount;
unsigned offScreenCounter;
diff --git a/uxa/uxa-unaccel.c b/uxa/uxa-unaccel.c
index aba12e8f..d2c5de03 100644
--- a/uxa/uxa-unaccel.c
+++ b/uxa/uxa-unaccel.c
@@ -80,6 +80,8 @@ void
uxa_check_fill_spans (DrawablePtr pDrawable, GCPtr pGC, int nspans,
DDXPointPtr ppt, int *pwidth, int fSorted)
{
+ ScreenPtr screen = pDrawable->pScreen;
+
UXA_FALLBACK(("to %p (%c)\n", pDrawable, uxa_drawable_location(pDrawable)));
if (uxa_prepare_access (pDrawable, UXA_ACCESS_RW)) {
if (uxa_prepare_access_gc (pGC)) {
@@ -94,6 +96,8 @@ void
uxa_check_set_spans (DrawablePtr pDrawable, GCPtr pGC, char *psrc,
DDXPointPtr ppt, int *pwidth, int nspans, int fSorted)
{
+ ScreenPtr screen = pDrawable->pScreen;
+
UXA_FALLBACK(("to %p (%c)\n", pDrawable, uxa_drawable_location(pDrawable)));
if (uxa_prepare_access (pDrawable, UXA_ACCESS_RW)) {
fbSetSpans (pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
@@ -106,6 +110,8 @@ uxa_check_put_image (DrawablePtr pDrawable, GCPtr pGC, int depth,
int x, int y, int w, int h, int leftPad, int format,
char *bits)
{
+ ScreenPtr screen = pDrawable->pScreen;
+
UXA_FALLBACK(("to %p (%c)\n", pDrawable, uxa_drawable_location(pDrawable)));
if (uxa_prepare_access (pDrawable, UXA_ACCESS_RW)) {
fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
@@ -117,6 +123,7 @@ RegionPtr
uxa_check_copy_area (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
int srcx, int srcy, int w, int h, int dstx, int dsty)
{
+ ScreenPtr screen = pSrc->pScreen;
RegionPtr ret = NULL;
UXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrc, pDst,
@@ -136,6 +143,7 @@ uxa_check_copy_plane (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
int srcx, int srcy, int w, int h, int dstx, int dsty,
unsigned long bitPlane)
{
+ ScreenPtr screen = pSrc->pScreen;
RegionPtr ret = NULL;
UXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrc, pDst,
@@ -155,6 +163,8 @@ void
uxa_check_poly_point (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
DDXPointPtr pptInit)
{
+ ScreenPtr screen = pDrawable->pScreen;
+
UXA_FALLBACK(("to %p (%c)\n", pDrawable, uxa_drawable_location(pDrawable)));
if (uxa_prepare_access (pDrawable, UXA_ACCESS_RW)) {
fbPolyPoint (pDrawable, pGC, mode, npt, pptInit);
@@ -166,6 +176,8 @@ void
uxa_check_poly_lines (DrawablePtr pDrawable, GCPtr pGC,
int mode, int npt, DDXPointPtr ppt)
{
+ ScreenPtr screen = pDrawable->pScreen;
+
UXA_FALLBACK(("to %p (%c), width %d, mode %d, count %d\n",
pDrawable, uxa_drawable_location(pDrawable),
pGC->lineWidth, mode, npt));
@@ -188,6 +200,8 @@ void
uxa_check_poly_segment (DrawablePtr pDrawable, GCPtr pGC,
int nsegInit, xSegment *pSegInit)
{
+ ScreenPtr screen = pDrawable->pScreen;
+
UXA_FALLBACK(("to %p (%c) width %d, count %d\n", pDrawable,
uxa_drawable_location(pDrawable), pGC->lineWidth, nsegInit));
if (pGC->lineWidth == 0) {
@@ -208,6 +222,8 @@ void
uxa_check_poly_arc (DrawablePtr pDrawable, GCPtr pGC,
int narcs, xArc *pArcs)
{
+ ScreenPtr screen = pDrawable->pScreen;
+
UXA_FALLBACK(("to %p (%c)\n", pDrawable, uxa_drawable_location(pDrawable)));
/* Disable this as fbPolyArc can call miZeroPolyArc which in turn
@@ -234,6 +250,8 @@ void
uxa_check_poly_fill_rect (DrawablePtr pDrawable, GCPtr pGC,
int nrect, xRectangle *prect)
{
+ ScreenPtr screen = pDrawable->pScreen;
+
UXA_FALLBACK(("to %p (%c)\n", pDrawable, uxa_drawable_location(pDrawable)));
if (uxa_prepare_access (pDrawable, UXA_ACCESS_RW)) {
@@ -250,6 +268,8 @@ uxa_check_image_glyph_blt (DrawablePtr pDrawable, GCPtr pGC,
int x, int y, unsigned int nglyph,
CharInfoPtr *ppci, pointer pglyphBase)
{
+ ScreenPtr screen = pDrawable->pScreen;
+
UXA_FALLBACK(("to %p (%c)\n", pDrawable,
uxa_drawable_location(pDrawable)));
if (uxa_prepare_access (pDrawable, UXA_ACCESS_RW)) {
@@ -266,6 +286,8 @@ uxa_check_poly_glyph_blt (DrawablePtr pDrawable, GCPtr pGC,
int x, int y, unsigned int nglyph,
CharInfoPtr *ppci, pointer pglyphBase)
{
+ ScreenPtr screen = pDrawable->pScreen;
+
UXA_FALLBACK(("to %p (%c), style %d alu %d\n", pDrawable,
uxa_drawable_location(pDrawable), pGC->fillStyle, pGC->alu));
if (uxa_prepare_access (pDrawable, UXA_ACCESS_RW)) {
@@ -282,6 +304,8 @@ uxa_check_push_pixels (GCPtr pGC, PixmapPtr pBitmap,
DrawablePtr pDrawable,
int w, int h, int x, int y)
{
+ ScreenPtr screen = pDrawable->pScreen;
+
UXA_FALLBACK(("from %p to %p (%c,%c)\n", pBitmap, pDrawable,
uxa_drawable_location(&pBitmap->drawable),
uxa_drawable_location(pDrawable)));
@@ -305,6 +329,8 @@ uxa_check_get_spans (DrawablePtr pDrawable,
int nspans,
char *pdstStart)
{
+ ScreenPtr screen = pDrawable->pScreen;
+
UXA_FALLBACK(("from %p (%c)\n", pDrawable, uxa_drawable_location(pDrawable)));
if (uxa_prepare_access (pDrawable, UXA_ACCESS_RO)) {
fbGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
@@ -326,6 +352,8 @@ uxa_check_composite (CARD8 op,
CARD16 width,
CARD16 height)
{
+ ScreenPtr screen = pDst->pDrawable->pScreen;
+
UXA_FALLBACK(("from picts %p/%p to pict %p\n",
pSrc, pMask, pDst));
@@ -366,7 +394,9 @@ uxa_check_add_traps (PicturePtr pPicture,
int ntrap,
xTrap *traps)
{
- UXA_FALLBACK(("to pict %p (%c)\n",
+ ScreenPtr screen = pPicture->pDrawable->pScreen;
+
+ UXA_FALLBACK(("to pict %p (%c)\n", pPicture,
uxa_drawable_location(pPicture->pDrawable)));
if (uxa_prepare_access(pPicture->pDrawable, UXA_ACCESS_RW)) {
fbAddTraps (pPicture, x_off, y_off, ntrap, traps);
diff --git a/uxa/uxa.c b/uxa/uxa.c
index 4aeb5e47..0de408c7 100644
--- a/uxa/uxa.c
+++ b/uxa/uxa.c
@@ -346,6 +346,14 @@ uxa_xorg_enable_disable_fb_access (int index, Bool enable)
uxa_screen->SavedEnableDisableFBAccess(index, enable);
}
+void
+uxa_set_fallback_debug (ScreenPtr screen, Bool enable)
+{
+ uxa_screen_t *uxa_screen = uxa_get_screen(screen);
+
+ uxa_screen->fallback_debug = enable;
+}
+
/**
* uxa_close_screen() unwraps its wrapped screen functions and tears down UXA's
* screen private, before calling down to the next CloseSccreen.
diff --git a/uxa/uxa.h b/uxa/uxa.h
index f1c1cfa9..8f6f896c 100644
--- a/uxa/uxa.h
+++ b/uxa/uxa.h
@@ -517,6 +517,9 @@ uxa_driver_fini(ScreenPtr pScreen);
CARD32
uxa_get_pixmap_first_pixel (PixmapPtr pPixmap);
+void
+uxa_set_fallback_debug (ScreenPtr screen, Bool enable);
+
/**
* Returns TRUE if the given planemask covers all the significant bits in the
* pixel values for pDrawable.