From 9f5802ad3e0cf303892f19d29803bba95eac9102 Mon Sep 17 00:00:00 2001 From: Thong Thai Date: Tue, 3 Mar 2020 14:08:23 -0500 Subject: [PATCH] st/va: add check for P010 and P016 encode/decode support Signed-off-by: Thong Thai Reviewed-by: Leo Liu Tested-by: Marge Bot Part-of: --- src/gallium/state_trackers/va/config.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/gallium/state_trackers/va/config.c b/src/gallium/state_trackers/va/config.c index 617ca6944c4..294cbcc6418 100644 --- a/src/gallium/state_trackers/va/config.c +++ b/src/gallium/state_trackers/va/config.c @@ -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