gallium va: Handle new VA attributes with new pipe video caps

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16286>
This commit is contained in:
Sil Vilerino 2022-05-06 13:23:23 -07:00 committed by Marge Bot
parent e1f2db7527
commit 04495300f9

View file

@ -170,9 +170,43 @@ vlVaGetConfigAttributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint en
if (u_reduce_video_profile(ProfileToPipe(profile)) == PIPE_VIDEO_FORMAT_HEVC) if (u_reduce_video_profile(ProfileToPipe(profile)) == PIPE_VIDEO_FORMAT_HEVC)
value |= VA_ENC_PACKED_HEADER_SEQUENCE; value |= VA_ENC_PACKED_HEADER_SEQUENCE;
break; break;
case VAConfigAttribEncMaxSlices:
{
/**
* \brief Maximum number of slices per frame. Read-only.
*
* This attribute determines the maximum number of slices the
* driver can support to encode a single frame.
*/
int maxSlicesPerEncodedPic = pscreen->get_video_param(pscreen, ProfileToPipe(profile),
PIPE_VIDEO_ENTRYPOINT_ENCODE,
PIPE_VIDEO_CAP_ENC_MAX_SLICES_PER_FRAME);
if (maxSlicesPerEncodedPic <= 0)
value = VA_ATTRIB_NOT_SUPPORTED;
else
value = maxSlicesPerEncodedPic;
} break;
case VAConfigAttribEncMaxRefFrames: case VAConfigAttribEncMaxRefFrames:
value = 1; {
break; int maxL0L1ReferencesPerFrame = pscreen->get_video_param(pscreen, ProfileToPipe(profile),
PIPE_VIDEO_ENTRYPOINT_ENCODE,
PIPE_VIDEO_CAP_ENC_MAX_REFERENCES_PER_FRAME);
if (maxL0L1ReferencesPerFrame <= 0)
value = 1;
else
value = maxL0L1ReferencesPerFrame;
} break;
case VAConfigAttribEncSliceStructure:
{
/* The VA enum values match the pipe_video_cap_slice_structure definitions*/
int supportedSliceStructuresFlagSet = pscreen->get_video_param(pscreen, ProfileToPipe(profile),
PIPE_VIDEO_ENTRYPOINT_ENCODE,
PIPE_VIDEO_CAP_ENC_SLICES_STRUCTURE);
if (supportedSliceStructuresFlagSet <= 0)
value = VA_ATTRIB_NOT_SUPPORTED;
else
value = supportedSliceStructuresFlagSet;
} break;
default: default:
value = VA_ATTRIB_NOT_SUPPORTED; value = VA_ATTRIB_NOT_SUPPORTED;
break; break;