Change the HDR conversion VTS test to take into account sink device

capabilities

Bug: 278467239
Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: I69c21b6d8b9753500a7b7a1692448b7151009ba3
This commit is contained in:
Kriti Dang 2023-05-04 17:54:26 +02:00
parent 98d6368ebb
commit 79bbec97c4

View file

@ -655,8 +655,15 @@ TEST_P(GraphicsComposerAidlTest, SetHdrConversionStrategy_Force) {
return;
}
const auto& [status, conversionCapabilities] = mComposerClient->getHdrConversionCapabilities();
const auto& [status2, hdrCapabilities] =
mComposerClient->getHdrCapabilities(getPrimaryDisplayId());
const auto& hdrTypes = hdrCapabilities.types;
for (auto conversionCapability : conversionCapabilities) {
if (conversionCapability.outputType != common::Hdr::INVALID) {
if (std::find(hdrTypes.begin(), hdrTypes.end(), conversionCapability.outputType) ==
hdrTypes.end()) {
continue;
}
common::HdrConversionStrategy hdrConversionStrategy;
hdrConversionStrategy.set<common::HdrConversionStrategy::Tag::forceHdrConversion>(
conversionCapability.outputType);
@ -674,6 +681,11 @@ TEST_P(GraphicsComposerAidlTest, SetHdrConversionStrategy_Auto) {
return;
}
const auto& [status, conversionCapabilities] = mComposerClient->getHdrConversionCapabilities();
const auto& [status2, hdrCapabilities] =
mComposerClient->getHdrCapabilities(getPrimaryDisplayId());
if (hdrCapabilities.types.size() <= 0) {
return;
}
std::vector<aidl::android::hardware::graphics::common::Hdr> autoHdrTypes;
for (auto conversionCapability : conversionCapabilities) {
if (conversionCapability.outputType != common::Hdr::INVALID) {