Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 227bfac9 authored by Alec Mouri's avatar Alec Mouri
Browse files

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
parent 7d0d256b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -300,7 +300,7 @@ bool Display::getSkipColorTransform() const {
                                        DisplayCapability::SKIP_CLIENT_COLOR_TRANSFORM);
    }

    return hwc.hasCapability(Capability::SKIP_CLIENT_COLOR_TRANSFORM);
    return Output::getSkipColorTransform();
}

bool Display::allLayersRequireClientComposition() const {
+3 −0
Original line number Diff line number Diff line
@@ -1714,6 +1714,9 @@ void Output::resetCompositionStrategy() {
}

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

+0 −2
Original line number Diff line number Diff line
@@ -689,8 +689,6 @@ using DisplayGetSkipColorTransformTest = DisplayWithLayersTestCommon;
using aidl::android::hardware::graphics::composer3::DisplayCapability;

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