summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorChristopher James Halse Rogers <raof@ubuntu.com>2013-11-21 15:11:39 +1100
committerMaarten Lankhorst <maarten.lankhorst@canonical.com>2013-12-10 09:46:05 +0100
commitd5a3a2d2fbc42da04ff7ea09356ada134a42d6dd (patch)
tree78713128416960253fd27072b8197f598e91dd13 /src/gallium/winsys
parent343133167f4ae127a375791790c982bde12025c4 (diff)
downloadexternal_mesa3d-d5a3a2d2fbc42da04ff7ea09356ada134a42d6dd.zip
external_mesa3d-d5a3a2d2fbc42da04ff7ea09356ada134a42d6dd.tar.gz
external_mesa3d-d5a3a2d2fbc42da04ff7ea09356ada134a42d6dd.tar.bz2
gallium/winsys/drm: Prepare for passing prime fds in winsys_handle
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
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 ac66af3..38e0619 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 3019a52..744df1b 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 511cca7..6323a8a 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.