summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/i915/drm/i915_drm_buffer.c6
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_bo.c6
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen_dri.c6
3 files changed, 17 insertions, 1 deletions
diff --git a/src/gallium/winsys/i915/drm/i915_drm_buffer.c b/src/gallium/winsys/i915/drm/i915_drm_buffer.c
index ac66af333df..38e06193c61 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_buffer.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_buffer.c
@@ -95,9 +95,13 @@ i915_drm_buffer_from_handle(struct i915_winsys *iws,
unsigned *stride)
{
struct i915_drm_winsys *idws = i915_drm_winsys(iws);
- struct i915_drm_buffer *buf = CALLOC_STRUCT(i915_drm_buffer);
+ struct i915_drm_buffer *buf;
uint32_t tile = 0, swizzle = 0;
+ if (whandle->type != DRM_API_HANDLE_TYPE_SHARED)
+ return NULL;
+
+ buf = CALLOC_STRUCT(i915_drm_buffer);
if (!buf)
return NULL;
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index 3019a525cf8..744df1b745e 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@ -877,6 +877,9 @@ static struct pb_buffer *radeon_winsys_bo_from_handle(struct radeon_winsys *rws,
memset(&open_arg, 0, sizeof(open_arg));
+ if (whandle->type != DRM_API_HANDLE_TYPE_SHARED)
+ return NULL;
+
/* We must maintain a list of pairs <handle, bo>, so that we always return
* the same BO for one particular handle. If we didn't do that and created
* more than one BO for the same handle and then relocated them in a CS,
@@ -991,6 +994,9 @@ static boolean radeon_winsys_bo_get_handle(struct pb_buffer *buffer,
whandle->handle = bo->flink;
} else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {
whandle->handle = bo->handle;
+ } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+ /* TODO: Implement */
+ return FALSE;
}
whandle->stride = stride;
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_dri.c b/src/gallium/winsys/svga/drm/vmw_screen_dri.c
index 511cca73aea..6323a8ae2c4 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen_dri.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen_dri.c
@@ -163,6 +163,12 @@ vmw_drm_surface_from_handle(struct svga_winsys_screen *sws,
int ret;
int i;
+ if (whandle->type != DRM_API_HANDLE_TYPE_SHARED) {
+ vmw_error("Attempt to import unknown handle type %d\n",
+ whandle->type);
+ return NULL;
+ }
+
/**
* The vmware device specific handle is the hardware SID.
* FIXME: We probably want to move this to the ioctl implementations.