Commit 3c62dab9 authored by Andres Calderon Jaramillo's avatar Andres Calderon Jaramillo Committed by Commit Bot

media: handle RT_FORMAT_YUV420_10 in FillProfileInfo.

This CL fixes VaapiWrapper::FillProfileInfo_Locked() so that it doesn't
return false when the profile is VAProfileVP9Profile2 and the driver
does not advertise support for VA_RT_FORMAT_YUV420 (and instead only
advertises support for VA_RT_FORMAT_YUV420_10 and
VA_RT_FORMAT_YUV420_12).

More context:

The uprev to iHD 20.2.0 caused TGL to advertise only
VA_RT_FORMAT_YUV420_10 and VA_RT_FORMAT_YUV420_12 for
VAProfileVP9Profile2, probably because of [1]. This seems reasonable
since VP9.2 is intended for high bit depth. Running vainfo -a shows the
following for VP9.2:

VAProfileVP9Profile2/VAEntrypointVLD
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420_10
                                             VA_RT_FORMAT_YUV420_12
                                             VA_RT_FORMAT_YUV420_10BPP
    VAConfigAttribDecSliceMode             : VA_DEC_SLICE_MODE_NORMAL
                                             VA_DEC_SLICE_MODE_BASE
    VAConfigAttribDecProcessing            : VA_DEC_PROCESSING
    VAConfigAttribMaxPictureWidth          : 16384
    VAConfigAttribMaxPictureHeight         : 16384
    VAConfigAttribProcessingRate           : VA_PROCESSING_RATE_DECODE

The problem is that VaapiWrapper::FillProfileInfo_Locked() returns true
only if one of {VA_RT_FORMAT_YUV420, VA_RT_FORMAT_YUV422,
VA_RT_FORMAT_YUV444} is advertised. Therefore, for iHD 20.2.0, we would
determine that VAProfileVP9Profile2 is unsupported and subsequently fall
back to software.

This CL ensures that we check for the presence of
VA_RT_FORMAT_YUV420_10 (which is the non-deprecated version of
VA_RT_FORMAT_YUV420_10BPP [2]).

[1] https://github.com/intel/media-driver/commit/ca71e10f29ea3b232b883803b31724a8ee0d3e46
[2] https://github.com/intel/libva/blob/2.8.0/va/va.h#L821

Bug: b:161520834
Test: crosvideo.appspot.com w/ VP9.2; checked chrome://media-internals
Change-Id: Id00a0150272cc11640bd21183ee739b005f9d2cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2303682Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Commit-Queue: Andres Calderon Jaramillo <andrescj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797779}
parent 7919ff12
......@@ -915,6 +915,8 @@ bool VASupportedProfiles::FillProfileInfo_Locked(
continue;
if (attrib.value & VA_RT_FORMAT_YUV420)
profile_info->supported_internal_formats.yuv420 = true;
if (attrib.value & VA_RT_FORMAT_YUV420_10)
profile_info->supported_internal_formats.yuv420_10 = true;
if (attrib.value & VA_RT_FORMAT_YUV422)
profile_info->supported_internal_formats.yuv422 = true;
if (attrib.value & VA_RT_FORMAT_YUV444)
......@@ -936,6 +938,7 @@ bool VASupportedProfiles::FillProfileInfo_Locked(
}
const bool is_any_profile_supported =
profile_info->supported_internal_formats.yuv420 ||
profile_info->supported_internal_formats.yuv420_10 ||
profile_info->supported_internal_formats.yuv422 ||
profile_info->supported_internal_formats.yuv444;
DLOG_IF(ERROR, !is_any_profile_supported)
......@@ -1215,6 +1218,8 @@ bool VaapiWrapper::IsDecodingSupportedForInternalFormat(
switch (rt_format) {
case VA_RT_FORMAT_YUV420:
return supported_internal_formats->yuv420;
case VA_RT_FORMAT_YUV420_10:
return supported_internal_formats->yuv420_10;
case VA_RT_FORMAT_YUV422:
return supported_internal_formats->yuv422;
case VA_RT_FORMAT_YUV444:
......
......@@ -114,6 +114,7 @@ class MEDIA_GPU_EXPORT VaapiWrapper
using InternalFormats = struct {
bool yuv420 : 1;
bool yuv420_10 : 1;
bool yuv422 : 1;
bool yuv444 : 1;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment