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

Commit 11d0fc38 authored by Fabien Sanglard's avatar Fabien Sanglard
Browse files

Rename "retire" to "present" for consistency

The HWC2 model has no concept of retire fence beyond HWC2to1Adapter
All references to "retire" fence should be called "present"

Change-Id: I26540aad9e65f138a4df60a34eaee030f1c17567
parent d46a65c3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ void FramebufferSurface::freeBufferLocked(int slotIndex) {
void FramebufferSurface::onFrameCommitted() {
#ifdef USE_HWC2
    if (mHasPendingRelease) {
        sp<Fence> fence = mHwc.getRetireFence(mDisplayType);
        sp<Fence> fence = mHwc.getPresentFence(mDisplayType);
        if (fence->isValid()) {
            status_t result = addReleaseFence(mPreviousBufferSlot,
                    mPreviousBuffer, fence);
+5 −5
Original line number Diff line number Diff line
@@ -924,21 +924,21 @@ Error Display::getReleaseFences(
    return Error::None;
}

Error Display::present(sp<Fence>* outRetireFence)
Error Display::present(sp<Fence>* outPresentFence)
{
    int32_t retireFenceFd = 0;
    int32_t presentFenceFd = 0;
#ifdef BYPASS_IHWC
    int32_t intError = mDevice.mPresentDisplay(mDevice.mHwcDevice, mId,
            &retireFenceFd);
            &presentFenceFd);
#else
    auto intError = mDevice.mComposer->presentDisplay(mId, retireFenceFd);
    auto intError = mDevice.mComposer->presentDisplay(mId, presentFenceFd);
#endif
    auto error = static_cast<Error>(intError);
    if (error != Error::None) {
        return error;
    }

    *outRetireFence = new Fence(retireFenceFd);
    *outPresentFence = new Fence(presentFenceFd);
    return Error::None;
}

+1 −1
Original line number Diff line number Diff line
@@ -313,7 +313,7 @@ public:
            std::unordered_map<std::shared_ptr<Layer>,
                    android::sp<android::Fence>>* outFences) const;
    [[clang::warn_unused_result]] Error present(
            android::sp<android::Fence>* outRetireFence);
            android::sp<android::Fence>* outPresentFence);
    [[clang::warn_unused_result]] Error setActiveConfig(
            const std::shared_ptr<const Config>& config);
    [[clang::warn_unused_result]] Error setClientTarget(
+5 −5
Original line number Diff line number Diff line
@@ -594,12 +594,12 @@ bool HWComposer::hasClientComposition(int32_t displayId) const {
    return mDisplayData[displayId].hasClientComposition;
}

sp<Fence> HWComposer::getRetireFence(int32_t displayId) const {
sp<Fence> HWComposer::getPresentFence(int32_t displayId) const {
    if (!isValidDisplay(displayId)) {
        ALOGE("getRetireFence failed for invalid display %d", displayId);
        ALOGE("getPresentFence failed for invalid display %d", displayId);
        return Fence::NO_FENCE;
    }
    return mDisplayData[displayId].lastRetireFence;
    return mDisplayData[displayId].lastPresentFence;
}

bool HWComposer::retireFenceRepresentsStartOfScanout() const {
@@ -629,7 +629,7 @@ status_t HWComposer::presentAndGetReleaseFences(int32_t displayId) {

    auto& displayData = mDisplayData[displayId];
    auto& hwcDisplay = displayData.hwcDisplay;
    auto error = hwcDisplay->present(&displayData.lastRetireFence);
    auto error = hwcDisplay->present(&displayData.lastPresentFence);
    if (error != HWC2::Error::None) {
        ALOGE("presentAndGetReleaseFences: failed for display %d: %s (%d)",
              displayId, to_string(error).c_str(), static_cast<int32_t>(error));
@@ -879,7 +879,7 @@ HWComposer::DisplayData::DisplayData()
  : hasClientComposition(false),
    hasDeviceComposition(false),
    hwcDisplay(),
    lastRetireFence(Fence::NO_FENCE),
    lastPresentFence(Fence::NO_FENCE),
    outbufHandle(nullptr),
    outbufAcquireFence(Fence::NO_FENCE),
    vsyncEnabled(HWC2::Vsync::Disable) {
+3 −4
Original line number Diff line number Diff line
@@ -118,9 +118,8 @@ public:
    // does this display have layers handled by GLES
    bool hasClientComposition(int32_t displayId) const;

    // get the retire fence for the previous frame (i.e., corresponding to the
    // last call to presentDisplay
    sp<Fence> getRetireFence(int32_t displayId) const;
    // get the present fence received from the last call to present.
    sp<Fence> getPresentFence(int32_t displayId) const;

    // Returns true if the retire fence represents the start of the display
    // controller's scan out. This should be true for all HWC2 implementations,
@@ -191,7 +190,7 @@ private:
        bool hasDeviceComposition;
        std::shared_ptr<HWC2::Display> hwcDisplay;
        HWC2::DisplayRequest displayRequests;
        sp<Fence> lastRetireFence;  // signals when the last set op retires
        sp<Fence> lastPresentFence;  // signals when the last set op retires
        std::unordered_map<std::shared_ptr<HWC2::Layer>, sp<Fence>>
                releaseFences;
        buffer_handle_t outbufHandle;
Loading