Module: Mesa
Branch: main
Commit: c987eed9cd7ccf7836eb18ad8950a035ae002bbc
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c987eed9cd7ccf7836eb18ad8950a035ae002bbc

Author: Thong Thai <[email protected]>
Date:   Thu Apr 13 10:22:21 2023 -0400

frontends/va: report min width and min height values if available

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8756
Signed-off-by: Thong Thai <[email protected]>
Reviewed-by: Sil Vilerino <[email protected]>
Reviewed-by: Ruijing Dong <[email protected]>
Reviewed-by: Boyuan Zhang <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22422>

---

 src/gallium/frontends/va/surface.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/gallium/frontends/va/surface.c 
b/src/gallium/frontends/va/surface.c
index 21cf8adee63..546f3a16246 100644
--- a/src/gallium/frontends/va/surface.c
+++ b/src/gallium/frontends/va/surface.c
@@ -633,6 +633,28 @@ vlVaQuerySurfaceAttributes(VADriverContextP ctx, 
VAConfigID config_id,
                                 PIPE_VIDEO_ENTRYPOINT_PROCESSING,
                                 PIPE_VIDEO_CAP_SUPPORTED))
    {
+      unsigned min_width, min_height;
+      min_width = pscreen->get_video_param(pscreen,
+                                  config->profile, config->entrypoint,
+                                  PIPE_VIDEO_CAP_MIN_WIDTH);
+      min_height = pscreen->get_video_param(pscreen,
+                                  config->profile, config->entrypoint,
+                                  PIPE_VIDEO_CAP_MIN_HEIGHT);
+
+      if (min_width > 0 && min_height > 0) {
+         attribs[i].type = VASurfaceAttribMinWidth;
+         attribs[i].value.type = VAGenericValueTypeInteger;
+         attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE;
+         attribs[i].value.value.i = min_width;
+         i++;
+
+         attribs[i].type = VASurfaceAttribMinHeight;
+         attribs[i].value.type = VAGenericValueTypeInteger;
+         attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE;
+         attribs[i].value.value.i = min_height;
+         i++;
+      }
+
       attribs[i].type = VASurfaceAttribMaxWidth;
       attribs[i].value.type = VAGenericValueTypeInteger;
       attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE;

Reply via email to