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

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

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

Merge "Revert "[Lut backend] Fix a bug where we were passing a nullptr to the HWC when we wanted to clear the LUTs."" into main
parents 06883bbb f5f380b7
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) {