Commit 1df7a826 authored by Eric Anholt's avatar Eric Anholt

[i915] Make INTEL_DEBUG=bufmgr actually do things for bufmgr_fake.

parent 61fbc816
......@@ -202,6 +202,7 @@ dri_bufmgr *dri_bufmgr_fake_init(unsigned long low_offset, void *low_virtual,
int (*fence_wait)(void *private,
unsigned int cookie),
void *driver_priv);
void dri_bufmgr_fake_set_debug(dri_bufmgr *bufmgr, GLboolean enable_debug);
void dri_bufmgr_destroy(dri_bufmgr *bufmgr);
dri_bo *dri_ttm_bo_create_from_handle(dri_bufmgr *bufmgr, const char *name,
unsigned int handle);
......
......@@ -41,11 +41,10 @@
#include "mm.h"
#include "imports.h"
#if 0
#define DBG(...) _mesa_printf(__VA_ARGS__)
#else
#define DBG(...)
#endif
#define DBG(...) do { \
if (bufmgr_fake->debug) \
_mesa_printf(__VA_ARGS__); \
} while (0)
/* Internal flags:
*/
......@@ -129,6 +128,7 @@ typedef struct _bufmgr_fake {
/** Driver-supplied argument to driver callbacks */
void *driver_priv;
GLboolean debug;
/** fake relocation list */
struct fake_buffer_reloc reloc[MAX_RELOCS];
......@@ -778,10 +778,10 @@ dri_fake_bo_validate(dri_bo *bo, unsigned int flags)
/* XXX: Sanity-check whether we've already validated this one under
* different flags. See drmAddValidateItem().
*/
bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr;
DBG("drm_bo_validate: (buf %d: %s, %d kb)\n", bo_fake->id, bo_fake->name,
bo_fake->bo.size / 1024);
bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr;
_glthread_LOCK_MUTEX(bufmgr_fake->mutex);
{
......@@ -1097,6 +1097,14 @@ dri_fake_post_submit(dri_bo *batch_buf, dri_fence **last_fence)
bufmgr_fake->nr_relocs = 0;
}
void
dri_bufmgr_fake_set_debug(dri_bufmgr *bufmgr, GLboolean enable_debug)
{
dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bufmgr;
bufmgr_fake->debug = enable_debug;
}
dri_bufmgr *
dri_bufmgr_fake_init(unsigned long low_offset, void *low_virtual,
unsigned long size,
......
......@@ -460,6 +460,8 @@ intelInitContext(struct intel_context *intel,
#if DO_DEBUG
INTEL_DEBUG = driParseDebugString(getenv("INTEL_DEBUG"), debug_control);
if (!intel->intelScreen->ttm && (INTEL_DEBUG & DEBUG_BUFMGR))
dri_bufmgr_fake_set_debug(intel->intelScreen->bufmgr, GL_TRUE);
#endif
if (getenv("INTEL_NO_RAST")) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment