summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-11-05 13:29:39 -0800
committerEric Anholt <eric@anholt.net>2008-11-05 17:22:00 -0800
commit801f0eac4f7b0071ed21eb9c68c5a951e1cc409a (patch)
tree0c374c2e10f6a463545f5a252fb9dd6097868e82
parentd828b0802c939cb12664db4dd157a4944a4db01b (diff)
Make I830FALLBACK debugging a runtime instead of compile-time option.
-rw-r--r--man/intel.man6
-rw-r--r--src/i830.h11
-rw-r--r--src/i830_driver.c5
-rw-r--r--src/i830_exa.c17
-rw-r--r--src/i830_render.c21
-rw-r--r--src/i915_render.c21
-rw-r--r--src/i965_render.c21
7 files changed, 34 insertions, 68 deletions
diff --git a/man/intel.man b/man/intel.man
index 1d30d1c3..ef0337c4 100644
--- a/man/intel.man
+++ b/man/intel.man
@@ -179,6 +179,12 @@ Default: "EXA".
.BI "Option \*qModeDebug\*q \*q" boolean \*q
Enable printing of additional debugging information about modesetting to
the server log.
+Default: Disabled
+.TP
+.BI "Option \*qFallbackDebug\*q \*q" boolean \*q
+Enable printing of debugging information on acceleration fallbacks to the
+server log.
+Default: Disabled
.TP
.BI "Option \*qForceEnablePipeA\*q \*q" boolean \*q
Force the driver to leave pipe A enabled. May be necessary in configurations
diff --git a/src/i830.h b/src/i830.h
index 8d57fa08..14c371cc 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 bb92836e..3b8ea5d9 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 e1cf24e7..9fcda51b 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 7b05daab..d3b0f7cf 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 039db3bf..ab288e1c 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 d39915a7..008856dc 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. */