<div dir="ltr"><div><div><div><div><div><div><div><div>Hi Mark,<br><br></div>Thx for the patch. I can see it has already landed.<br><br></div>I just tried it with gstreamer-vaapi and it causes problem since they create the config like this for VPP:<br><br>va_status = vaCreateConfig (filter->va_display, VAProfileNone,<br>      VAEntrypointVideoProc, NULL, 0, &filter->va_config);<br><br></div>As you can see num attrivs is 0 so it makes vaQuerySurfaceAttributes to return no supported format<br></div>because <span class="gmail-il">config</span>->rt_format is 0.<br><br></div>So I plan to make a patch that looks like this:<br><br><br>--- a/src/gallium/state_trackers/va/surface.c<br>+++ b/src/gallium/state_trackers/va/surface.c<br>@@ -419,7 +419,7 @@ vlVaQuerySurfaceAttributes(VADriverContextP ctx, VAConfigID 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 || config->rt_format == VA_RT_FORMAT_RGB32) {<br>          for (j = 0; j < ARRAY_SIZE(vpp_surface_formats); ++j) {<br>             attribs[i].type = VASurfaceAttribPixelFormat;<br>             attribs[i].value.type = VAGenericValueTypeInteger;<br>@@ -427,7 +427,8 @@ vlVaQuerySurfaceAttributes(VADriverContextP ctx, VAConfigID config_id,<br>             attribs[i].value.value.i = PipeFormatToVaFourcc(vpp_surface_formats[j]);<br>             i++;<br>          }<br>-      } else if (config->rt_format == VA_RT_FORMAT_YUV420) {<br>+      }<br>+      if (!config->rt_format || 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 | VA_SURFACE_ATTRIB_SETTABLE;<br><br><br></div>Will it be ok for whatever test application you are using ?<br><br></div><div>Not that the intel va driver always return the full list for vpp.<br></div><div><br></div>Cheers<br></div>Julien<br><div><div><div><br><br><br><div><br><div><div><div><br><br></div></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 12 October 2016 at 23:53, 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">This makes the supported format actually match the configuration, and<br>
allows the user to observe that NV12 is supported for video processing<br>
where previously they couldn't (though it did always work if they<br>
blindly tried to use it anyway).<br>
---<br>
 src/gallium/state_trackers/va/<wbr>surface.c | 12 ++++++++++--<br>
 1 file changed, 10 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/gallium/state_trackers/<wbr>va/surface.c b/src/gallium/state_trackers/<wbr>va/surface.c<br>
index 173e7d9..5e92980 100644<br>
--- a/src/gallium/state_trackers/<wbr>va/surface.c<br>
+++ b/src/gallium/state_trackers/<wbr>va/surface.c<br>
@@ -419,11 +419,19 @@ vlVaQuerySurfaceAttributes(<wbr>VADriverContextP ctx, VAConfigID config_id,<br>
    /* vlVaCreateConfig returns PIPE_VIDEO_PROFILE_UNKNOWN<br>
     * only for VAEntrypointVideoProc. */<br>
    if (config->profile == PIPE_VIDEO_PROFILE_UNKNOWN) {<br>
-      for (j = 0; j < ARRAY_SIZE(vpp_surface_<wbr>formats); ++j) {<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>
+            attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;<br>
+            attribs[i].value.value.i = PipeFormatToVaFourcc(vpp_<wbr>surface_formats[j]);<br>
+            i++;<br>
+         }<br>
+      } else 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 | VA_SURFACE_ATTRIB_SETTABLE;<br>
-         attribs[i].value.value.i = PipeFormatToVaFourcc(vpp_<wbr>surface_formats[j]);<br>
+         attribs[i].value.value.i = VA_FOURCC_NV12;<br>
          i++;<br>
       }<br>
    } else {<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.9.3<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>