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

Commit 495a1549 authored by Dan Stoza's avatar Dan Stoza Committed by android-build-merger
Browse files

Merge \"HWC2: Skip validate/present if display is off\" into nyc-mr1-dev

am: 9409a53b

Change-Id: I6f5226370c58c5f1304ab1b46f1c7753bcc11fda
parents 13eb266d 9409a53b
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -1005,7 +1005,12 @@ void SurfaceFlinger::doDebugFlashRegions()
    }

    for (size_t displayId = 0; displayId < mDisplays.size(); ++displayId) {
        status_t result = mDisplays[displayId]->prepareFrame(*mHwc);
        auto& displayDevice = mDisplays[displayId];
        if (!displayDevice->isDisplayOn()) {
            continue;
        }

        status_t result = displayDevice->prepareFrame(*mHwc);
        ALOGE_IF(result != NO_ERROR, "prepareFrame for display %zd failed:"
                " %d (%s)", displayId, result, strerror(-result));
    }
@@ -1229,7 +1234,12 @@ void SurfaceFlinger::setUpHWComposer() {
    }

    for (size_t displayId = 0; displayId < mDisplays.size(); ++displayId) {
        status_t result = mDisplays[displayId]->prepareFrame(*mHwc);
        auto& displayDevice = mDisplays[displayId];
        if (!displayDevice->isDisplayOn()) {
            continue;
        }

        status_t result = displayDevice->prepareFrame(*mHwc);
        ALOGE_IF(result != NO_ERROR, "prepareFrame for display %zd failed:"
                " %d (%s)", displayId, result, strerror(-result));
    }
@@ -1267,6 +1277,9 @@ void SurfaceFlinger::postFramebuffer()

    for (size_t displayId = 0; displayId < mDisplays.size(); ++displayId) {
        auto& displayDevice = mDisplays[displayId];
        if (!displayDevice->isDisplayOn()) {
            continue;
        }
        const auto hwcId = displayDevice->getHwcDisplayId();
        if (hwcId >= 0) {
            mHwc->commit(hwcId);