[Intel-gfx] [PATCH] Make I830FALLBACK debugging a runtime instead of compile-time option.

Eric Anholt eric at anholt.net
Wed Nov 5 22:52:03 CET 2008


---
 man/intel.man     |    4 ++++
 src/i830.h        |   11 +++++++++++
 src/i830_driver.c |    5 +++++
 src/i830_exa.c    |   17 -----------------
 src/i830_render.c |   21 ++++-----------------
 src/i915_render.c |   21 ++++-----------------
 src/i965_render.c |   21 ++++-----------------
 7 files changed, 32 insertions(+), 68 deletions(-)

diff --git a/man/intel.man b/man/intel.man
index 1d30d1c..fdcff0e 100644
--- a/man/intel.man
+++ b/man/intel.man
@@ -180,6 +180,10 @@ Default: "EXA".
 Enable printing of additional debugging information about modesetting to
 the server log.
 .TP
+.BI "Option \*qFallbackDebug\*q \*q" boolean \*q
+Enable printing of debugging information on acceleration fallbacks to the
+server log.
+.TP
 .BI "Option \*qForceEnablePipeA\*q \*q" boolean \*q
 Force the driver to leave pipe A enabled.  May be necessary in configurations
 where the BIOS accesses pipe registers during display hotswitch or lid close,
diff --git a/src/i830.h b/src/i830.h
index 8d57fa0..194e04c 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -715,6 +715,8 @@ typedef struct _I830Rec {
    /* User option to ignore SDVO detect bit status, in case some outputs
       not detected on SDVO, so let driver try its best. */
    Bool force_sdvo_detect;
+    /** User option to print acceleration fallback info to the server log. */
+   Bool fallback_debug;
 } I830Rec;
 
 #define I830PTR(p) ((I830Ptr)((p)->driverPrivate))
@@ -959,6 +961,15 @@ static inline int i830_fb_compression_supported(I830Ptr pI830)
     return TRUE;
 }
 
