Skip to content

Commit 227bfac

Browse files
committed
Don't fallback to global capability when skipping client transform
* The display internally already fallsback to global capabilities if the display capabilities aren't supported * If HWC doesn't know about the display, then we need to default to the Output behavior, which today always asks the GPU to skip the client transform. We do this because today, the per-display color transform is actually a *global* transform, but we need to exclude the transform for things like screen recording or projected android auto. Bug: 395661767 Flag: EXEMPT bug fix Test: builds Test: libcompositionengine_test Test: Overlay displays don't double-sepia Change-Id: I7f219ec711d1b9dc44d97dfe0cae4bd3b0d8c347
1 parent 7d0d256 commit 227bfac

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

services/surfaceflinger/CompositionEngine/src/Display.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ bool Display::getSkipColorTransform() const {
300300
DisplayCapability::SKIP_CLIENT_COLOR_TRANSFORM);
301301
}
302302

303-
return hwc.hasCapability(Capability::SKIP_CLIENT_COLOR_TRANSFORM);
303+
return Output::getSkipColorTransform();
304304
}
305305

306306
bool Display::allLayersRequireClientComposition() const {

services/surfaceflinger/CompositionEngine/src/Output.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,6 +1714,9 @@ void Output::resetCompositionStrategy() {
17141714
}
17151715

17161716
bool Output::getSkipColorTransform() const {
1717+
// TODO: This needs to be true because the color transform is a global across all displays, but
1718+
// use-cases like screen recording don't want the color transform. Please make color transforms
1719+
// actually a per-display concept :(
17171720
return true;
17181721
}
17191722

services/surfaceflinger/CompositionEngine/tests/DisplayTest.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,6 @@ using DisplayGetSkipColorTransformTest = DisplayWithLayersTestCommon;
689689
using aidl::android::hardware::graphics::composer3::DisplayCapability;
690690

691691
TEST_F(DisplayGetSkipColorTransformTest, checksCapabilityIfGpuDisplay) {
692-
EXPECT_CALL(mHwComposer, hasCapability(Capability::SKIP_CLIENT_COLOR_TRANSFORM))
693-
.WillOnce(Return(true));
694692
auto args = getDisplayCreationArgsForGpuVirtualDisplay();
695693
auto gpuDisplay{impl::createDisplay(mCompositionEngine, args)};
696694
EXPECT_TRUE(gpuDisplay->getSkipColorTransform());

0 commit comments

Comments
 (0)