summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nouveau_screen.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <[email protected]>2013-11-21 15:11:42 +1100
committerMaarten Lankhorst <[email protected]>2013-12-10 09:46:17 +0100
commit3e680de1eb22db6afed58c1ac72ec31504538057 (patch)
tree9c50c9b61eeba24551cebaa44ce98dfbec55d269 /src/gallium/drivers/nouveau/nouveau_screen.c
parentdf3b20b2cf4ee6abb07d2948259d7500681f8c41 (diff)
nouveau: Support DRI Image 7 extension
Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Christopher James Halse Rogers <[email protected]> Signed-off-by: Maarten Lankhorst <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nouveau_screen.c')
-rw-r--r--src/gallium/drivers/nouveau/nouveau_screen.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c
index 248d1641c5a..21b31e04f0a 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -86,13 +86,18 @@ nouveau_screen_bo_from_handle(struct pipe_screen *pscreen,
struct nouveau_bo *bo = 0;
int ret;
- if (whandle->type != DRM_API_HANDLE_TYPE_SHARED) {
+ if (whandle->type != DRM_API_HANDLE_TYPE_SHARED &&
+ whandle->type != DRM_API_HANDLE_TYPE_FD) {
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 (whandle->type == DRM_API_HANDLE_TYPE_SHARED)
+ ret = nouveau_bo_name_ref(dev, whandle->handle, &bo);
+ else
+ ret = nouveau_bo_prime_handle_ref(dev, whandle->handle, &bo);
+
if (ret) {
debug_printf("%s: ref name 0x%08x failed with %d\n",
__FUNCTION__, whandle->handle, ret);
@@ -117,6 +122,8 @@ nouveau_screen_bo_get_handle(struct pipe_screen *pscreen,
} else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {
whandle->handle = bo->handle;
return TRUE;
+ } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+ return nouveau_bo_set_prime(bo, &whandle->handle) == 0;
} else {
return FALSE;
}