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);
}
bufmgr_ttm = (dri_bufmgr_ttm *)buf->bufmgr;
+ assert(buf->virtual != NULL);
+
buf->virtual = NULL;
return drmBOUnmap(bufmgr_ttm->fd, &ttm_buf->drm_bo);
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;
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;
}