From b24748a93ab164c5c5884e49974de0902a42c3be Mon Sep 17 00:00:00 2001 From: Ruijing Dong Date: Tue, 19 Mar 2024 13:30:19 -0400 Subject: [PATCH] frontends/va: add surface alignment attribute It is only taking effect in hevc encoding so far. Cc: mesa-stable Reviewed-By: Sil Vilerino Reviewed-by: Leo Liu Signed-off-by: Ruijing Dong Part-of: --- src/gallium/frontends/va/surface.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gallium/frontends/va/surface.c b/src/gallium/frontends/va/surface.c index 0f92246c2f6..89efb42d326 100644 --- a/src/gallium/frontends/va/surface.c +++ b/src/gallium/frontends/va/surface.c @@ -725,6 +725,16 @@ vlVaQuerySurfaceAttributes(VADriverContextP ctx, VAConfigID config_id, config->profile, config->entrypoint, PIPE_VIDEO_CAP_MAX_HEIGHT); i++; +#if VA_CHECK_VERSION(1, 21, 0) + attribs[i].type = VASurfaceAttribAlignmentSize; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE; + attribs[i].value.value.i = + pscreen->get_video_param(pscreen, + config->profile, config->entrypoint, + PIPE_VIDEO_CAP_ENC_SURFACE_ALIGNMENT); + i++; +#endif } else { attribs[i].type = VASurfaceAttribMaxWidth; attribs[i].value.type = VAGenericValueTypeInteger;