[Mesa-dev] [PATCH 2/2] va: call texture_get_handle while the mutex is being held
Alex Deucher
alexdeucher at gmail.com
Wed Jan 4 17:40:05 UTC 2017
On Wed, Jan 4, 2017 at 5:47 AM, Marek Olšák <maraeo at gmail.com> wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> The context may be used by texture_get_handle.
The the omx state tracker need this as well?
Alex
> ---
> src/gallium/state_trackers/va/buffer.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/state_trackers/va/buffer.c b/src/gallium/state_trackers/va/buffer.c
> index 3c9b9d1..93f012c 100644
> --- a/src/gallium/state_trackers/va/buffer.c
> +++ b/src/gallium/state_trackers/va/buffer.c
> @@ -290,29 +290,32 @@ vlVaAcquireBufferHandle(VADriverContextP ctx, VABufferID buf_id,
> return VA_STATUS_ERROR_INVALID_PARAMETER;
> } else {
> VABufferInfo * const buf_info = &buf->export_state;
>
> switch (mem_type) {
> case VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME: {
> struct winsys_handle whandle;
>
> 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;
> }
> default:
> return VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE;
> }
>
> buf_info->type = buf->type;
> buf_info->mem_type = mem_type;
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list