aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/common/dri_bufmgr_ttm.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2007-09-18 15:46:16 -0700
committerEric Anholt <[email protected]>2007-09-18 15:46:16 -0700
commite3745dac59602a9d21b49d602646de5aef95075f (patch)
tree7688c93df0aab4bf8d2371de31d22c7ae6fbbcb4 /src/mesa/drivers/dri/common/dri_bufmgr_ttm.c
parent3e168a0ec840af65863e197f4a884aae905b213e (diff)
Add some error reporting and a couple of assertions to TTM bufmgr.
Diffstat (limited to 'src/mesa/drivers/dri/common/dri_bufmgr_ttm.c')
-rw-r--r--src/mesa/drivers/dri/common/dri_bufmgr_ttm.c8
1 files changed, 8 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 5128d953706..8c36502b855 100644
--- a/src/mesa/drivers/dri/common/dri_bufmgr_ttm.c
+++ b/src/mesa/drivers/dri/common/dri_bufmgr_ttm.c
@@ -220,6 +220,8 @@ dri_ttm_bo_map(dri_bo *buf, GLboolean write_enable)
if (write_enable)
flags |= DRM_BO_FLAG_WRITE;
+ assert(buf->virtual == NULL);
+
return drmBOMap(bufmgr_ttm->fd, &ttm_buf->drm_bo, flags, 0, &buf->virtual);
}
@@ -234,6 +236,8 @@ dri_ttm_bo_unmap(dri_bo *buf)
bufmgr_ttm = (dri_bufmgr_ttm *)buf->bufmgr;
+ assert(buf->virtual != NULL);
+
buf->virtual = NULL;
return drmBOUnmap(bufmgr_ttm->fd, &ttm_buf->drm_bo);
@@ -264,6 +268,9 @@ dri_ttm_validate(dri_bo *buf, unsigned int flags)
if (err == 0) {
/* XXX: add to fence list for sanity checking */
+ } else {
+ fprintf(stderr, "failed to validate buffer (%s): %s\n",
+ ttm_buf->name, strerror(err));
}
buf->offset = ttm_buf->drm_bo.offset;
@@ -294,6 +301,7 @@ dri_ttm_fence_validated(dri_bufmgr *bufmgr, const char *name,
fence_ttm->fence.bufmgr = bufmgr;
ret = drmFenceBuffers(bufmgr_ttm->fd, type, &fence_ttm->drm_fence);
if (ret) {
+ fprintf(stderr, "failed to fence (%s): %s\n", name, strerror(ret));
free(fence_ttm);
return NULL;
}