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 <thong.thai@amd.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22422>
This commit is contained in:
Thong Thai
2023-04-13 10:22:21 -04:00
committed by Marge Bot
parent 413235d164
commit c987eed9cd

View File

@@ -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;