st/va: add check for P010 and P016 encode/decode support

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4033>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4033>
This commit is contained in:
Thong Thai 2020-03-03 14:08:23 -05:00 committed by Marge Bot
parent d375803576
commit 9f5802ad3e

View file

@ -127,10 +127,13 @@ vlVaGetConfigAttributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint en
switch (attrib_list[i].type) {
case VAConfigAttribRTFormat:
value = VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_YUV422;
if (pscreen->is_video_format_supported(pscreen, PIPE_FORMAT_P016,
if (pscreen->is_video_format_supported(pscreen, PIPE_FORMAT_P010,
ProfileToPipe(profile),
PIPE_VIDEO_ENTRYPOINT_BITSTREAM) ||
pscreen->is_video_format_supported(pscreen, PIPE_FORMAT_P016,
ProfileToPipe(profile),
PIPE_VIDEO_ENTRYPOINT_BITSTREAM))
value |= VA_RT_FORMAT_YUV420_10BPP;
value |= VA_RT_FORMAT_YUV420_10BPP;
break;
default:
value = VA_ATTRIB_NOT_SUPPORTED;
@ -142,6 +145,13 @@ vlVaGetConfigAttributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint en
switch (attrib_list[i].type) {
case VAConfigAttribRTFormat:
value = VA_RT_FORMAT_YUV420;
if (pscreen->is_video_format_supported(pscreen, PIPE_FORMAT_P010,
ProfileToPipe(profile),
PIPE_VIDEO_ENTRYPOINT_BITSTREAM) ||
pscreen->is_video_format_supported(pscreen, PIPE_FORMAT_P016,
ProfileToPipe(profile),
PIPE_VIDEO_ENTRYPOINT_BITSTREAM))
value |= VA_RT_FORMAT_YUV420_10BPP;
break;
case VAConfigAttribRateControl:
value = VA_RC_CQP | VA_RC_CBR | VA_RC_VBR;
@ -261,8 +271,10 @@ vlVaCreateConfig(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoin
config->profile = p;
supported_rt_formats = VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_YUV422;
if (pscreen->is_video_format_supported(pscreen, PIPE_FORMAT_P016, p,
config->entrypoint))
if (pscreen->is_video_format_supported(pscreen, PIPE_FORMAT_P010, p,
config->entrypoint) ||
pscreen->is_video_format_supported(pscreen, PIPE_FORMAT_P016, p,
config->entrypoint))
supported_rt_formats |= VA_RT_FORMAT_YUV420_10BPP;
for (int i = 0; i <num_attribs ; i++) {