diff options
| -rw-r--r-- | libs/android_runtime_lazy/Android.bp | 1 | ||||
| -rw-r--r-- | libs/graphicsenv/Android.bp | 1 | ||||
| -rw-r--r-- | libs/gui/SurfaceComposerClient.cpp | 8 | ||||
| -rw-r--r-- | libs/vr/libbufferhub/Android.bp | 6 | ||||
| -rw-r--r-- | libs/vr/libbufferhubqueue/Android.bp | 3 | ||||
| -rw-r--r-- | libs/vr/libdvr/tests/Android.bp | 3 | ||||
| -rw-r--r-- | libs/vr/libvrflinger/tests/Android.bp | 3 | ||||
| -rw-r--r-- | services/surfaceflinger/Scheduler/EventThread.cpp | 2 | ||||
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 11 | ||||
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.h | 1 | ||||
| -rw-r--r-- | services/surfaceflinger/tests/unittests/EventThreadTest.cpp | 6 | ||||
| -rw-r--r-- | services/vr/bufferhubd/Android.bp | 3 | ||||
| -rw-r--r-- | vulkan/libvulkan/Android.bp | 1 |
13 files changed, 28 insertions, 21 deletions
diff --git a/libs/android_runtime_lazy/Android.bp b/libs/android_runtime_lazy/Android.bp index b200314fed..9284acbff3 100644 --- a/libs/android_runtime_lazy/Android.bp +++ b/libs/android_runtime_lazy/Android.bp @@ -33,6 +33,7 @@ cc_library { name: "libandroid_runtime_lazy", vendor_available: true, + double_loadable: true, cflags: [ "-Wall", diff --git a/libs/graphicsenv/Android.bp b/libs/graphicsenv/Android.bp index 0571dccfdc..56521bf2b4 100644 --- a/libs/graphicsenv/Android.bp +++ b/libs/graphicsenv/Android.bp @@ -27,6 +27,7 @@ cc_library_shared { "libbase", "libbinder", "libcutils", + "libdl_android", "liblog", "libutils", ], diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index 84aed5f51c..c627898ce2 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -406,10 +406,16 @@ void SurfaceComposerClient::Transaction::cacheBuffers() { continue; } + // Don't try to cache a null buffer. Sending null buffers is cheap so we shouldn't waste + // time trying to cache them. + if (!s->buffer) { + continue; + } + uint64_t cacheId = 0; status_t ret = BufferCache::getInstance().getCacheId(s->buffer, &cacheId); if (ret == NO_ERROR) { - s->what &= ~static_cast<uint32_t>(layer_state_t::eBufferChanged); + s->what &= ~static_cast<uint64_t>(layer_state_t::eBufferChanged); s->buffer = nullptr; } else { cacheId = BufferCache::getInstance().cache(s->buffer); diff --git a/libs/vr/libbufferhub/Android.bp b/libs/vr/libbufferhub/Android.bp index fa928308cf..6d202aec05 100644 --- a/libs/vr/libbufferhub/Android.bp +++ b/libs/vr/libbufferhub/Android.bp @@ -59,9 +59,6 @@ cc_library { "libbufferhub_headers", "libnativebase_headers", ], - - // TODO(b/117568153): Temporarily opt out using libcrt. - no_libcrt: true, } cc_test { @@ -70,7 +67,4 @@ cc_test { shared_libs: sharedLibraries, header_libs: headerLibraries, name: "buffer_hub-test", - - // TODO(b/117568153): Temporarily opt out using libcrt. - no_libcrt: true, } diff --git a/libs/vr/libbufferhubqueue/Android.bp b/libs/vr/libbufferhubqueue/Android.bp index 20894e3588..9f72c05f0c 100644 --- a/libs/vr/libbufferhubqueue/Android.bp +++ b/libs/vr/libbufferhubqueue/Android.bp @@ -59,9 +59,6 @@ cc_library_shared { static_libs: staticLibraries, shared_libs: sharedLibraries, header_libs: headerLibraries, - - // TODO(b/117568153): Temporarily opt out using libcrt. - no_libcrt: true, } subdirs = ["benchmarks", "tests"] diff --git a/libs/vr/libdvr/tests/Android.bp b/libs/vr/libdvr/tests/Android.bp index 357dffe193..3260447390 100644 --- a/libs/vr/libdvr/tests/Android.bp +++ b/libs/vr/libdvr/tests/Android.bp @@ -49,9 +49,6 @@ cc_test { "-g", ], name: "dvr_api-test", - - // TODO(b/117568153): Temporarily opt out using libcrt. - no_libcrt: true, } cc_test { diff --git a/libs/vr/libvrflinger/tests/Android.bp b/libs/vr/libvrflinger/tests/Android.bp index c884cb3cfe..410e2344ce 100644 --- a/libs/vr/libvrflinger/tests/Android.bp +++ b/libs/vr/libvrflinger/tests/Android.bp @@ -33,7 +33,4 @@ cc_test { "-Werror", ], name: "vrflinger_test", - - // TODO(b/117568153): Temporarily opt out using libcrt. - no_libcrt: true, } diff --git a/services/surfaceflinger/Scheduler/EventThread.cpp b/services/surfaceflinger/Scheduler/EventThread.cpp index 78bf7c5c49..a760079069 100644 --- a/services/surfaceflinger/Scheduler/EventThread.cpp +++ b/services/surfaceflinger/Scheduler/EventThread.cpp @@ -97,7 +97,7 @@ DisplayEventReceiver::Event makeVSync(PhysicalDisplayId displayId, nsecs_t times return event; } -DisplayEventReceiver::Event makeConfigChanged(uint32_t displayId, int32_t configId) { +DisplayEventReceiver::Event makeConfigChanged(PhysicalDisplayId displayId, int32_t configId) { DisplayEventReceiver::Event event; event.header = {DisplayEventReceiver::DISPLAY_EVENT_CONFIG_CHANGED, displayId, systemTime()}; event.config.configId = configId; diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index f7e4afd01d..fae4b8168e 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -280,6 +280,7 @@ SurfaceFlinger::SurfaceFlinger(surfaceflinger::Factory& factory, mFactory(factory), mTransactionPending(false), mAnimTransactionPending(false), + mTraversalNeededMainThread(false), mLayersRemoved(false), mLayersAdded(false), mBootTime(systemTime()), @@ -2782,7 +2783,7 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) * (perform the transaction for each of them if needed) */ - if (transactionFlags & eTraversalNeeded) { + if ((transactionFlags & eTraversalNeeded) || mTraversalNeededMainThread) { mCurrentState.traverseInZOrder([&](Layer* layer) { uint32_t trFlags = layer->getTransactionFlags(eTransactionNeeded); if (!trFlags) return; @@ -2795,6 +2796,7 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) mInputInfoChanged = true; } }); + mTraversalNeededMainThread = false; } /* @@ -3682,6 +3684,13 @@ void SurfaceFlinger::applyTransactionState(const Vector<ComposerState>& states, transactionFlags = eTransactionNeeded; } + // If we are on the main thread, we are about to preform a traversal. Clear the traversal bit + // so we don't have to wake up again next frame to preform an uneeded traversal. + if (isMainThread && (transactionFlags & eTraversalNeeded)) { + transactionFlags = transactionFlags & (~eTraversalNeeded); + mTraversalNeededMainThread = true; + } + if (transactionFlags) { if (mInterceptor->isEnabled()) { mInterceptor->saveTransaction(states, mCurrentState.displays, displays, flags); diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index 141af73af4..3d8b6b791a 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -963,6 +963,7 @@ private: bool mTransactionPending; bool mAnimTransactionPending; SortedVector< sp<Layer> > mLayersPendingRemoval; + bool mTraversalNeededMainThread; // guards access to the mDrawing state if tracing is enabled. mutable std::mutex mDrawingStateLock; diff --git a/services/surfaceflinger/tests/unittests/EventThreadTest.cpp b/services/surfaceflinger/tests/unittests/EventThreadTest.cpp index 406ec81ce4..249c78f09c 100644 --- a/services/surfaceflinger/tests/unittests/EventThreadTest.cpp +++ b/services/surfaceflinger/tests/unittests/EventThreadTest.cpp @@ -38,6 +38,7 @@ namespace { constexpr PhysicalDisplayId INTERNAL_DISPLAY_ID = 111; constexpr PhysicalDisplayId EXTERNAL_DISPLAY_ID = 222; +constexpr PhysicalDisplayId DISPLAY_ID_64BIT = 0xabcd12349876fedcULL; class MockVSyncSource : public VSyncSource { public: @@ -470,5 +471,10 @@ TEST_F(EventThreadTest, postConfigChangedExternal) { expectConfigChangedEventReceivedByConnection(EXTERNAL_DISPLAY_ID, 5); } +TEST_F(EventThreadTest, postConfigChangedPrimary64bit) { + mThread->onConfigChanged(DISPLAY_ID_64BIT, 7); + expectConfigChangedEventReceivedByConnection(DISPLAY_ID_64BIT, 7); +} + } // namespace } // namespace android diff --git a/services/vr/bufferhubd/Android.bp b/services/vr/bufferhubd/Android.bp index 4e24a64691..afb30043ef 100644 --- a/services/vr/bufferhubd/Android.bp +++ b/services/vr/bufferhubd/Android.bp @@ -44,9 +44,6 @@ cc_library_static { static_libs: [ "libbufferhub", ], - - // TODO(b/117568153): Temporarily opt out using libcrt. - no_libcrt: true, } cc_binary { diff --git a/vulkan/libvulkan/Android.bp b/vulkan/libvulkan/Android.bp index 206c8eb379..71a120a896 100644 --- a/vulkan/libvulkan/Android.bp +++ b/vulkan/libvulkan/Android.bp @@ -76,6 +76,7 @@ cc_library_shared { "libhardware", "libsync", "libbase", + "libdl_android", "libhidlbase", "libhidltransport", "liblog", |