#include "string.h"
#include "imports.h"
+#define BUFMGR_DEBUG 0
+
typedef struct _dri_bufmgr_ttm {
dri_bufmgr bufmgr;
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;
}
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;
}
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);
}
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);
}
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;
}
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;
}
__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