intel_dump_batchbuffer(GLuint offset, GLuint * ptr, GLuint count)
{
int i;
- fprintf(stderr, "\n\n\nSTART BATCH (%d dwords):\n", count / 4);
+ _mesa_printf("\n\n\nSTART BATCH (%d dwords):\n", count / 4);
for (i = 0; i < count / 4; i += 1)
- fprintf(stderr, "\t0x%08x\n",
- ptr[i]);
- fprintf(stderr, "END BATCH\n\n\n");
+ _mesa_printf("\t0x%08x\n", ptr[i]);
+ _mesa_printf("END BATCH\n\n\n");
}
void
ptr[r->offset / 4] = driBOOffset(r->buf) + r->delta;
}
- if (INTEL_DEBUG & DEBUG_BATCH)
+ if (0)
intel_dump_batchbuffer(0, ptr, used);
driBOUnmap(batch->buffer);
#include "state_tracker/st_cb_fbo.h"
-#define FILE_DEBUG_FLAG DEBUG_BLIT
-
/**
* Copy the back color buffer to the front color buffer.
* Used for SwapBuffers().
struct intel_context *intel;
const intelScreenPrivate *intelScreen;
- DBG("%s\n", __FUNCTION__);
+ DBG(SWAP, "%s\n", __FUNCTION__);
assert(dPriv);
ASSERT(backRegion);
ASSERT(backRegion->cpp == cpp);
- DBG("front pitch %d back pitch %d\n",
- pitch, backRegion->pitch);
+ DBG(SWAP, "front pitch %d back pitch %d\n",
+ pitch, backRegion->pitch);
if (cpp == 2) {
BR13 = (pitch * cpp) | (0xCC << 16) | (1 << 24);
if (box.y2 - box.y1 > backHeight)
box.y2 = backHeight + box.y1;
- DBG("box x1 x2 y1 y2 %d %d %d %d\n",
- box.x1, box.x2, box.y1, box.y2);
+ DBG(SWAP, "box x1 x2 y1 y2 %d %d %d %d\n",
+ box.x1, box.x2, box.y1, box.y2);
sbox.x1 = box.x1 - dPriv->x;
sbox.y1 = box.y1 - dPriv->y;
pf_active = pf_pipes && (pf_pipes & intel->sarea->pf_active) == pf_pipes;
- if (INTEL_DEBUG & DEBUG_LOCK)
- if (pf_active != intel_fb->pf_active)
- _mesa_printf("%s - Page flipping %sactive\n", __progname,
- pf_active ? "" : "in");
+ if (pf_active != intel_fb->pf_active)
+ DBG(LOCK, "%s - Page flipping %sactive\n",
+ __progname, pf_active ? "" : "in");
if (pf_active) {
/* Sync pages between pipes if we're flipping on both at the same time */
int ret;
struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
- if (INTEL_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s\n", __FUNCTION__);
+ DBG(SWAP, "%s\n", __FUNCTION__);
assert(dPriv);
assert(dPriv->driContextPriv);
intel_draw_buffer(&intel->ctx, &intel_fb->Base);
#endif
- if (INTEL_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s: success\n", __FUNCTION__);
+ DBG(SWAP, "%s: success\n", __FUNCTION__);
return GL_TRUE;
}
-#ifndef INTEL_DEBUG
-int INTEL_DEBUG = (0);
+#if DEBUG
+int __intel_debug = 0;
#endif
#define need_GL_ARB_multisample
static const struct dri_debug_control debug_control[] = {
- {"tex", DEBUG_TEXTURE},
- {"state", DEBUG_STATE},
{"ioctl", DEBUG_IOCTL},
- {"blit", DEBUG_BLIT},
- {"mip", DEBUG_MIPTREE},
- {"verb", DEBUG_VERBOSE},
{"bat", DEBUG_BATCH},
- {"pix", DEBUG_PIXEL},
- {"buf", DEBUG_BUFMGR},
- {"reg", DEBUG_REGION},
- {"fbo", DEBUG_FBO},
{"lock", DEBUG_LOCK},
+ {"swap", DEBUG_SWAP},
{NULL, 0}
};
_mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
}
-#if DO_DEBUG
- INTEL_DEBUG = driParseDebugString(getenv("INTEL_DEBUG"), debug_control);
+#if DEBUG
+ __intel_debug = driParseDebugString(getenv("INTEL_DEBUG"), debug_control);
#endif
/* This share group is about to go away, free our private
* texture object data.
*/
- if (INTEL_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "do something to free texture heaps\n");
}
/* free the Mesa context */
drmGetLock(intel->driFd, intel->hHWContext, flags);
- if (INTEL_DEBUG & DEBUG_LOCK)
- _mesa_printf("%s - got contended lock\n", __progname);
+ DBG(LOCK, "%s - got contended lock\n", __progname);
/* If the window moved, may need to set a new cliprect now.
*
if (__ret)
intelContendedLock( intel, 0 );
- if (INTEL_DEBUG & DEBUG_LOCK)
- _mesa_printf("%s - locked\n", __progname);
+ DBG(LOCK, "%s - locked\n", __progname);
intel->locked = 1;
}
_glthread_UNLOCK_MUTEX(lockMutex);
- if (INTEL_DEBUG & DEBUG_LOCK)
- _mesa_printf("%s - unlocked\n", __progname);
+ DBG(LOCK, "%s - unlocked\n", __progname);
}
/* ================================================================
* Debugging:
*/
-#define DO_DEBUG 0
-#if DO_DEBUG
-extern int INTEL_DEBUG;
+#if DEBUG
+extern int __intel_debug;
+
+#define DEBUG_SWAP 0x1
+#define DEBUG_LOCK 0x2
+#define DEBUG_IOCTL 0x4
+#define DEBUG_BATCH 0x8
+
+#define DBG(flag, ...) do { \
+ if (__intel_debug & (DEBUG_##flag)) \
+ _mesa_printf(__VA_ARGS__); \
+} while(0)
+
#else
-#define INTEL_DEBUG 0
+#define DBG(flag, ...)
#endif
-#define DEBUG_TEXTURE 0x1
-#define DEBUG_STATE 0x2
-#define DEBUG_IOCTL 0x4
-#define DEBUG_BLIT 0x8
-#define DEBUG_MIPTREE 0x10
-#define DEBUG_VERBOSE 0x40
-#define DEBUG_BATCH 0x80
-#define DEBUG_PIXEL 0x100
-#define DEBUG_BUFMGR 0x200
-#define DEBUG_REGION 0x400
-#define DEBUG_FBO 0x800
-#define DEBUG_LOCK 0x1000
-
-#define DBG(...) do { if (INTEL_DEBUG & FILE_DEBUG_FLAG) _mesa_printf(__VA_ARGS__); } while(0)
#define PCI_CHIP_845_G 0x2562
#include "intel_blit.h"
#include "drm.h"
-#define FILE_DEBUG_FLAG DEBUG_IOCTL
int
intelEmitIrqLocked(struct intel_context *intel)
exit(1);
}
- DBG("%s --> %d\n", __FUNCTION__, seq);
+ DBG(IOCTL, "%s --> %d\n", __FUNCTION__, seq);
return seq;
}
{
int ret;
- DBG("%s %d\n", __FUNCTION__, seq);
+ DBG(IOCTL, "%s %d\n", __FUNCTION__, seq);
intel->iw.irq_seq = seq;
assert(intel->locked);
assert(used);
- DBG("%s used %d offset %x..%x ignore_cliprects %d\n",
+ DBG(IOCTL, "%s used %d offset %x..%x ignore_cliprects %d\n",
__FUNCTION__,
used, start_offset, start_offset + used, ignore_cliprects);
batch.DR1 = 0;
batch.DR4 = 0; /* still need this ? */
- DBG("%s: 0x%x..0x%x DR4: %x cliprects: %d\n",
+ DBG(IOCTL, "%s: 0x%x..0x%x DR4: %x cliprects: %d\n",
__FUNCTION__,
batch.start,
batch.start + batch.used * 4, batch.DR4, batch.num_cliprects);