diff --git a/.pick_status.json b/.pick_status.json index 8cabfae1a50..222bf95fdf6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1254,7 +1254,7 @@ "description": "frontends/va: Only report surface alignment when non-zero", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "b24748a93ab164c5c5884e49974de0902a42c3be", "notes": null diff --git a/src/gallium/frontends/va/surface.c b/src/gallium/frontends/va/surface.c index f18a3c0c8ab..fdc8a40d670 100644 --- a/src/gallium/frontends/va/surface.c +++ b/src/gallium/frontends/va/surface.c @@ -718,14 +718,17 @@ vlVaQuerySurfaceAttributes(VADriverContextP ctx, VAConfigID config_id, 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 = + int surface_alignment = pscreen->get_video_param(pscreen, config->profile, config->entrypoint, PIPE_VIDEO_CAP_ENC_SURFACE_ALIGNMENT); - i++; + if (surface_alignment > 0) { + attribs[i].type = VASurfaceAttribAlignmentSize; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE; + attribs[i].value.value.i = surface_alignment; + i++; + } #endif } else { attribs[i].type = VASurfaceAttribMaxWidth;