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

Commit 4a1f8a53 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Rename "commit" to use "present" nomenclature"

parents 516914e6 a87aa7bb
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -620,7 +620,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)) {
@@ -631,15 +631,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
@@ -1488,7 +1488,7 @@ void SurfaceFlinger::postFramebuffer()
        }
        const auto hwcId = displayDevice->getHwcDisplayId();
        if (hwcId >= 0) {
            mHwc->commit(hwcId);
            mHwc->presentAndGetReleaseFences(hwcId);
        }
        displayDevice->onSwapBuffersCompleted();
        displayDevice->makeCurrent(mEGLDisplay, mEGLContext);