st/va: Enable vaExportSurfaceHandle()

Submitted by Mark Thompson on Dec. 1, 2017, 12:31 a.m.

Details

Message ID ae2a468d-eb28-f1e3-7a4a-412c68d73ca9@jkqxz.net
State Accepted
Series "st/va: Enable vaExportSurfaceHandle()"
Commit 768f1487b0c084507ba5e2641e0bbf4ec789ec85
Headers show

Commit Message

Mark Thompson Dec. 1, 2017, 12:31 a.m.
It will be present from libva 2.1 (VAAPI 1.1.0 or higher).

Signed-off-by: Mark Thompson <sw@jkqxz.net>
---
See:
<https://github.com/01org/libva/commit/fcb9cc881596d7ff809adf5f6ff631c708d407e3>
<https://github.com/01org/libva/commit/51e98b1224794a44ba097baa7a1b4e35c3596d0c>

Also enabled in mpv:
<https://github.com/mpv-player/mpv/commit/2cf58362932be56645b16942ef3985eb2d0af65f>

There are some other driver functions added in this new version:
* MFContext (multi-frame) stuff exists for lock-step processing of multiple streams.  As far as I can tell, it is only of value for server transcode setups, and probably has little benefit when encode is already asynchronous (which it isn't in the Intel driver).
* CreateBuffer2 is for passing 2D buffers to/from the driver.  Nothing uses it yet.
* QueryProcessingRate is for querying expected performance.  It might be sensible to implement, but would need more hardware information than I have to make the necessary tables.
All of them are left as NULL.

Thanks,

- Mark


 src/gallium/state_trackers/va/context.c | 8 +++++++-
 src/gallium/state_trackers/va/surface.c | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
index 78e1f19ab7..c4abe77cf7 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -89,7 +89,13 @@  static struct VADriverVTable vtable =
    &vlVaQuerySurfaceAttributes,
    &vlVaAcquireBufferHandle,
    &vlVaReleaseBufferHandle,
-#if 0
+#if VA_CHECK_VERSION(1, 1, 0)
+   NULL, /* vaCreateMFContext */
+   NULL, /* vaMFAddContext */
+   NULL, /* vaMFReleaseContext */
+   NULL, /* vaMFSubmit */
+   NULL, /* vaCreateBuffer2 */
+   NULL, /* vaQueryProcessingRate */
    &vlVaExportSurfaceHandle,
 #endif
 };
diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c
index 636505b720..f9412ce52e 100644
--- a/src/gallium/state_trackers/va/surface.c
+++ b/src/gallium/state_trackers/va/surface.c
@@ -923,7 +923,7 @@  vlVaQueryVideoProcPipelineCaps(VADriverContextP ctx, VAContextID context,
    return VA_STATUS_SUCCESS;
 }
 
