summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/winsys/i915/drm
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2016-12-11 08:40:05 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2016-12-11 08:40:05 +0000
commit21ab4c9f31674b113c24177398ed39f29b7cd8e6 (patch)
tree8be392d7a792d9663c2586396be77bfd506f5164 /lib/mesa/src/gallium/winsys/i915/drm
parenta8f0a7916e26e550dd2a26e7188835c481978004 (diff)
Import Mesa 13.0.2
Diffstat (limited to 'lib/mesa/src/gallium/winsys/i915/drm')
-rw-r--r--lib/mesa/src/gallium/winsys/i915/drm/i915_drm_buffer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/mesa/src/gallium/winsys/i915/drm/i915_drm_buffer.c b/lib/mesa/src/gallium/winsys/i915/drm/i915_drm_buffer.c
index c0698529e..890f7dc28 100644
--- a/lib/mesa/src/gallium/winsys/i915/drm/i915_drm_buffer.c
+++ b/lib/mesa/src/gallium/winsys/i915/drm/i915_drm_buffer.c
@@ -101,6 +101,9 @@ i915_drm_buffer_from_handle(struct i915_winsys *iws,
if ((whandle->type != DRM_API_HANDLE_TYPE_SHARED) && (whandle->type != DRM_API_HANDLE_TYPE_FD))
return NULL;
+ if (whandle->offset != 0)
+ return NULL;
+
buf = CALLOC_STRUCT(i915_drm_buffer);
if (!buf)
return NULL;
@@ -150,6 +153,12 @@ i915_drm_buffer_get_handle(struct i915_winsys *iws,
whandle->handle = buf->flink;
} else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {
whandle->handle = buf->bo->handle;
+ } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+ int fd;
+
+ if (drm_intel_bo_gem_export_to_prime(buf->bo, &fd))
+ return FALSE;
+ whandle->handle = fd;
} else {
assert(!"unknown usage");
return FALSE;