diff options
author | Alec Mouri <alecmouri@google.com> | 2023-11-28 02:09:03 +0000 |
---|---|---|
committer | Android Build Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | 2023-11-28 02:09:03 +0000 |
commit | 0c8df6f031076f163b95d849a82b700c68a19488 (patch) | |
tree | 4ddf31fec335ec823ba9e8c174f21d158d57d092 | |
parent | 5da5f0939143d63b342c2ab255139d4e51c5637a (diff) | |
download | native-0c8df6f031076f163b95d849a82b700c68a19488.tar.gz |
Remove extra layering of HDR capabilities on top of HWC
SurfaceFlinger claimed to always handle HDR10 and HLG content. This was
because initial handling of HDR content was done by hacking in Y410
support and applying a special GPU shader. However, the Y410 path has
not been used since at least Android 12 when SkiaRenderEngine stopped
supporting it.
The resulting side effect is that some WCG-capable devices are reporting
themselves as HDR-capable to apps. This is not desirable by OEMs who may
install a low dynamic range panel. And, on such panels, an SDR rendition
would likely both look better and have cheaper power consumption.
This change allows for OEMs to report that they don't support HDR. Note
that this patch does not change color management: OEMs will still be
required to accept HLG or HDR10 content and color manage correctly if
the display receives this content. I.e., the HdrCapabilities API will
tell the app that they *should not* submit HDR content, not that they
*cannot*.
Bug: 281623165
Test: libcompositionengine_test
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c6aced205bfd3a23ff8f97f3214dc62e93e30909)
Merged-In: I7c7dc150fd92e580330e31f9ebfe29e645510cdf
Change-Id: I7c7dc150fd92e580330e31f9ebfe29e645510cdf
-rw-r--r-- | services/surfaceflinger/CompositionEngine/src/DisplayColorProfile.cpp | 11 | ||||
-rw-r--r-- | services/surfaceflinger/CompositionEngine/tests/DisplayColorProfileTest.cpp | 33 |
2 files changed, 0 insertions, 44 deletions
diff --git a/services/surfaceflinger/CompositionEngine/src/DisplayColorProfile.cpp b/services/surfaceflinger/CompositionEngine/src/DisplayColorProfile.cpp index a7c45129b1..2e7f5949e0 100644 --- a/services/surfaceflinger/CompositionEngine/src/DisplayColorProfile.cpp +++ b/services/surfaceflinger/CompositionEngine/src/DisplayColorProfile.cpp @@ -220,17 +220,6 @@ DisplayColorProfile::DisplayColorProfile(const DisplayColorProfileCreationArgs& minLuminance = minLuminance <= 0.0 ? sDefaultMinLumiance : minLuminance; maxLuminance = maxLuminance <= 0.0 ? sDefaultMaxLumiance : maxLuminance; maxAverageLuminance = maxAverageLuminance <= 0.0 ? sDefaultMaxLumiance : maxAverageLuminance; - if (args.hasWideColorGamut) { - // insert HDR10/HLG as we will force client composition for HDR10/HLG - // layers - if (!hasHDR10Support()) { - types.push_back(ui::Hdr::HDR10); - } - - if (!hasHLGSupport()) { - types.push_back(ui::Hdr::HLG); - } - } mHdrCapabilities = HdrCapabilities(types, maxLuminance, maxAverageLuminance, minLuminance); } diff --git a/services/surfaceflinger/CompositionEngine/tests/DisplayColorProfileTest.cpp b/services/surfaceflinger/CompositionEngine/tests/DisplayColorProfileTest.cpp index 21b9aa93ea..b760184cfa 100644 --- a/services/surfaceflinger/CompositionEngine/tests/DisplayColorProfileTest.cpp +++ b/services/surfaceflinger/CompositionEngine/tests/DisplayColorProfileTest.cpp @@ -282,39 +282,6 @@ TEST_F(DisplayColorProfileTest, ctorUsesOrDefaultsLuminanceValuesFromInputArgs) } } -TEST_F(DisplayColorProfileTest, ctorSignalsHdrSupportForAnyWideColorGamutDevice) { - { - // If the output does not profile wide color gamut, then no HDR modes - // will be profileed in the generated HDR capabilities. - auto profile = ProfileFactory().setHasWideColorGamut(false).build(); - - EXPECT_THAT(profile.getHdrCapabilities().getSupportedHdrTypes(), IsEmpty()); - } - - { - // If the HWC does not show profile for certain HDR modes, then the - // generated HDR capabilities will indicate profile anyway. - auto profile = ProfileFactory().setHasWideColorGamut(true).build(); - - EXPECT_THAT(profile.getHdrCapabilities().getSupportedHdrTypes(), SizeIs(2)); - EXPECT_THAT(profile.getHdrCapabilities().getSupportedHdrTypes(), Contains(Hdr::HDR10)); - EXPECT_THAT(profile.getHdrCapabilities().getSupportedHdrTypes(), Contains(Hdr::HLG)); - } - - { - // If the HWC profiles the HDR modes, then the generated capabilities - // still has one entry for each HDR type. - auto profile = ProfileFactory() - .setHasWideColorGamut(true) - .addHdrTypes({Hdr::HLG, Hdr::HDR10}) - .build(); - - EXPECT_THAT(profile.getHdrCapabilities().getSupportedHdrTypes(), SizeIs(2)); - EXPECT_THAT(profile.getHdrCapabilities().getSupportedHdrTypes(), Contains(Hdr::HDR10)); - EXPECT_THAT(profile.getHdrCapabilities().getSupportedHdrTypes(), Contains(Hdr::HLG)); - } -} - /* ------------------------------------------------------------------------ * DisplayColorProfile::hasRenderIntent */ |