summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorChristopher James Halse Rogers <[email protected]>2013-11-21 15:11:39 +1100
committerMaarten Lankhorst <[email protected]>2013-12-10 09:46:05 +0100
commitd5a3a2d2fbc42da04ff7ea09356ada134a42d6dd (patch)
tree78713128416960253fd27072b8197f598e91dd13 /src/gallium/drivers
parent343133167f4ae127a375791790c982bde12025c4 (diff)
gallium/winsys/drm: Prepare for passing prime fds in winsys_handle
Signed-off-by: Christopher James Halse Rogers <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Maarten Lankhorst <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_screen.c5
-rw-r--r--src/gallium/drivers/nouveau/nouveau_screen.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c
index d07cc0b323e..319e29f3ada 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -361,6 +361,11 @@ fd_screen_bo_from_handle(struct pipe_screen *pscreen,
struct fd_screen *screen = fd_screen(pscreen);
struct fd_bo *bo;
+ if (whandle->type != DRM_API_HANDLE_TYPE_SHARED) {
+ DBG("Attempt to import unsupported handle type %d", whandle->type);
+ return NULL;
+ }
+
bo = fd_bo_from_name(screen->dev, whandle->handle);
if (!bo) {
DBG("ref name 0x%08x failed", whandle->handle);
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c
index 5b35ee47c12..248d1641c5a 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -86,6 +86,12 @@ nouveau_screen_bo_from_handle(struct pipe_screen *pscreen,
struct nouveau_bo *bo = 0;
int ret;
+ if (whandle->type != DRM_API_HANDLE_TYPE_SHARED) {
+ debug_printf("%s: attempt to import unsupported handle type %d\n",
+ __FUNCTION__, whandle->type);
+ return NULL;
+ }
+
ret = nouveau_bo_name_ref(dev, whandle->handle, &bo);
if (ret) {
debug_printf("%s: ref name 0x%08x failed with %d\n",