[Mesa-dev] [PATCH] st/va: set default rt formats when calling vaCreateConfig

Christian König christian.koenig at amd.com
Tue Oct 18 09:09:37 UTC 2016


Am 17.10.2016 um 21:40 schrieb Julien Isorce:
>
>
> On Monday, 17 October 2016, Mark Thompson <sw at jkqxz.net 
> <mailto:sw at jkqxz.net>> wrote:
>
>     On 17/10/16 17:33, Julien Isorce wrote:
>     > As specified in va.h, default value should be set on attributes
>     > not present in the input list.
>     >
>     > Signed-off-by: Julien Isorce <j.isorce at samsung.com <javascript:;>>
>     > ---
>     >  src/gallium/state_trackers/va/config.c  | 9 +++++++++
>     >  src/gallium/state_trackers/va/surface.c | 5 +++--
>     >  2 files changed, 12 insertions(+), 2 deletions(-)
>     >
>     > diff --git a/src/gallium/state_trackers/va/config.c
>     b/src/gallium/state_trackers/va/config.c
>     > index 2f96eb6..fb236f1 100644
>     > --- a/src/gallium/state_trackers/va/config.c
>     > +++ b/src/gallium/state_trackers/va/config.c
>     > @@ -195,6 +195,11 @@ vlVaCreateConfig(VADriverContextP ctx,
>     VAProfile profile, VAEntrypoint entrypoin
>     >              }
>     >           }
>     >        }
>     > +
>     > +      /* Default value if not specified in the input attributes. */
>     > +      if (!config->rt_format)
>     > +        config->rt_format = VA_RT_FORMAT_YUV420 |
>     VA_RT_FORMAT_RGB32;
>
>     Indent should be three spaces.
>
>     > +
>     >        pipe_mutex_lock(drv->mutex);
>     >        *config_id = handle_table_add(drv->htab, config);
>     >        pipe_mutex_unlock(drv->mutex);
>     > @@ -256,6 +261,10 @@ vlVaCreateConfig(VADriverContextP ctx,
>     VAProfile profile, VAEntrypoint entrypoin
>     >        }
>     >     }
>     >
>     > +   /* Default value if not specified in the input attributes. */
>     > +   if (!config->rt_format)
>     > +     config->rt_format = VA_RT_FORMAT_YUV420;
>
>     And here.
>
>
> Oh I forgot :) , cheers.
>
>
>     > +
>     >     pipe_mutex_lock(drv->mutex);
>     >     *config_id = handle_table_add(drv->htab, config);
>     >     pipe_mutex_unlock(drv->mutex);
>     > diff --git a/src/gallium/state_trackers/va/surface.c
>     b/src/gallium/state_trackers/va/surface.c
>     > index 5e92980..f8513d9 100644
>     > --- a/src/gallium/state_trackers/va/surface.c
>     > +++ b/src/gallium/state_trackers/va/surface.c
>     > @@ -419,7 +419,7 @@ vlVaQuerySurfaceAttributes(VADriverContextP
>     ctx, VAConfigID config_id,
>     >     /* vlVaCreateConfig returns PIPE_VIDEO_PROFILE_UNKNOWN
>     >      * only for VAEntrypointVideoProc. */
>     >     if (config->profile == PIPE_VIDEO_PROFILE_UNKNOWN) {
>     > -      if (config->rt_format == VA_RT_FORMAT_RGB32) {
>     > +      if (config->rt_format & VA_RT_FORMAT_RGB32) {
>     >           for (j = 0; j < ARRAY_SIZE(vpp_surface_formats); ++j) {
>     >              attribs[i].type = VASurfaceAttribPixelFormat;
>     >              attribs[i].value.type = VAGenericValueTypeInteger;
>     > @@ -427,7 +427,8 @@ vlVaQuerySurfaceAttributes(VADriverContextP
>     ctx, VAConfigID config_id,
>     >              attribs[i].value.value.i =
>     PipeFormatToVaFourcc(vpp_surface_formats[j]);
>     >              i++;
>     >           }
>     > -      } else if (config->rt_format == VA_RT_FORMAT_YUV420) {
>     > +      }
>     > +      if (config->rt_format & VA_RT_FORMAT_YUV420) {
>     >           attribs[i].type = VASurfaceAttribPixelFormat;
>     >           attribs[i].value.type = VAGenericValueTypeInteger;
>     >           attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE |
>     VA_SURFACE_ATTRIB_SETTABLE;
>     >
>
>     Actual code LGTM, and tested.
>
>     Reviewed-by: Mark Thompson <sw at jkqxz.net <javascript:;>>
>
>
> Thx, will push it soon.

If you haven't already pushed it with the fixes Mark mentioned the patch 
is Reviewed-by: Christian König <christian.koenig at amd.com> as well.

Regards,
Christian.

> Julien
>
>
>     Thanks,
>
>     - Mark
>
>     _______________________________________________
>     mesa-dev mailing list
>     mesa-dev at lists.freedesktop.org <javascript:;>
>     https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>     <https://lists.freedesktop.org/mailman/listinfo/mesa-dev>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161018/ec0d2619/attachment-0001.html>


More information about the mesa-dev mailing list