+#define I830FALLBACK(s, arg...)				\
+do {							\
+    if (I830PTR(pScrn)->fallback_debug) {		\
+	xf86DrvMsg(pScrn->scrnIndex, X_INFO,		\
+		   "EXA fallback: " s "\n", ##arg);	\
+	return FALSE;					\
+    }							\
+} while(0)
+
 Bool i830_pixmap_tiled(PixmapPtr p);
 
 #define i830_exa_check_pitch_2d(p) do {\
diff --git a/src/i830_driver.c b/src/i830_driver.c
index bb92836..3b8ea5d 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -302,6 +302,7 @@ typedef enum {
    OPTION_VIDEO_KEY,
    OPTION_COLOR_KEY,
    OPTION_MODEDEBUG,
+   OPTION_FALLBACKDEBUG,
    OPTION_LVDS24BITMODE,
    OPTION_FBC,
    OPTION_TILING,
@@ -327,6 +328,7 @@ static OptionInfoRec I830Options[] = {
    {OPTION_COLOR_KEY,	"ColorKey",	OPTV_INTEGER,	{0},	FALSE},
    {OPTION_VIDEO_KEY,	"VideoKey",	OPTV_INTEGER,	{0},	FALSE},
    {OPTION_MODEDEBUG,	"ModeDebug",	OPTV_BOOLEAN,	{0},	FALSE},
+   {OPTION_FALLBACKDEBUG, "FallbackDebug", OPTV_BOOLEAN, {0},	FALSE},
    {OPTION_LVDS24BITMODE, "LVDS24Bit",	OPTV_BOOLEAN,	{0},	FALSE},
    {OPTION_FBC,		"FramebufferCompression", OPTV_BOOLEAN, {0}, TRUE},
    {OPTION_TILING,	"Tiling",	OPTV_BOOLEAN,	{0},	TRUE},
@@ -1433,6 +1435,9 @@ I830GetEarlyOptions(ScrnInfoPtr pScrn)
     memcpy(pI830->Options, I830Options, sizeof(I830Options));
     xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pI830->Options);
 
+    pI830->fallback_debug = xf86ReturnOptValBool(pI830->Options,
+						 OPTION_FALLBACKDEBUG, FALSE);
+
     if (xf86ReturnOptValBool(pI830->Options, OPTION_MODEDEBUG, FALSE)) {
 	pI830->debug_modes = TRUE;
     } else {
diff --git a/src/i830_exa.c b/src/i830_exa.c
index e1cf24e..9fcda51 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -37,26 +37,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "i810_reg.h"
 #include <string.h>
 
-#ifdef I830DEBUG
-#define DEBUG_I830FALLBACK 1
-#endif
-
 #define ALWAYS_SYNC		0
 #define ALWAYS_FLUSH		0
 
-#ifdef DEBUG_I830FALLBACK
-#define I830FALLBACK(s, arg...)				\
-do {							\
-	DPRINTF(PFX, "EXA fallback: " s "\n", ##arg); 	\
-	return FALSE;					\
-} while(0)
-#else
-#define I830FALLBACK(s, arg...) 			\
-do { 							\
-	return FALSE;					\
-} while(0)
-#endif
-
 const int I830CopyROP[16] =
 {
    ROP_0,               /* GXclear */
diff --git a/src/i830_render.c b/src/i830_render.c
index 7b05daa..d3b0f7c 100644
--- a/src/i830_render.c
+++ b/src/i830_render.c
@@ -34,23 +34,6 @@
 #include "i830.h"
 #include "i830_reg.h"
 
-#ifdef I830DEBUG
-#define DEBUG_I830FALLBACK 1
-#endif
-
-#ifdef DEBUG_I830FALLBACK
-#define I830FALLBACK(s, arg...)				\
-do {							\
-	DPRINTF(PFX, "EXA fallback: " s "\n", ##arg); 	\
-	return FALSE;					\
-} while(0)
-#else
-#define I830FALLBACK(s, arg...) 			\
-do { 							\
-	return FALSE;					\
-} while(0)
-#endif
-
 struct blendinfo {
     Bool dst_alpha;
     Bool src_alpha;
@@ -160,6 +143,8 @@ static struct formatinfo i830_tex_formats[] = {
 
 static Bool i830_get_dest_format(PicturePtr pDstPicture, uint32_t *dst_format)
 {
+    ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
+
     switch (pDstPicture->format) {
     case PICT_a8r8g8b8:
     case PICT_x8r8g8b8:
@@ -227,6 +212,7 @@ static uint32_t i830_get_blend_cntl(int op, PicturePtr pMask,
 
 static Bool i830_check_composite_texture(PicturePtr pPict, int unit)
 {
+    ScrnInfoPtr pScrn = xf86Screens[pPict->pDrawable->pScreen->myNum];
     int w = pPict->pDrawable->width;
     int h = pPict->pDrawable->height;
     int i;
@@ -371,6 +357,7 @@ Bool
 i830_check_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
 		     PicturePtr pDstPicture)
 {
+    ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
     uint32_t tmp1;
 
     /* Check for unsupported compositing operations. */
diff --git a/src/i915_render.c b/src/i915_render.c
index 039db3b..ab288e1 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -35,23 +35,6 @@
 #include "i915_reg.h"
 #include "i915_3d.h"
 
-#ifdef I830DEBUG
-#define DEBUG_I830FALLBACK 1
-#endif
-
-#ifdef DEBUG_I830FALLBACK
-#define I830FALLBACK(s, arg...)				\
-do {							\
-	DPRINTF(PFX, "EXA fallback: " s "\n", ##arg); 	\
-	return FALSE;					\
-} while(0)
-#else
-#define I830FALLBACK(s, arg...) 			\
-do { 							\
-	return FALSE;					\
-} while(0)
-#endif
-
 struct formatinfo {
     int fmt;
     uint32_t card_fmt;
@@ -155,6 +138,8 @@ static uint32_t i915_get_blend_cntl(int op, PicturePtr pMask,
 
 static Bool i915_get_dest_format(PicturePtr pDstPicture, uint32_t *dst_format)
 {
+    ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
+
     switch (pDstPicture->format) {
     case PICT_a8r8g8b8:
     case PICT_x8r8g8b8:
@@ -184,6 +169,7 @@ static Bool i915_get_dest_format(PicturePtr pDstPicture, uint32_t *dst_format)
 
 static Bool i915_check_composite_texture(PicturePtr pPict, int unit)
 {
+    ScrnInfoPtr pScrn = xf86Screens[pPict->pDrawable->pScreen->myNum];
     int w = pPict->pDrawable->width;
     int h = pPict->pDrawable->height;
     int i;
@@ -215,6 +201,7 @@ Bool
 i915_check_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
 		     PicturePtr pDstPicture)
 {
+    ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
     uint32_t tmp1;
 
     /* Check for unsupported compositing operations. */
diff --git a/src/i965_render.c b/src/i965_render.c
index d39915a..008856d 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -42,23 +42,6 @@
 #include "brw_defines.h"
 #include "brw_structs.h"
 
-#ifdef I830DEBUG
-#define DEBUG_I830FALLBACK 1
-#endif
-
-#ifdef DEBUG_I830FALLBACK
-#define I830FALLBACK(s, arg...)				\
-do {							\
-	DPRINTF(PFX, "EXA fallback: " s "\n", ##arg); 	\
-	return FALSE;					\
-} while(0)
-#else
-#define I830FALLBACK(s, arg...) 			\
-do { 							\
-	return FALSE;					\
-} while(0)
-#endif
-
 /* 24 = 4 vertices/composite * 3 texcoords/vertex * 2 floats/texcoord
  *
  * This is an upper-bound based on the case of a non-affine
@@ -167,6 +150,8 @@ static void i965_get_blend_cntl(int op, PicturePtr pMask, uint32_t dst_format,
 
 static Bool i965_get_dest_format(PicturePtr pDstPicture, uint32_t *dst_format)
 {
+    ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
+
     switch (pDstPicture->format) {
     case PICT_a8r8g8b8:
     case PICT_x8r8g8b8:
@@ -198,6 +183,7 @@ static Bool i965_get_dest_format(PicturePtr pDstPicture, uint32_t *dst_format)
 
 static Bool i965_check_composite_texture(PicturePtr pPict, int unit)
 {
+    ScrnInfoPtr pScrn = xf86Screens[pPict->pDrawable->pScreen->myNum];
     int w = pPict->pDrawable->width;
     int h = pPict->pDrawable->height;
     int i;
@@ -232,6 +218,7 @@ Bool
 i965_check_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
 		     PicturePtr pDstPicture)
 {
+    ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
     uint32_t tmp1;
 
     /* Check for unsupported compositing operations. */
-- 
1.5.6.5




More information about the Intel-gfx mailing list