summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyu.z.wang@intel.com>2008-06-23 15:51:49 +0800
committerZhenyu Wang <zhenyu.z.wang@intel.com>2008-07-21 11:00:01 +0800
commit3f57fd5fef6bb6baefa3d157d4e5d9c6154c67d5 (patch)
tree1657721b32cdc3b9f9a8681d7f9fccea38a89cd4
parent736bed6734cf1a070fc7da6a1384edc5fd466887 (diff)
xvmc: environ debug option support
export INTEL_XVMC_DEBUG=1 (cherry picked from commit 54f3f528e4804b958936ac773e7a507b2676f815)
-rw-r--r--src/xvmc/intel_xvmc.c10
-rw-r--r--src/xvmc/intel_xvmc.h2
2 files changed, 11 insertions, 1 deletions
diff --git a/src/xvmc/intel_xvmc.c b/src/xvmc/intel_xvmc.c
index 0db3ca62..8fabb35e 100644
--- a/src/xvmc/intel_xvmc.c
+++ b/src/xvmc/intel_xvmc.c
@@ -98,9 +98,17 @@ unsigned int mb_bytes_420[] = {
768 /* 111111 */
};
+int DEBUG;
+
static int error_base;
static int event_base;
+static void intel_xvmc_debug_init(void)
+{
+ if (getenv("INTEL_XVMC_DEBUG"))
+ DEBUG = 1;
+}
+
/* locking */
static void intel_xvmc_try_heavy_lock(drm_context_t ctx)
{
@@ -282,6 +290,8 @@ Status XvMCCreateContext(Display *display, XvPortID port,
return BadValue;
}
+ intel_xvmc_debug_init();
+
/* Open DRI Device */
if((fd = drmOpen("i915", NULL)) < 0) {
XVMC_ERR("DRM Device could not be opened.");
diff --git a/src/xvmc/intel_xvmc.h b/src/xvmc/intel_xvmc.h
index 31196238..4d8b6055 100644
--- a/src/xvmc/intel_xvmc.h
+++ b/src/xvmc/intel_xvmc.h
@@ -56,7 +56,7 @@
#include "intel_batchbuffer.h"
-#define DEBUG 0
+extern int DEBUG;
#define XVMC_ERR(s, arg...) \
do { \