diff options
| author | 2025-01-14 16:38:26 -0800 | |
|---|---|---|
| committer | 2025-01-23 12:18:20 -0800 | |
| commit | e2390e8c30b2e0487461d8d979a69cba2a002a64 (patch) | |
| tree | 30c2b35615ee366834571036c6c17e06e4d593c0 | |
| parent | a9bb707579ce78ff55fe68a2353bf0710ec045b2 (diff) | |
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
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 3 | ||||
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.h | 5 |
2 files changed, 2 insertions, 6 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 1038b9f45c..5f79179838 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -3975,9 +3975,6 @@ void SurfaceFlinger::processDisplayAdded(const wp<IBinder>& displayToken, displaySurface, producer); if (mScheduler && !display->isVirtual()) { - // TODO(b/241285876): Annotate `processDisplayAdded` instead. - ftl::FakeGuard guard(kMainThreadContext); - // For hotplug reconnect, renew the registration since display modes have been reloaded. mScheduler->registerDisplay(display->getPhysicalId(), display->holdRefreshRateSelector(), mActiveDisplayId); diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index 158bf57dbc..24de02a7ef 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -350,9 +350,6 @@ protected: // We're reference counted, never destroy SurfaceFlinger directly virtual ~SurfaceFlinger(); - virtual void processDisplayAdded(const wp<IBinder>& displayToken, const DisplayDeviceState&) - REQUIRES(mStateLock); - virtual std::shared_ptr<renderengine::ExternalTexture> getExternalTextureFromBufferData( BufferData& bufferData, const char* layerName, uint64_t transactionId); @@ -1042,6 +1039,8 @@ private: const sp<compositionengine::DisplaySurface>& displaySurface, const sp<IGraphicBufferProducer>& producer) REQUIRES(mStateLock); void processDisplayChangesLocked() REQUIRES(mStateLock, kMainThreadContext); + void processDisplayAdded(const wp<IBinder>& displayToken, const DisplayDeviceState&) + REQUIRES(mStateLock, kMainThreadContext); void processDisplayRemoved(const wp<IBinder>& displayToken) REQUIRES(mStateLock, kMainThreadContext); void processDisplayChanged(const wp<IBinder>& displayToken, |