diff options
author | Rob Clark <[email protected]> | 2014-09-16 19:10:23 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2014-09-21 15:35:53 -0400 |
commit | 18291ee17a36ea700108b85d679444efa262a312 (patch) | |
tree | 5457c46effa7992f647f7eff3598a1b073b40285 /src/gallium/drivers/freedreno/freedreno_screen.c | |
parent | 41f072a4f8fd3f3347789ee4186af0d4fcf69622 (diff) |
freedreno: add DRM_CONF_SHARE_FD
And config query and DRM_CONF_SHARE_FD to both mega-driver and
traditional build configs, so that EGL_EXT_image_dma_buf_import
works.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_screen.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_screen.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c index 6db75ad4681..4970fd29911 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.c +++ b/src/gallium/drivers/freedreno/freedreno_screen.c @@ -394,6 +394,8 @@ fd_screen_bo_get_handle(struct pipe_screen *pscreen, } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) { whandle->handle = fd_bo_handle(bo); return TRUE; + } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) { + whandle->handle = fd_bo_dmabuf(bo); } else { return FALSE; } @@ -407,12 +409,17 @@ 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) { + if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) { + bo = fd_bo_from_name(screen->dev, whandle->handle); + } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) { + bo = fd_bo_from_handle(screen->dev, whandle->handle, 0); + } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) { + bo = fd_bo_from_dmabuf(screen->dev, whandle->handle); + } else { 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); return NULL; |