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 <christian.koenig@amd.com>
Cc: 13.0 <mesa-stable@lists.freedesktop.org>
This commit is contained in:
Marek Olšák 2017-01-04 11:42:13 +01:00
parent dbba4e03b1
commit 89975e29d3
1 changed files with 5 additions and 2 deletions

View File

@ -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;