summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-01-04 11:42:13 +0100
committerMarek Olšák <[email protected]>2017-01-04 17:27:41 +0100
commit89975e29d33d93021a303b2b41b56de65e854843 (patch)
tree137e20ada7777e6714db73181ad1cb86aa61ebf9 /src/gallium/state_trackers/va
parentdbba4e03b16b80bf4071016b8197369ccb20c72b (diff)
va: call texture_get_handle while the mutex is being held
The context may be used by texture_get_handle. Reviewed-by: Christian König <[email protected]> Cc: 13.0 <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/va')
-rw-r--r--src/gallium/state_trackers/va/buffer.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/va/buffer.c b/src/gallium/state_trackers/va/buffer.c
index 3c9b9d1a1e5..93f012c830f 100644
--- a/src/gallium/state_trackers/va/buffer.c
+++ b/src/gallium/state_trackers/va/buffer.c
@@ -297,15 +297,18 @@ vlVaAcquireBufferHandle(VADriverContextP ctx, VABufferID buf_id,
pipe_mutex_lock(drv->mutex);
drv->pipe->flush(drv->pipe, NULL, 0);
- pipe_mutex_unlock(drv->mutex);
memset(&whandle, 0, sizeof(whandle));
whandle.type = DRM_API_HANDLE_TYPE_FD;
if (!screen->resource_get_handle(screen, drv->pipe,
buf->derived_surface.resource,
- &whandle, PIPE_HANDLE_USAGE_READ_WRITE))
+ &whandle, PIPE_HANDLE_USAGE_READ_WRITE)) {
+ pipe_mutex_unlock(drv->mutex);
return VA_STATUS_ERROR_INVALID_BUFFER;
+ }
+
+ pipe_mutex_unlock(drv->mutex);
buf_info->handle = (intptr_t)whandle.handle;
break;