Skip to content

Commit f03ef88

Browse files
Treehugger RobotAndroid (Google) Code Review
authored andcommitted
Merge "SF: Remove flag check for modesetting lock" into main
2 parents 9accf30 + 76cbf5b commit f03ef88

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
@@ -1420,8 +1420,6 @@ status_t SurfaceFlinger::setActiveModeFromBackdoor(const sp<display::DisplayToke
14201420
return future.get();
14211421
}
14221422

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

@@ -1437,8 +1435,6 @@ void SurfaceFlinger::finalizeDisplayModeChange(PhysicalDisplayId displayId) {
14371435
if (const auto oldResolution =
14381436
mDisplayModeController.getActiveMode(displayId).modePtr->getResolution();
14391437
oldResolution != activeMode.modePtr->getResolution()) {
1440-
ConditionalLock lock(mStateLock, !FlagManager::getInstance().connected_display());
1441-
14421438
auto& state = mCurrentState.displays.editValueFor(getPhysicalDisplayTokenLocked(displayId));
14431439
// We need to generate new sequenceId in order to recreate the display (and this
14441440
// way the framebuffer).
@@ -2599,7 +2595,7 @@ bool SurfaceFlinger::commit(PhysicalDisplayId pacesetterId,
25992595
}
26002596

26012597
{
2602-
ConditionalLock lock(mStateLock, FlagManager::getInstance().connected_display());
2598+
Mutex::Autolock lock(mStateLock);
26032599

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

2705-
if (FlagManager::getInstance().connected_display()) {
2706-
initiateDisplayModeChanges();
2707-
}
2708-
}
2709-
2710-
if (!FlagManager::getInstance().connected_display()) {
2711-
ftl::FakeGuard guard(mStateLock);
27122701
initiateDisplayModeChanges();
27132702
}
27142703

0 commit comments

Comments
 (0)