summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/dri/dri2.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-08-21 12:24:59 +0200
committerMarek Olšák <[email protected]>2016-08-25 14:09:48 +0200
commit9daaa6f5a66ab6cc99c6f0af37fc1007ab3d09af (patch)
tree47e62319d0ddea75f93bccf52305133e2e0be5f3 /src/gallium/state_trackers/dri/dri2.c
parentb662c70aeab6a92751514f30719c13a6de253b40 (diff)
gallium: add a pipe_context parameter to resource_get_handle
radeonsi needs to do some operations (DCC decompression) for OpenGL-OpenCL interop and this is the only way to make it coherent with the current context. It can optionally be set to NULL. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/dri/dri2.c')
-rw-r--r--src/gallium/state_trackers/dri/dri2.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index 9803b0e1971..f391c77b657 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -404,7 +404,7 @@ dri2_allocate_buffer(__DRIscreen *sPriv,
else
whandle.type = DRM_API_HANDLE_TYPE_KMS;
- screen->base.screen->resource_get_handle(screen->base.screen,
+ screen->base.screen->resource_get_handle(screen->base.screen, NULL,
buffer->resource, &whandle,
PIPE_HANDLE_USAGE_EXPLICIT_FLUSH | PIPE_HANDLE_USAGE_READ);
@@ -963,25 +963,25 @@ dri2_query_image(__DRIimage *image, int attrib, int *value)
case __DRI_IMAGE_ATTRIB_STRIDE:
whandle.type = DRM_API_HANDLE_TYPE_KMS;
image->texture->screen->resource_get_handle(image->texture->screen,
- image->texture, &whandle, usage);
+ NULL, image->texture, &whandle, usage);
*value = whandle.stride;
return GL_TRUE;
case __DRI_IMAGE_ATTRIB_HANDLE:
whandle.type = DRM_API_HANDLE_TYPE_KMS;
image->texture->screen->resource_get_handle(image->texture->screen,
- image->texture, &whandle, usage);
+ NULL, image->texture, &whandle, usage);
*value = whandle.handle;
return GL_TRUE;
case __DRI_IMAGE_ATTRIB_NAME:
whandle.type = DRM_API_HANDLE_TYPE_SHARED;
image->texture->screen->resource_get_handle(image->texture->screen,
- image->texture, &whandle, usage);
+ NULL, image->texture, &whandle, usage);
*value = whandle.handle;
return GL_TRUE;
case __DRI_IMAGE_ATTRIB_FD:
whandle.type= DRM_API_HANDLE_TYPE_FD;
image->texture->screen->resource_get_handle(image->texture->screen,
- image->texture, &whandle, usage);
+ NULL, image->texture, &whandle, usage);
*value = whandle.handle;
return GL_TRUE;
case __DRI_IMAGE_ATTRIB_FORMAT:
@@ -1720,7 +1720,8 @@ dri2_interop_export_object(__DRIcontext *_ctx,
memset(&whandle, 0, sizeof(whandle));
whandle.type = DRM_API_HANDLE_TYPE_FD;
- success = screen->resource_get_handle(screen, res, &whandle, usage);
+ success = screen->resource_get_handle(screen, st->pipe, res, &whandle,
+ usage);
mtx_unlock(&ctx->Shared->Mutex);
if (!success)