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

Commit f9750f28 authored by Dominik Laskowski's avatar Dominik Laskowski
Browse files

SF: Remove DisplayData constructor/destructor

Bug: 74619554
Test: Build
Change-Id: I3e60b8d7978917035d00241a2d9f15d9d756ab96
parent e62926e6
Loading
Loading
Loading
Loading
+2 −24
Original line number Diff line number Diff line
@@ -725,7 +725,7 @@ void HWComposer::disconnectDisplay(int displayId) {

    const auto hwcDisplayId = displayData.hwcDisplay->getId();
    mHwcDisplaySlots.erase(hwcDisplayId);
    displayData.reset();
    displayData = DisplayData();

    mHwcDevice->destroyDisplay(hwcDisplayId);
}
@@ -833,26 +833,4 @@ HWComposer::getHwcDisplayId(int32_t displayId) const {
    return mDisplayData[displayId].hwcDisplay->getId();
}

// ---------------------------------------------------------------------------

HWComposer::DisplayData::DisplayData()
  : hasClientComposition(false),
    hasDeviceComposition(false),
    hwcDisplay(nullptr),
    lastPresentFence(Fence::NO_FENCE),
    outbufHandle(nullptr),
    outbufAcquireFence(Fence::NO_FENCE),
    vsyncEnabled(HWC2::Vsync::Disable) {
    ALOGV("Created new DisplayData");
}

HWComposer::DisplayData::~DisplayData() {
}

void HWComposer::DisplayData::reset() {
    ALOGV("DisplayData reset");
    *this = DisplayData();
}

// ---------------------------------------------------------------------------
}; // namespace android
} // namespace android
+7 −11
Original line number Diff line number Diff line
@@ -197,23 +197,19 @@ private:
    struct cb_context;

    struct DisplayData {
        DisplayData();
        ~DisplayData();
        void reset();

        bool hasClientComposition;
        bool hasDeviceComposition;
        HWC2::Display* hwcDisplay;
        bool hasClientComposition = false;
        bool hasDeviceComposition = false;
        HWC2::Display* hwcDisplay = nullptr;
        HWC2::DisplayRequest displayRequests;
        sp<Fence> lastPresentFence;  // signals when the last set op retires
        sp<Fence> lastPresentFence = Fence::NO_FENCE; // signals when the last set op retires
        std::unordered_map<HWC2::Layer*, sp<Fence>> releaseFences;
        buffer_handle_t outbufHandle;
        sp<Fence> outbufAcquireFence;
        buffer_handle_t outbufHandle = nullptr;
        sp<Fence> outbufAcquireFence = Fence::NO_FENCE;
        mutable std::unordered_map<int32_t,
                std::shared_ptr<const HWC2::Display::Config>> configMap;

        // protected by mVsyncLock
        HWC2::Vsync vsyncEnabled;
        HWC2::Vsync vsyncEnabled = HWC2::Vsync::Disable;

        bool validateWasSkipped;
        HWC2::Error presentError;
+1 −1
Original line number Diff line number Diff line
@@ -232,7 +232,7 @@ public:
            display->mutableIsConnected() = true;

            ASSERT_TRUE(flinger->mutableHwcDisplayData().size() > static_cast<size_t>(mType));
            flinger->mutableHwcDisplayData()[mType].reset();
            flinger->mutableHwcDisplayData()[mType] = HWComposer::DisplayData();
            flinger->mutableHwcDisplayData()[mType].hwcDisplay = display.get();
            flinger->mutableHwcDisplaySlots().emplace(mHwcDisplayId, mType);