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

Commit f5f380b7 authored by Sally Qi's avatar Sally Qi Committed by Android (Google) Code Review
Browse files

Revert "[Lut backend] Fix a bug where we were passing a nullptr to the HWC...

Revert "[Lut backend] Fix a bug where we were passing a nullptr to the HWC when we wanted to clear the LUTs."

This reverts commit 36349ac2.

Reason for revert: b/380934766

Change-Id: Ief97218a7f1c37338939ff7ea61e41b39ca496c8
parent 36349ac2
Loading
Loading
Loading
Loading
+20 −22
Original line number Diff line number Diff line
@@ -589,10 +589,9 @@ void OutputLayer::writeOutputIndependentGeometryStateToHWC(

void OutputLayer::writeLutToHWC(HWC2::Layer* hwcLayer,
                                const LayerFECompositionState& outputIndependentState) {
    Luts luts;
    // if outputIndependentState.luts is nullptr, it means we want to clear the LUTs
    // and we pass an empty Luts object to the HWC.
    if (outputIndependentState.luts) {
    if (!outputIndependentState.luts) {
        return;
    }
    auto& lutFileDescriptor = outputIndependentState.luts->getLutFileDescriptor();
    auto lutOffsets = outputIndependentState.luts->offsets;
    auto& lutProperties = outputIndependentState.luts->lutProperties;
@@ -608,11 +607,10 @@ void OutputLayer::writeLutToHWC(HWC2::Layer* hwcLayer,
        aidlProperties.emplace_back(properties);
    }


    Luts luts;
    luts.pfd = ndk::ScopedFileDescriptor(dup(lutFileDescriptor.get()));
    luts.offsets = lutOffsets;
    luts.lutProperties = std::move(aidlProperties);
    }

    switch (auto error = hwcLayer->setLuts(luts)) {
        case hal::Error::NONE:
+0 −1
Original line number Diff line number Diff line
@@ -901,7 +901,6 @@ struct OutputLayerWriteStateToHWCTest : public OutputLayerTest {
        EXPECT_CALL(*mHwcLayer, setSurfaceDamage(RegionEq(surfaceDamage))).WillOnce(Return(kError));
        EXPECT_CALL(*mHwcLayer, setBlockingRegion(RegionEq(blockingRegion)))
                .WillOnce(Return(kError));
        EXPECT_CALL(*mHwcLayer, setLuts(_)).WillOnce(Return(kError));
    }

    void expectSetCompositionTypeCall(Composition compositionType) {