-Original Message-
From: Christian König [mailto:deathsim...@vodafone.de]
Sent: 29 October 2015 12:29
To: Julien Isorce; mesa-dev@lists.freedesktop.org
Subject: Re: [Mesa-dev] [PATCH 2/2] st/va: add support to export a surface as
dmabuf
> @@ -108,6 +109,9 @@ vlVaMapBuf
@@ -108,6 +109,9 @@ vlVaMapBuffer(VADriverContextP ctx, VABufferID buf_id, void
**pbuff)
if (!buf)
return VA_STATUS_ERROR_INVALID_BUFFER;
+ if (buf->export_refcount > 0)
+ return VA_STATUS_ERROR_INVALID_BUFFER;
Why it is illegal to CPU map a buffer which is exported?
+
I.e. implements:
VaAcquireBufferHandle
VaReleaseBufferHandle
for memory of type VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME
And apply relatives change to:
vlVaMapBuffer
vlVaUnMapBuffer
vlVaDestroyBuffer
Implementation inspired from cgit.freedesktop.org/vaapi/intel-driver
Tested with gstreamer-vaapi wit