diff options
author | Chia-I Wu <olv@google.com> | 2018-05-29 13:24:44 -0700 |
---|---|---|
committer | Chia-I Wu <olv@google.com> | 2018-05-30 11:52:57 -0700 |
commit | 8f5a17d1e8b1bb646b99083b91359a0f23e67015 (patch) | |
tree | dccb8c30f2cd3e6f2078ec1578207855f187fce0 /graphics | |
parent | a12e7b7847958fd57144ea643fed971543dbf353 (diff) | |
download | android_hardware_interfaces-8f5a17d1e8b1bb646b99083b91359a0f23e67015.tar.gz android_hardware_interfaces-8f5a17d1e8b1bb646b99083b91359a0f23e67015.tar.bz2 android_hardware_interfaces-8f5a17d1e8b1bb646b99083b91359a0f23e67015.zip |
graphics: COLORIMETRIC is optional for HDR modes
Bug: 80030364
Test: VTS
Change-Id: I2180f18e8742850f728491887475f16b1cad4791
Merged-In: I2180f18e8742850f728491887475f16b1cad4791
Diffstat (limited to 'graphics')
3 files changed, 26 insertions, 5 deletions
diff --git a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp index 8b8b530a8..747c66c9c 100644 --- a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp +++ b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp @@ -292,9 +292,16 @@ TEST_F(GraphicsComposerHidlTest, SetActiveConfig) { * Test that IComposerClient::setColorMode succeeds for all color modes. */ TEST_F(GraphicsComposerHidlTest, SetColorMode) { + std::unordered_set<ColorMode> validModes; + for (auto mode : hidl_enum_iterator<ColorMode>()) { + validModes.insert(mode); + } + std::vector<ColorMode> modes = mComposerClient->getColorModes(mPrimaryDisplay); for (auto mode : modes) { - mComposerClient->setColorMode(mPrimaryDisplay, mode); + if (validModes.count(mode)) { + mComposerClient->setColorMode(mPrimaryDisplay, mode); + } } } diff --git a/graphics/composer/2.2/IComposerClient.hal b/graphics/composer/2.2/IComposerClient.hal index 2f0a3cca7..d4a87e6f8 100644 --- a/graphics/composer/2.2/IComposerClient.hal +++ b/graphics/composer/2.2/IComposerClient.hal @@ -355,7 +355,8 @@ interface IComposerClient extends @2.1::IComposerClient { * Returns the render intents supported by the specified display and color * mode. * - * RenderIntent::COLORIMETRIC is always supported. + * For SDR color modes, RenderIntent::COLORIMETRIC must be supported. For + * HDR color modes, RenderIntent::TONE_MAP_COLORIMETRIC must be supported. * * @param display is the display to query. * @param mode is the color mode to query. diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp index f0d22504a..23bf5583b 100644 --- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp +++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp @@ -347,9 +347,22 @@ TEST_F(GraphicsComposerHidlTest, GetRenderIntent) { for (auto mode : modes) { std::vector<RenderIntent> intents = mComposerClient->getRenderIntents(mPrimaryDisplay, mode); - auto colorimetricIntent = - std::find(intents.cbegin(), intents.cend(), RenderIntent::COLORIMETRIC); - EXPECT_NE(intents.cend(), colorimetricIntent); + + bool isHdr; + switch (mode) { + case ColorMode::BT2100_PQ: + case ColorMode::BT2100_HLG: + isHdr = true; + break; + default: + isHdr = false; + break; + } + RenderIntent requiredIntent = + isHdr ? RenderIntent::TONE_MAP_COLORIMETRIC : RenderIntent::COLORIMETRIC; + + auto iter = std::find(intents.cbegin(), intents.cend(), requiredIntent); + EXPECT_NE(intents.cend(), iter); } } |