summaryrefslogtreecommitdiff
path: root/libdrm/xf86mm.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas@tungstengraphics.com>2006-03-07 11:06:07 +0000
committerThomas Hellstrom <thomas@tungstengraphics.com>2006-03-07 11:06:07 +0000
commit99c3680c3e3fbbf45f2442053adefbc1b9578e1a (patch)
tree1f29056f35e4dab76c32b564c9f001a1e075763c /libdrm/xf86mm.c
parente70e553bc5cd5f9279989227c179684b8c532a1f (diff)
libdrm: Wait for fence before mapping a buffer. ttm: Remove some leftover
debugging output.
Diffstat (limited to 'libdrm/xf86mm.c')
-rw-r--r--libdrm/xf86mm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libdrm/xf86mm.c b/libdrm/xf86mm.c
index adb3be89..f5c14e63 100644
--- a/libdrm/xf86mm.c
+++ b/libdrm/xf86mm.c
@@ -455,6 +455,16 @@ drmMMMapBuffer(int drmFD, drmMMBuf * buf)
int ret;
drmAddress *addr;
+ if (buf->block && buf->block->fenced) {
+ ret = -EINTR;
+ while(ret == -EINTR) {
+ ret = drmWaitFence(drmFD, buf->block->fence);
+ }
+ if (ret) {
+ return NULL;
+ }
+ }
+
if (buf->flags & DRM_MM_SHARED)
return buf->virtual;