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

Commit f03ef88a authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SF: Remove flag check for modesetting lock" into main

parents 9accf30e 76cbf5be
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -1420,8 +1420,6 @@ status_t SurfaceFlinger::setActiveModeFromBackdoor(const sp<display::DisplayToke
    return future.get();
}

// TODO: b/241285876 - Restore thread safety analysis once mStateLock below is unconditional.
[[clang::no_thread_safety_analysis]]
void SurfaceFlinger::finalizeDisplayModeChange(PhysicalDisplayId displayId) {
    SFTRACE_NAME(ftl::Concat(__func__, ' ', displayId.value).c_str());

@@ -1437,8 +1435,6 @@ void SurfaceFlinger::finalizeDisplayModeChange(PhysicalDisplayId displayId) {
    if (const auto oldResolution =
                mDisplayModeController.getActiveMode(displayId).modePtr->getResolution();
        oldResolution != activeMode.modePtr->getResolution()) {
        ConditionalLock lock(mStateLock, !FlagManager::getInstance().connected_display());

        auto& state = mCurrentState.displays.editValueFor(getPhysicalDisplayTokenLocked(displayId));
        // We need to generate new sequenceId in order to recreate the display (and this
        // way the framebuffer).
@@ -2599,7 +2595,7 @@ bool SurfaceFlinger::commit(PhysicalDisplayId pacesetterId,
    }

    {
        ConditionalLock lock(mStateLock, FlagManager::getInstance().connected_display());
        Mutex::Autolock lock(mStateLock);

        for (const auto [displayId, _] : frameTargets) {
            if (mDisplayModeController.isModeSetPending(displayId)) {
@@ -2702,13 +2698,6 @@ bool SurfaceFlinger::commit(PhysicalDisplayId pacesetterId,
        mScheduler->chooseRefreshRateForContent(&mLayerHierarchyBuilder.getHierarchy(),
                                                updateAttachedChoreographer);

        if (FlagManager::getInstance().connected_display()) {
            initiateDisplayModeChanges();
        }
    }

    if (!FlagManager::getInstance().connected_display()) {
        ftl::FakeGuard guard(mStateLock);
        initiateDisplayModeChanges();
    }