frontends/va: Only report surface alignment when non-zero
Otherwise this means the alignment is 1x1 which is wrong. Fixes:b24748a93a
("frontends/va: add surface alignment attribute") Reviewed-by: Leo Liu <leo.liu@amd.com> (cherry picked from commitc23df7e790
) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33113>
This commit is contained in:
@@ -1254,7 +1254,7 @@
|
|||||||
"description": "frontends/va: Only report surface alignment when non-zero",
|
"description": "frontends/va: Only report surface alignment when non-zero",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 2,
|
"nomination_type": 2,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": "b24748a93ab164c5c5884e49974de0902a42c3be",
|
"because_sha": "b24748a93ab164c5c5884e49974de0902a42c3be",
|
||||||
"notes": null
|
"notes": null
|
||||||
|
@@ -718,14 +718,17 @@ vlVaQuerySurfaceAttributes(VADriverContextP ctx, VAConfigID config_id,
|
|||||||
PIPE_VIDEO_CAP_MAX_HEIGHT);
|
PIPE_VIDEO_CAP_MAX_HEIGHT);
|
||||||
i++;
|
i++;
|
||||||
#if VA_CHECK_VERSION(1, 21, 0)
|
#if VA_CHECK_VERSION(1, 21, 0)
|
||||||
attribs[i].type = VASurfaceAttribAlignmentSize;
|
int surface_alignment =
|
||||||
attribs[i].value.type = VAGenericValueTypeInteger;
|
|
||||||
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE;
|
|
||||||
attribs[i].value.value.i =
|
|
||||||
pscreen->get_video_param(pscreen,
|
pscreen->get_video_param(pscreen,
|
||||||
config->profile, config->entrypoint,
|
config->profile, config->entrypoint,
|
||||||
PIPE_VIDEO_CAP_ENC_SURFACE_ALIGNMENT);
|
PIPE_VIDEO_CAP_ENC_SURFACE_ALIGNMENT);
|
||||||
|
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++;
|
i++;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
attribs[i].type = VASurfaceAttribMaxWidth;
|
attribs[i].type = VASurfaceAttribMaxWidth;
|
||||||
|
Reference in New Issue
Block a user