-#if 0
+#if VA_CHECK_VERSION(1, 1, 0)
 VAStatus
 vlVaExportSurfaceHandle(VADriverContextP ctx,
                         VASurfaceID surface_id,

Comments

Christian König Dec. 1, 2017, 8:28 a.m.
Am 01.12.2017 um 01:31 schrieb Mark Thompson:
> It will be present from libva 2.1 (VAAPI 1.1.0 or higher).
>
> Signed-off-by: Mark Thompson <sw@jkqxz.net>

Acked-by: Christian König <christian.koenig@amd.com>

> ---
> See:
> <https://github.com/01org/libva/commit/fcb9cc881596d7ff809adf5f6ff631c708d407e3>
> <https://github.com/01org/libva/commit/51e98b1224794a44ba097baa7a1b4e35c3596d0c>
>
> Also enabled in mpv:
> <https://github.com/mpv-player/mpv/commit/2cf58362932be56645b16942ef3985eb2d0af65f>
>
> There are some other driver functions added in this new version:
> * MFContext (multi-frame) stuff exists for lock-step processing of multiple streams.  As far as I can tell, it is only of value for server transcode setups, and probably has little benefit when encode is already asynchronous (which it isn't in the Intel driver).
> * CreateBuffer2 is for passing 2D buffers to/from the driver.  Nothing uses it yet.
> * QueryProcessingRate is for querying expected performance.  It might be sensible to implement, but would need more hardware information than I have to make the necessary tables.
> All of them are left as NULL.
>
> Thanks,
>
> - Mark
>
>
>   src/gallium/state_trackers/va/context.c | 8 +++++++-
>   src/gallium/state_trackers/va/surface.c | 2 +-
>   2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
> index 78e1f19ab7..c4abe77cf7 100644
> --- a/src/gallium/state_trackers/va/context.c
> +++ b/src/gallium/state_trackers/va/context.c
> @@ -89,7 +89,13 @@ static struct VADriverVTable vtable =
>      &vlVaQuerySurfaceAttributes,
>      &vlVaAcquireBufferHandle,
>      &vlVaReleaseBufferHandle,
> -#if 0
> +#if VA_CHECK_VERSION(1, 1, 0)
> +   NULL, /* vaCreateMFContext */
> +   NULL, /* vaMFAddContext */
> +   NULL, /* vaMFReleaseContext */
> +   NULL, /* vaMFSubmit */
> +   NULL, /* vaCreateBuffer2 */
> +   NULL, /* vaQueryProcessingRate */
>      &vlVaExportSurfaceHandle,
>   #endif
>   };
> diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c
> index 636505b720..f9412ce52e 100644
> --- a/src/gallium/state_trackers/va/surface.c
> +++ b/src/gallium/state_trackers/va/surface.c
> @@ -923,7 +923,7 @@ vlVaQueryVideoProcPipelineCaps(VADriverContextP ctx, VAContextID context,
>      return VA_STATUS_SUCCESS;
>   }
>   
> -#if 0
> +#if VA_CHECK_VERSION(1, 1, 0)
>   VAStatus
>   vlVaExportSurfaceHandle(VADriverContextP ctx,
>                           VASurfaceID surface_id,
Eric Engestrom Dec. 1, 2017, 1:25 p.m.
On Friday, 2017-12-01 00:31:48 +0000, Mark Thompson wrote:
> It will be present from libva 2.1 (VAAPI 1.1.0 or higher).
> 
> Signed-off-by: Mark Thompson <sw@jkqxz.net>
> ---
> See:
> <https://github.com/01org/libva/commit/fcb9cc881596d7ff809adf5f6ff631c708d407e3>
> <https://github.com/01org/libva/commit/51e98b1224794a44ba097baa7a1b4e35c3596d0c>
> 
> Also enabled in mpv:
> <https://github.com/mpv-player/mpv/commit/2cf58362932be56645b16942ef3985eb2d0af65f>
> 
> There are some other driver functions added in this new version:
> * MFContext (multi-frame) stuff exists for lock-step processing of multiple streams.  As far as I can tell, it is only of value for server transcode setups, and probably has little benefit when encode is already asynchronous (which it isn't in the Intel driver).
> * CreateBuffer2 is for passing 2D buffers to/from the driver.  Nothing uses it yet.
> * QueryProcessingRate is for querying expected performance.  It might be sensible to implement, but would need more hardware information than I have to make the necessary tables.
> All of them are left as NULL.
> 
> Thanks,
> 
> - Mark
> 
> 
>  src/gallium/state_trackers/va/context.c | 8 +++++++-
>  src/gallium/state_trackers/va/surface.c | 2 +-
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
> index 78e1f19ab7..c4abe77cf7 100644
> --- a/src/gallium/state_trackers/va/context.c
> +++ b/src/gallium/state_trackers/va/context.c
> @@ -89,7 +89,13 @@ static struct VADriverVTable vtable =
>     &vlVaQuerySurfaceAttributes,
>     &vlVaAcquireBufferHandle,
>     &vlVaReleaseBufferHandle,
> -#if 0
> +#if VA_CHECK_VERSION(1, 1, 0)
> +   NULL, /* vaCreateMFContext */
> +   NULL, /* vaMFAddContext */
> +   NULL, /* vaMFReleaseContext */
> +   NULL, /* vaMFSubmit */
> +   NULL, /* vaCreateBuffer2 */
> +   NULL, /* vaQueryProcessingRate */

Might be time to use designated initialisers?

>     &vlVaExportSurfaceHandle,
>  #endif
>  };
> diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c
> index 636505b720..f9412ce52e 100644
> --- a/src/gallium/state_trackers/va/surface.c
> +++ b/src/gallium/state_trackers/va/surface.c
> @@ -923,7 +923,7 @@ vlVaQueryVideoProcPipelineCaps(VADriverContextP ctx, VAContextID context,
>     return VA_STATUS_SUCCESS;
>  }
>  
> -#if 0
> +#if VA_CHECK_VERSION(1, 1, 0)
>  VAStatus
>  vlVaExportSurfaceHandle(VADriverContextP ctx,
>                          VASurfaceID surface_id,
> -- 
> 2.11.0
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev