summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-09-20 11:38:32 -0700
committerEric Anholt <eric@anholt.net>2007-09-20 11:38:32 -0700
commit75912596741d1afe5827dab6913c3d810eda8788 (patch)
tree4fd10fe2e42f28f5ebb65f23421473350c70f795 /src/mesa/drivers
parentb7fd06a871893d8ed482d16207136e324bb7d85c (diff)
Add disabled-by-default tracing of TTM bufmgr operations.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/common/dri_bufmgr_ttm.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/common/dri_bufmgr_ttm.c b/src/mesa/drivers/dri/common/dri_bufmgr_ttm.c
index e264048b70..f864b1bc89 100644
--- a/src/mesa/drivers/dri/common/dri_bufmgr_ttm.c
+++ b/src/mesa/drivers/dri/common/dri_bufmgr_ttm.c
@@ -42,6 +42,8 @@
#include "string.h"
#include "imports.h"
+#define BUFMGR_DEBUG 0
+
typedef struct _dri_bufmgr_ttm {
dri_bufmgr bufmgr;
@@ -128,6 +130,10 @@ dri_ttm_alloc(dri_bufmgr *bufmgr, const char *name,
ttm_buf->name = name;
ttm_buf->refcount = 1;
+#if BUFMGR_DEBUG
+ fprintf(stderr, "bo_create: %p (%s)\n", &ttm_buf->bo, ttm_buf->name);
+#endif
+
return &ttm_buf->bo;
}
@@ -174,6 +180,11 @@ dri_ttm_bo_create_from_handle(dri_bufmgr *bufmgr, const char *name,
ttm_buf->name = name;
ttm_buf->refcount = 1;
+#if BUFMGR_DEBUG
+ fprintf(stderr, "bo_create_from_handle: %p (%s)\n", &ttm_buf->bo,
+ ttm_buf->name);
+#endif
+
return &ttm_buf->bo;
}
@@ -222,6 +233,10 @@ dri_ttm_bo_map(dri_bo *buf, GLboolean write_enable)
assert(buf->virtual == NULL);
+#if BUFMGR_DEBUG
+ fprintf(stderr, "bo_map: %p (%s)\n", &ttm_buf->bo, ttm_buf->name);
+#endif
+
return drmBOMap(bufmgr_ttm->fd, &ttm_buf->drm_bo, flags, 0, &buf->virtual);
}
@@ -240,6 +255,10 @@ dri_ttm_bo_unmap(dri_bo *buf)
buf->virtual = NULL;
+#if BUFMGR_DEBUG
+ fprintf(stderr, "bo_unmap: %p (%s)\n", &ttm_buf->bo, ttm_buf->name);
+#endif
+
return drmBOUnmap(bufmgr_ttm->fd, &ttm_buf->drm_bo);
}
@@ -275,6 +294,10 @@ dri_ttm_validate(dri_bo *buf, unsigned int flags)
buf->offset = ttm_buf->drm_bo.offset;
+#if BUFMGR_DEBUG
+ fprintf(stderr, "bo_validate: %p (%s)\n", &ttm_buf->bo, ttm_buf->name);
+#endif
+
return err;
}
@@ -305,6 +328,12 @@ dri_ttm_fence_validated(dri_bufmgr *bufmgr, const char *name,
free(fence_ttm);
return NULL;
}
+
+#if BUFMGR_DEBUG
+ fprintf(stderr, "fence_validated: %p (%s)\n", &fence_ttm->fence,
+ fence_ttm->name);
+#endif
+
return &fence_ttm->fence;
}
@@ -354,6 +383,11 @@ dri_ttm_fence_wait(dri_fence *fence)
__FILE__, __LINE__, ret, fence_ttm->name);
abort();
}
+
+#if BUFMGR_DEBUG
+ fprintf(stderr, "fence_wait: %p (%s)\n", &fence_ttm->fence,
+ fence_ttm->name);
+#endif
}
static void