<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 17 October 2016 at 16:27, Mark Thompson <span dir="ltr"><<a href="mailto:sw@jkqxz.net" target="_blank">sw@jkqxz.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 17/10/16 16:13, Julien Isorce wrote:<br>
> Hi Mark,<br>
><br>
</span><span class="">> Yes I actually saw that too in the intel driver though I think it does not add<br>
> VA_RT_FORMAT_RGB32 ? Or I missed something ?<br>
> Maybe this is a bug. In any case yes as said before " the intel va driver always<br>
> return the full list for vpp." from vaQuerySurfaceAttributes<br>
> no matter the format selected when creating the config.<br>
<br>
</span>Looks like the lack of RGB32 has already been noted and fixed:<br>
<<a href="https://cgit.freedesktop.org/vaapi/intel-driver/commit/?id=e748bc7f0565d59a7ec2ba038e76a0a1de19c15c" rel="noreferrer" target="_blank">https://cgit.freedesktop.org/<wbr>vaapi/intel-driver/commit/?id=<wbr>e748bc7f0565d59a7ec2ba038e76a0<wbr>a1de19c15c</a>>.<br></blockquote><div><br></div><div>Great, thx for the link.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> So combining all it should probably be something like this:<br>
><br>
> diff --git a/src/gallium/state_trackers/<wbr>va/config.c<br>
> b/src/gallium/state_trackers/<wbr>va/config.c<br>
> index 2f96eb6..11afc81 100644<br>
> --- a/src/gallium/state_trackers/<wbr>va/config.c<br>
> +++ b/src/gallium/state_trackers/<wbr>va/config.c<br>
> @@ -185,6 +185,8 @@ vlVaCreateConfig(<wbr>VADriverContextP ctx, VAProfile profile,<br>
> VAEntrypoint entrypoin<br>
>     if (profile == VAProfileNone && entrypoint == VAEntrypointVideoProc) {<br>
>        config->entrypoint = VAEntrypointVideoProc;<br>
>        config->profile = PIPE_VIDEO_PROFILE_UNKNOWN;<br>
> +      config->rt_format = VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_RGB32;<br>
> +<br>
>        for (int i = 0; i < num_attribs; i++) {<br>
>           if (attrib_list[i].type == VAConfigAttribRTFormat) {<br>
>              if (attrib_list[i].value & (VA_RT_FORMAT_YUV420 |<br>
> VA_RT_FORMAT_RGB32)) {<br>
<br>
</span>Please set a default for the non-VideoProc case too, so that codecs have the<br>
same behaviour.<br></blockquote><div><br></div><div>Oups<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5"><br>
> diff --git a/src/gallium/state_trackers/<wbr>va/surface.c<br>
> b/src/gallium/state_trackers/<wbr>va/surface.c<br>
> index 5e92980..f8513d9 100644<br>
> --- a/src/gallium/state_trackers/<wbr>va/surface.c<br>
> +++ b/src/gallium/state_trackers/<wbr>va/surface.c<br>
> @@ -419,7 +419,7 @@ vlVaQuerySurfaceAttributes(<wbr>VADriverContextP ctx, VAConfigID<br>
> config_id,<br>
>     /* vlVaCreateConfig returns PIPE_VIDEO_PROFILE_UNKNOWN<br>
>      * only for VAEntrypointVideoProc. */<br>
>     if (config->profile == PIPE_VIDEO_PROFILE_UNKNOWN) {<br>
> -      if (config->rt_format == VA_RT_FORMAT_RGB32) {<br>
> +      if (config->rt_format & VA_RT_FORMAT_RGB32) {<br>
>           for (j = 0; j < ARRAY_SIZE(vpp_surface_<wbr>formats); ++j) {<br>
>              attribs[i].type = VASurfaceAttribPixelFormat;<br>
>              attribs[i].value.type = VAGenericValueTypeInteger;<br>
> @@ -427,7 +427,8 @@ vlVaQuerySurfaceAttributes(<wbr>VADriverContextP ctx, VAConfigID<br>
> config_id,<br>
>              attribs[i].value.value.i =<br>
> PipeFormatToVaFourcc(vpp_<wbr>surface_formats[j]);<br>
>              i++;<br>
>           }<br>
> -      } else if (config->rt_format == VA_RT_FORMAT_YUV420) {<br>
> +      }<br>
> +      if (config->rt_format & VA_RT_FORMAT_YUV420) {<br>
>           attribs[i].type = VASurfaceAttribPixelFormat;<br>
>           attribs[i].value.type = VAGenericValueTypeInteger;<br>
>           attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE |<br>
> VA_SURFACE_ATTRIB_SETTABLE;<br>
><br>
> Will it be ok for your case ?<br>
><br>
> Cheers<br>
> Julien<br>
<br>
</div></div>Yeah, that seems right to me (with the small change above).<br></blockquote><div><br></div><div>I sent the patch to mesa-dev few minutes ago, please have a look, thx.<br><br></div><div>Cheers<br></div><div>Julien<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
<br>
- Mark<br>
<br>
</blockquote></div><br></div></div>