[Mesa-dev] [PATCH 1/9] st/va: make the implementation thread save

Emil Velikov emil.l.velikov at gmail.com
Fri Dec 18 06:30:45 PST 2015


Hi Christian,

An alternative solution would be to refcount on handle_table_get/put
(first we need the latter even :-P) although I think that route will
be longer (i.e. larger patch). Just thinking out loud, than a
suggestion really.

On 16 December 2015 at 20:14, Christian König <deathsimple at vodafone.de> wrote:

> @@ -165,18 +178,25 @@ vlVaUnmapBuffer(VADriverContextP ctx, VABufferID buf_id)
>  VAStatus
>  vlVaDestroyBuffer(VADriverContextP ctx, VABufferID buf_id)
>  {
> +   vlVaDriver *drv;
>     vlVaBuffer *buf;
>
>     if (!ctx)
>        return VA_STATUS_ERROR_INVALID_CONTEXT;
>
> +   drv = VL_VA_DRIVER(ctx);
> +   pipe_mutex_lock(drv->mutex);
>     buf = handle_table_get(VL_VA_DRIVER(ctx)->htab, buf_id);
Reuse drv ?


> @@ -227,7 +252,12 @@ vlVaAcquireBufferHandle(VADriverContextP ctx, VABufferID buf_id,
>     if (!ctx)
>        return VA_STATUS_ERROR_INVALID_CONTEXT;
>
> +   drv = VL_VA_DRIVER(ctx);
> +   screen = VL_VA_PSCREEN(ctx);
> +   pipe_mutex_lock(drv->mutex);
> +   drv->pipe->flush(drv->pipe, NULL, 0);
>     buf = handle_table_get(VL_VA_DRIVER(ctx)->htab, buf_id);
> +   pipe_mutex_unlock(drv->mutex);
>
Let's not bury the flush() movement in this patch.

-Emil


More information about the mesa-dev mailing list