Skip to content

Commit 76cbf5b

Browse files
author
Dominik Laskowski
committed
SF: Remove flag check for modesetting lock
Ie15de10d16eefeb65289574b120d2ef4cc09d6c0, which restored mStateLock for modesetting to fix races that led to crashes and broken scheduling, was flagged to the rolled-out connected_display flag, such that the feature could be rolled back if needed. Now that the fix has soaked, remove the race-prone code path that is no longer taken. Bug: 255635711 Flag: EXEMPT removing connected_display Test: Build Change-Id: Ib535e92906fb2d8be2bc70b9af29805a00d40e90
1 parent 225c2c8 commit 76cbf5b

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,8 +1418,6 @@ status_t SurfaceFlinger::setActiveModeFromBackdoor(const sp<display::DisplayToke
14181418
return future.get();
14191419
}
14201420

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

@@ -1435,8 +1433,6 @@ void SurfaceFlinger::finalizeDisplayModeChange(PhysicalDisplayId displayId) {
14351433
if (const auto oldResolution =
14361434
mDisplayModeController.getActiveMode(displayId).modePtr->getResolution();
14371435
oldResolution != activeMode.modePtr->getResolution()) {
1438-
ConditionalLock lock(mStateLock, !FlagManager::getInstance().connected_display());
1439-
14401436
auto& state = mCurrentState.displays.editValueFor(getPhysicalDisplayTokenLocked(displayId));
14411437
// We need to generate new sequenceId in order to recreate the display (and this
14421438
// way the framebuffer).
@@ -2597,7 +2593,7 @@ bool SurfaceFlinger::commit(PhysicalDisplayId pacesetterId,
25972593
}
25982594

25992595
{
2600-
ConditionalLock lock(mStateLock, FlagManager::getInstance().connected_display());
2596+
Mutex::Autolock lock(mStateLock);
26012597

26022598
for (const auto [displayId, _] : frameTargets) {
26032599
if (mDisplayModeController.isModeSetPending(displayId)) {
@@ -2700,13 +2696,6 @@ bool SurfaceFlinger::commit(PhysicalDisplayId pacesetterId,
27002696
mScheduler->chooseRefreshRateForContent(&mLayerHierarchyBuilder.getHierarchy(),
27012697
updateAttachedChoreographer);
27022698

2703-
if (FlagManager::getInstance().connected_display()) {
2704-
initiateDisplayModeChanges();
2705-
}
2706-
}
2707-
2708-
if (!FlagManager::getInstance().connected_display()) {
2709-
ftl::FakeGuard guard(mStateLock);
27102699
initiateDisplayModeChanges();
27112700
}
27122701

0 commit comments

Comments
 (0)