summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}