[Mesa-dev] [PATCH] st/va: it is valid to release the VABuffer of an exported resource
Christian König
deathsimple at vodafone.de
Wed Jun 8 08:22:54 UTC 2016
Am 02.06.2016 um 16:03 schrieb Julien Isorce:
> Signed-off-by: Julien Isorce <j.isorce at samsung.com>
Actually I'm not sure if that is correct.
If you release the VABuffer of an exported resource you won't be able to
properly close the handle with vlVaReleaseBufferHandle().
On the other hand the semantic VA requires for vlVaAcquireBufferHandle()
and vlVaReleaseBufferHandle() is complete nonsense for DMA-buf handles.
Christian.
> ---
> src/gallium/state_trackers/va/buffer.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/src/gallium/state_trackers/va/buffer.c b/src/gallium/state_trackers/va/buffer.c
> index 2fd8661..7d3167b 100644
> --- a/src/gallium/state_trackers/va/buffer.c
> +++ b/src/gallium/state_trackers/va/buffer.c
> @@ -192,14 +192,8 @@ vlVaDestroyBuffer(VADriverContextP ctx, VABufferID buf_id)
> return VA_STATUS_ERROR_INVALID_BUFFER;
> }
>
> - if (buf->derived_surface.resource) {
> - if (buf->export_refcount > 0) {
> - pipe_mutex_unlock(drv->mutex);
> - return VA_STATUS_ERROR_INVALID_BUFFER;
> - }
> -
> + if (buf->derived_surface.resource)
> pipe_resource_reference(&buf->derived_surface.resource, NULL);
> - }
>
> FREE(buf->data);
> FREE(buf);
More information about the mesa-dev
mailing list