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

Commit 5fae4a6f authored by Sally Qi's avatar Sally Qi
Browse files

[Lut] pfd refactor

Bug: 380894872
Test: builds
Flag: EXEMPT small refactor

Change-Id: Ia72407cba0307dc5e881dd1a5345fd46ffb2b7c8
parent 50098249
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ public:

    // Applies a HWC device layer lut
    virtual void applyDeviceLayerLut(
            ndk::ScopedFileDescriptor,
            ::android::base::unique_fd,
            std::vector<std::pair<
                    int, aidl::android::hardware::graphics::composer3::LutProperties>>) = 0;

+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ public:
            aidl::android::hardware::graphics::composer3::Composition) override;
    void prepareForDeviceLayerRequests() override;
    void applyDeviceLayerRequest(Hwc2::IComposerClient::LayerRequest request) override;
    void applyDeviceLayerLut(ndk::ScopedFileDescriptor,
    void applyDeviceLayerLut(::android::base::unique_fd,
                             std::vector<std::pair<int, LutProperties>>) override;
    bool needsFiltering() const override;
    std::optional<LayerFE::LayerSettings> getOverrideCompositionSettings() const override;
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ public:
    MOCK_CONST_METHOD0(needsFiltering, bool());
    MOCK_CONST_METHOD0(getOverrideCompositionSettings, std::optional<LayerFE::LayerSettings>());
    MOCK_METHOD(void, applyDeviceLayerLut,
                (ndk::ScopedFileDescriptor,
                (::android::base::unique_fd,
                 (std::vector<std::pair<
                          int, aidl::android::hardware::graphics::composer3::LutProperties>>)));
    MOCK_METHOD(int64_t, getPictureProfilePriority, (), (const));
+1 −1
Original line number Diff line number Diff line
@@ -373,7 +373,7 @@ void Display::applyLayerLutsToLayers(const LayerLuts& layerLuts) {

        if (auto lutsIt = layerLuts.find(hwcLayer); lutsIt != layerLuts.end()) {
            if (auto mapperIt = mapper.find(hwcLayer); mapperIt != mapper.end()) {
                layer->applyDeviceLayerLut(ndk::ScopedFileDescriptor(mapperIt->second.release()),
                layer->applyDeviceLayerLut(::android::base::unique_fd(mapperIt->second.release()),
                                           lutsIt->second);
            }
        }
+5 −5
Original line number Diff line number Diff line
@@ -619,7 +619,7 @@ void OutputLayer::writeLutToHWC(HWC2::Layer* hwcLayer,
                                          lutProperties[i].samplingKey)}});
        }

        luts.pfd = ndk::ScopedFileDescriptor(dup(lutFileDescriptor.get()));
        luts.pfd.set(dup(lutFileDescriptor.get()));
        luts.offsets = lutOffsets;
        luts.lutProperties = std::move(aidlProperties);
    }
@@ -1006,7 +1006,7 @@ void OutputLayer::applyDeviceLayerRequest(hal::LayerRequest request) {
}

void OutputLayer::applyDeviceLayerLut(
        ndk::ScopedFileDescriptor lutFileDescriptor,
        ::android::base::unique_fd lutFd,
        std::vector<std::pair<int, LutProperties>> lutOffsetsAndProperties) {
    auto& state = editState();
    LOG_FATAL_IF(!state.hwc);
@@ -1025,9 +1025,9 @@ void OutputLayer::applyDeviceLayerLut(
            samplingKeys.emplace_back(static_cast<int32_t>(properties.samplingKeys[0]));
        }
    }
    hwcState.luts = std::make_shared<gui::DisplayLuts>(base::unique_fd(lutFileDescriptor.release()),
                                                       std::move(offsets), std::move(dimensions),
                                                       std::move(sizes), std::move(samplingKeys));
    hwcState.luts = std::make_shared<gui::DisplayLuts>(std::move(lutFd), std::move(offsets),
                                                       std::move(dimensions), std::move(sizes),
                                                       std::move(samplingKeys));
}

bool OutputLayer::needsFiltering() const {
Loading