[Mesa-dev] [PATCH 2/3] st/va: use designated initialisers for VA driver functions

Mark Thompson sw at jkqxz.net
Tue Dec 5 00:18:03 UTC 2017


On 04/12/17 20:52, Leo Liu wrote:
> Signed-off-by: Leo Liu <leo.liu at amd.com>
> ---
>  src/gallium/state_trackers/va/context.c | 99 ++++++++++++++++-----------------
>  1 file changed, 49 insertions(+), 50 deletions(-)
> 
> diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
> index 0ad4309568..8c624d05c1 100644
> --- a/src/gallium/state_trackers/va/context.c
> +++ b/src/gallium/state_trackers/va/context.c
> @@ -40,57 +40,56 @@
>  
>  static struct VADriverVTable vtable =
>  {
> -   &vlVaTerminate,
> -   &vlVaQueryConfigProfiles,
> -   &vlVaQueryConfigEntrypoints,
> -   &vlVaGetConfigAttributes,
> -   &vlVaCreateConfig,
> -   &vlVaDestroyConfig,
> -   &vlVaQueryConfigAttributes,
> -   &vlVaCreateSurfaces,
> -   &vlVaDestroySurfaces,
> -   &vlVaCreateContext,
> -   &vlVaDestroyContext,
> -   &vlVaCreateBuffer,
> -   &vlVaBufferSetNumElements,
> -   &vlVaMapBuffer,
> -   &vlVaUnmapBuffer,
> -   &vlVaDestroyBuffer,
> -   &vlVaBeginPicture,
> -   &vlVaRenderPicture,
> -   &vlVaEndPicture,
> -   &vlVaSyncSurface,
> -   &vlVaQuerySurfaceStatus,
> -   &vlVaQuerySurfaceError,
> -   &vlVaPutSurface,
> -   &vlVaQueryImageFormats,
> -   &vlVaCreateImage,
> -   &vlVaDeriveImage,
> -   &vlVaDestroyImage,
> -   &vlVaSetImagePalette,
> -   &vlVaGetImage,
> -   &vlVaPutImage,
> -   &vlVaQuerySubpictureFormats,
> -   &vlVaCreateSubpicture,
> -   &vlVaDestroySubpicture,
> -   &vlVaSetSubpictureImage,
> -   &vlVaSetSubpictureChromakey,
> -   &vlVaSetSubpictureGlobalAlpha,
> -   &vlVaAssociateSubpicture,
> -   &vlVaDeassociateSubpicture,
> -   &vlVaQueryDisplayAttributes,
> -   &vlVaGetDisplayAttributes,
> -   &vlVaSetDisplayAttributes,
> -   &vlVaBufferInfo,
> -   &vlVaLockSurface,
> -   &vlVaUnlockSurface,
> -   NULL, /* DEPRECATED VaGetSurfaceAttributes */
> -   &vlVaCreateSurfaces2,
> -   &vlVaQuerySurfaceAttributes,
> -   &vlVaAcquireBufferHandle,
> -   &vlVaReleaseBufferHandle,
> +   .vaTerminate = &vlVaTerminate,
> +   .vaQueryConfigProfiles = &vlVaQueryConfigProfiles,
> +   .vaQueryConfigEntrypoints = &vlVaQueryConfigEntrypoints,
> +   .vaGetConfigAttributes = &vlVaGetConfigAttributes,
> +   .vaCreateConfig = &vlVaCreateConfig,
> +   .vaDestroyConfig = &vlVaDestroyConfig,
> +   .vaQueryConfigAttributes = &vlVaQueryConfigAttributes,
> +   .vaCreateSurfaces = &vlVaCreateSurfaces,
> +   .vaDestroySurfaces = &vlVaDestroySurfaces,
> +   .vaCreateContext = &vlVaCreateContext,
> +   .vaDestroyContext = &vlVaDestroyContext,
> +   .vaCreateBuffer = &vlVaCreateBuffer,
> +   .vaBufferSetNumElements = &vlVaBufferSetNumElements,
> +   .vaMapBuffer = &vlVaMapBuffer,
> +   .vaUnmapBuffer = &vlVaUnmapBuffer,
> +   .vaDestroyBuffer = &vlVaDestroyBuffer,
> +   .vaBeginPicture = &vlVaBeginPicture,
> +   .vaRenderPicture = &vlVaRenderPicture,
> +   .vaEndPicture = &vlVaEndPicture,
> +   .vaSyncSurface = &vlVaSyncSurface,
> +   .vaQuerySurfaceStatus = &vlVaQuerySurfaceStatus,
> +   .vaQuerySurfaceError = &vlVaQuerySurfaceError,
> +   .vaPutSurface = &vlVaPutSurface,
> +   .vaQueryImageFormats = &vlVaQueryImageFormats,
> +   .vaCreateImage = &vlVaCreateImage,
> +   .vaDeriveImage = &vlVaDeriveImage,
> +   .vaDestroyImage = &vlVaDestroyImage,
> +   .vaSetImagePalette = &vlVaSetImagePalette,
> +   .vaGetImage = &vlVaGetImage,
> +   .vaPutImage = &vlVaPutImage,
> +   .vaQuerySubpictureFormats = &vlVaQuerySubpictureFormats,
> +   .vaCreateSubpicture = &vlVaCreateSubpicture,
> +   .vaDestroySubpicture = &vlVaDestroySubpicture,
> +   .vaSetSubpictureImage = &vlVaSetSubpictureImage,
> +   .vaSetSubpictureChromakey = &vlVaSetSubpictureChromakey,
> +   .vaSetSubpictureGlobalAlpha = &vlVaSetSubpictureGlobalAlpha,
> +   .vaAssociateSubpicture = &vlVaAssociateSubpicture,
> +   .vaDeassociateSubpicture = &vlVaDeassociateSubpicture,
> +   .vaQueryDisplayAttributes = &vlVaQueryDisplayAttributes,
> +   .vaGetDisplayAttributes = &vlVaGetDisplayAttributes,
> +   .vaSetDisplayAttributes = &vlVaSetDisplayAttributes,
> +   .vaBufferInfo = &vlVaBufferInfo,
> +   .vaLockSurface = &vlVaLockSurface,
> +   .vaUnlockSurface = &vlVaUnlockSurface,
> +   .vaCreateSurfaces2 = &vlVaCreateSurfaces2,
> +   .vaQuerySurfaceAttributes = &vlVaQuerySurfaceAttributes,
> +   .vaAcquireBufferHandle = &vlVaAcquireBufferHandle,
> +   .vaReleaseBufferHandle = &vlVaReleaseBufferHandle,
>  #if 0
> -   &vlVaExportSurfaceHandle,
> +   .vaExportSurfaceHandle = &vlVaExportSurfaceHandle,
>  #endif
>  };

Tbh I think I prefer how it is currently - the names aren't duplicated, and the gaps are clearly marked so that it is obvious which functions haven't been implemented.

Thanks,

- Mark


More information about the mesa-dev mailing list