summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/nouveau
diff options
context:
space:
mode:
authorBen Skeggs <darktama@iinet.net.au>2006-12-27 15:50:59 +1100
committerBen Skeggs <darktama@iinet.net.au>2006-12-27 23:53:25 +1100
commit885a7cc38d80366396f463a54ef4af00c9fd07ff (patch)
tree6bd8ac7feeaa9e0456e28a252db4f3b718014d9b /src/mesa/drivers/dri/nouveau
parent2dd37534506e85351fb114c79fd6c994a9c355c0 (diff)
nouveau: add nouveau_mem_alloc/free debugging
Diffstat (limited to 'src/mesa/drivers/dri/nouveau')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_buffers.c15
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_context.c5
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_context.h3
3 files changed, 20 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_buffers.c b/src/mesa/drivers/dri/nouveau/nouveau_buffers.c
index e628dd5b3c..b54f68f402 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_buffers.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_buffers.c
@@ -71,6 +71,11 @@ nouveau_mem_free(GLcontext *ctx, nouveau_mem *mem)
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
drm_nouveau_mem_free_t memf;
+ if (NOUVEAU_DEBUG & DEBUG_MEM) {
+ fprintf(stderr, "%s: type=0x%x, offset=0x%x, size=0x%x\n",
+ __func__, mem->type, (GLuint)mem->offset, (GLuint)mem->size);
+ }
+
if (mem->map)
drmUnmap(mem->map, mem->size);
memf.flags = mem->type;
@@ -87,6 +92,11 @@ nouveau_mem_alloc(GLcontext *ctx, int type, GLuint size, GLuint align)
nouveau_mem *mem;
int ret;
+ if (NOUVEAU_DEBUG & DEBUG_MEM) {
+ fprintf(stderr, "%s: requested: type=0x%x, size=0x%x, align=0x%x\n",
+ __func__, type, (GLuint)size, align);
+ }
+
mem = CALLOC(sizeof(nouveau_mem));
if (!mem)
return NULL;
@@ -104,6 +114,11 @@ nouveau_mem_alloc(GLcontext *ctx, int type, GLuint size, GLuint align)
mem->offset = mema.region_offset;
mem->type = mema.flags;
+ if (NOUVEAU_DEBUG & DEBUG_MEM) {
+ fprintf(stderr, "%s: actual: type=0x%x, offset=0x%x, size=0x%x\n",
+ __func__, mem->type, (GLuint)mem->offset, (GLuint)mem->size);
+ }
+
if (type & NOUVEAU_MEM_MAPPED)
ret = drmMap(nmesa->driFd, mem->offset, mem->size, &mem->map);
if (ret) {
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
index 3718900b62..bb67f72f4a 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
@@ -63,8 +63,9 @@ int NOUVEAU_DEBUG = 0;
static const struct dri_debug_control debug_control[] =
{
- { "shaders", DEBUG_SHADERS },
- { NULL, 0 }
+ { "shaders" , DEBUG_SHADERS },
+ { "mem" , DEBUG_MEM },
+ { NULL , 0 }
};
#define need_GL_ARB_vertex_program
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h
index 0efbcce129..b0952070c7 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h
@@ -216,7 +216,8 @@ extern void nouveauCopySubBuffer(__DRIdrawablePrivate *dPriv,
/* Debugging utils: */
extern int NOUVEAU_DEBUG;
-#define DEBUG_SHADERS 0x00000001
+#define DEBUG_SHADERS 0x00000001
+#define DEBUG_MEM 0x00000002
#endif /* __NOUVEAU_CONTEXT_H__ */