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

Commit a87aa7bb authored by Fabien Sanglard's avatar Fabien Sanglard
Browse files

Rename "commit" to use "present" nomenclature

We use "present" down the HWC2, commit is a confusing name.

Change-Id: I7b23edaf4aeab807bc523e31dfcb8e716166d849
parent 8487e531
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -615,7 +615,7 @@ sp<Fence> HWComposer::getLayerReleaseFence(int32_t displayId,
    return displayFences[layer];
}

status_t HWComposer::commit(int32_t displayId) {
status_t HWComposer::presentAndGetReleaseFences(int32_t displayId) {
    ATRACE_CALL();

    if (!isValidDisplay(displayId)) {
@@ -626,15 +626,16 @@ status_t HWComposer::commit(int32_t displayId) {
    auto& hwcDisplay = displayData.hwcDisplay;
    auto error = hwcDisplay->present(&displayData.lastRetireFence);
    if (error != HWC2::Error::None) {
        ALOGE("commit: present failed for display %d: %s (%d)", displayId,
                to_string(error).c_str(), static_cast<int32_t>(error));
        ALOGE("presentAndGetReleaseFences: failed for display %d: %s (%d)",
              displayId, to_string(error).c_str(), static_cast<int32_t>(error));
        return UNKNOWN_ERROR;
    }

    std::unordered_map<std::shared_ptr<HWC2::Layer>, sp<Fence>> releaseFences;
    error = hwcDisplay->getReleaseFences(&releaseFences);
    if (error != HWC2::Error::None) {
        ALOGE("commit: Failed to get release fences for display %d: %s (%d)",
        ALOGE("presentAndGetReleaseFences: Failed to get release fences "
              "for display %d: %s (%d)",
                displayId, to_string(error).c_str(),
                static_cast<int32_t>(error));
        return UNKNOWN_ERROR;
+2 −2
Original line number Diff line number Diff line
@@ -97,8 +97,8 @@ public:
    status_t setClientTarget(int32_t displayId, const sp<Fence>& acquireFence,
            const sp<GraphicBuffer>& target, android_dataspace_t dataspace);

    // Finalize the layers and present them
    status_t commit(int32_t displayId);
    // Present layers to the display and read releaseFences.
    status_t presentAndGetReleaseFences(int32_t displayId);

    // set power mode
    status_t setPowerMode(int32_t displayId, int mode);
+1 −1
Original line number Diff line number Diff line
@@ -1463,7 +1463,7 @@ void SurfaceFlinger::postFramebuffer()
        }
        const auto hwcId = displayDevice->getHwcDisplayId();
        if (hwcId >= 0) {
            mHwc->commit(hwcId);
            mHwc->presentAndGetReleaseFences(hwcId);
        }
        displayDevice->onSwapBuffersCompleted();
        displayDevice->makeCurrent(mEGLDisplay, mEGLContext);