Skip to content

Commit e2390e8

Browse files
author
Dennis Kiilerich
committed
Lock all of SurfaceFlinger::processDisplayAdded for kMainThreadContext instead of just a portion of it.
Also make processDisplayAdded private and not virtual. Test: Manual testing BUG: 241285876 Flag: EXEMPT refactor Change-Id: I50d9e07e52d753713db11883f9cfbfcf245d2cca
1 parent a9bb707 commit e2390e8

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3975,9 +3975,6 @@ void SurfaceFlinger::processDisplayAdded(const wp<IBinder>& displayToken,
39753975
displaySurface, producer);
39763976

39773977
if (mScheduler && !display->isVirtual()) {
3978-
// TODO(b/241285876): Annotate `processDisplayAdded` instead.
3979-
ftl::FakeGuard guard(kMainThreadContext);
3980-
39813978
// For hotplug reconnect, renew the registration since display modes have been reloaded.
39823979
mScheduler->registerDisplay(display->getPhysicalId(), display->holdRefreshRateSelector(),
39833980
mActiveDisplayId);

services/surfaceflinger/SurfaceFlinger.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,6 @@ class SurfaceFlinger : public BnSurfaceComposer,
350350
// We're reference counted, never destroy SurfaceFlinger directly
351351
virtual ~SurfaceFlinger();
352352

353-
virtual void processDisplayAdded(const wp<IBinder>& displayToken, const DisplayDeviceState&)
354-
REQUIRES(mStateLock);
355-
356353
virtual std::shared_ptr<renderengine::ExternalTexture> getExternalTextureFromBufferData(
357354
BufferData& bufferData, const char* layerName, uint64_t transactionId);
358355

@@ -1042,6 +1039,8 @@ class SurfaceFlinger : public BnSurfaceComposer,
10421039
const sp<compositionengine::DisplaySurface>& displaySurface,
10431040
const sp<IGraphicBufferProducer>& producer) REQUIRES(mStateLock);
10441041
void processDisplayChangesLocked() REQUIRES(mStateLock, kMainThreadContext);
1042+
void processDisplayAdded(const wp<IBinder>& displayToken, const DisplayDeviceState&)
1043+
REQUIRES(mStateLock, kMainThreadContext);
10451044
void processDisplayRemoved(const wp<IBinder>& displayToken)
10461045
REQUIRES(mStateLock, kMainThreadContext);
10471046
void processDisplayChanged(const wp<IBinder>& displayToken,

0 commit comments

Comments
 (0)