diff options
author | Long Ling <longling@google.com> | 2019-10-31 16:31:04 -0700 |
---|---|---|
committer | Long Ling <longling@google.com> | 2019-11-14 11:27:00 -0800 |
commit | 0d3fe0857a65e3a57c6f6a21e4e599e10ea6287a (patch) | |
tree | 727e623afb1bf6ce6d23dc894df2f1ef8066a52d | |
parent | 234d8f806c544f7343d92fe5df41dc0459f0e170 (diff) | |
download | platform_hardware_interfaces-0d3fe0857a65e3a57c6f6a21e4e599e10ea6287a.tar.gz platform_hardware_interfaces-0d3fe0857a65e3a57c6f6a21e4e599e10ea6287a.tar.bz2 platform_hardware_interfaces-0d3fe0857a65e3a57c6f6a21e4e599e10ea6287a.zip |
graphics: fix failed VTS cases
Return BAD_DISPLAY or BAD_PARAMETER as expected.
Bug: 140158240
Test: run vts -m VtsHalGraphicsComposerV2_2Target
Change-Id: I0f5a7103bc134ed87984bd13248aee7597a95d68
-rw-r--r-- | graphics/composer/2.2/utils/passthrough/include/composer-passthrough/2.2/HwcHal.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/graphics/composer/2.2/utils/passthrough/include/composer-passthrough/2.2/HwcHal.h b/graphics/composer/2.2/utils/passthrough/include/composer-passthrough/2.2/HwcHal.h index 93da0a5d94..9b3aa903ef 100644 --- a/graphics/composer/2.2/utils/passthrough/include/composer-passthrough/2.2/HwcHal.h +++ b/graphics/composer/2.2/utils/passthrough/include/composer-passthrough/2.2/HwcHal.h @@ -173,6 +173,14 @@ class HwcHalImpl : public V2_1::passthrough::detail::HwcHalImpl<Hal> { Error getRenderIntents(Display display, ColorMode mode, std::vector<RenderIntent>* outIntents) override { if (!mDispatch.getRenderIntents) { + IComposerClient::DisplayType type; + if (getDisplayType(display, &type) == Error::BAD_DISPLAY) { + return Error::BAD_DISPLAY; + } + if (mode < ColorMode::NATIVE || mode > ColorMode::DISPLAY_P3) { + return Error::BAD_PARAMETER; + } + *outIntents = std::vector<RenderIntent>({RenderIntent::COLORIMETRIC}); return Error::NONE; } @@ -199,6 +207,9 @@ class HwcHalImpl : public V2_1::passthrough::detail::HwcHalImpl<Hal> { Error setColorMode_2_2(Display display, ColorMode mode, RenderIntent intent) override { if (!mDispatch.setColorModeWithRenderIntent) { + if (intent < RenderIntent::COLORIMETRIC || intent > RenderIntent::TONE_MAP_ENHANCE) { + return Error::BAD_PARAMETER; + } if (intent != RenderIntent::COLORIMETRIC) { return Error::UNSUPPORTED; } @@ -282,6 +293,7 @@ class HwcHalImpl : public V2_1::passthrough::detail::HwcHalImpl<Hal> { private: using BaseType2_1 = V2_1::passthrough::detail::HwcHalImpl<Hal>; using BaseType2_1::getColorModes; + using BaseType2_1::getDisplayType; using BaseType2_1::mDevice; using BaseType2_1::setColorMode; using BaseType2_1::createVirtualDisplay; |