Loading services/surfaceflinger/Android.bp +0 −1 Original line number Diff line number Diff line Loading @@ -166,7 +166,6 @@ filegroup { "FrameTracer/FrameTracer.cpp", "FrameTracker.cpp", "HdrLayerInfoReporter.cpp", "HwcSlotGenerator.cpp", "WindowInfosListenerInvoker.cpp", "Layer.cpp", "LayerFE.cpp", Loading services/surfaceflinger/ClientCache.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -118,7 +118,8 @@ ClientCache::add(const client_cache_t& cacheId, const sp<GraphicBuffer>& buffer) Usage::READABLE)); } void ClientCache::erase(const client_cache_t& cacheId) { sp<GraphicBuffer> ClientCache::erase(const client_cache_t& cacheId) { sp<GraphicBuffer> buffer; auto& [processToken, id] = cacheId; std::vector<sp<ErasedRecipient>> pendingErase; { Loading @@ -126,9 +127,11 @@ void ClientCache::erase(const client_cache_t& cacheId) { ClientCacheBuffer* buf = nullptr; if (!getBuffer(cacheId, &buf)) { ALOGE("failed to erase buffer, could not retrieve buffer"); return; return nullptr; } buffer = buf->buffer->getBuffer(); for (auto& recipient : buf->recipients) { sp<ErasedRecipient> erasedRecipient = recipient.promote(); if (erasedRecipient) { Loading @@ -142,6 +145,7 @@ void ClientCache::erase(const client_cache_t& cacheId) { for (auto& recipient : pendingErase) { recipient->bufferErased(cacheId); } return buffer; } std::shared_ptr<renderengine::ExternalTexture> ClientCache::get(const client_cache_t& cacheId) { Loading services/surfaceflinger/ClientCache.h +13 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,17 @@ namespace android { // This class manages a cache of buffer handles between SurfaceFlinger clients // and the SurfaceFlinger process which optimizes away some of the cost of // sending buffer handles across processes. // // Buffers are explicitly cached and uncached by the SurfaceFlinger client. When // a buffer is uncached, it is not only purged from this cache, but the buffer // ID is also passed down to CompositionEngine to purge it from a similar cache // used between SurfaceFlinger and Composer HAL. The buffer ID used to purge // both the SurfaceFlinger side of this other cache, as well as Composer HAL's // side of the cache. // class ClientCache : public Singleton<ClientCache> { public: ClientCache(); Loading @@ -41,7 +52,8 @@ public: base::expected<std::shared_ptr<renderengine::ExternalTexture>, AddError> add( const client_cache_t& cacheId, const sp<GraphicBuffer>& buffer); void erase(const client_cache_t& cacheId); sp<GraphicBuffer> erase(const client_cache_t& cacheId); std::shared_ptr<renderengine::ExternalTexture> get(const client_cache_t& cacheId); Loading services/surfaceflinger/CompositionEngine/include/compositionengine/CompositionRefreshArgs.h +3 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,9 @@ struct CompositionRefreshArgs { // All the layers that have queued updates. Layers layersWithQueuedFrames; // All graphic buffers that will no longer be used and should be removed from caches. std::vector<uint64_t> bufferIdsToUncache; // Controls how the color mode is chosen for an output OutputColorSetting outputColorSetting{OutputColorSetting::kEnhanced}; Loading services/surfaceflinger/CompositionEngine/include/compositionengine/LayerFECompositionState.h +0 −1 Original line number Diff line number Diff line Loading @@ -163,7 +163,6 @@ struct LayerFECompositionState { // The buffer and related state sp<GraphicBuffer> buffer; int bufferSlot{BufferQueue::INVALID_BUFFER_SLOT}; sp<Fence> acquireFence = Fence::NO_FENCE; Region surfaceDamage; uint64_t frameNumber = 0; Loading Loading
services/surfaceflinger/Android.bp +0 −1 Original line number Diff line number Diff line Loading @@ -166,7 +166,6 @@ filegroup { "FrameTracer/FrameTracer.cpp", "FrameTracker.cpp", "HdrLayerInfoReporter.cpp", "HwcSlotGenerator.cpp", "WindowInfosListenerInvoker.cpp", "Layer.cpp", "LayerFE.cpp", Loading
services/surfaceflinger/ClientCache.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -118,7 +118,8 @@ ClientCache::add(const client_cache_t& cacheId, const sp<GraphicBuffer>& buffer) Usage::READABLE)); } void ClientCache::erase(const client_cache_t& cacheId) { sp<GraphicBuffer> ClientCache::erase(const client_cache_t& cacheId) { sp<GraphicBuffer> buffer; auto& [processToken, id] = cacheId; std::vector<sp<ErasedRecipient>> pendingErase; { Loading @@ -126,9 +127,11 @@ void ClientCache::erase(const client_cache_t& cacheId) { ClientCacheBuffer* buf = nullptr; if (!getBuffer(cacheId, &buf)) { ALOGE("failed to erase buffer, could not retrieve buffer"); return; return nullptr; } buffer = buf->buffer->getBuffer(); for (auto& recipient : buf->recipients) { sp<ErasedRecipient> erasedRecipient = recipient.promote(); if (erasedRecipient) { Loading @@ -142,6 +145,7 @@ void ClientCache::erase(const client_cache_t& cacheId) { for (auto& recipient : pendingErase) { recipient->bufferErased(cacheId); } return buffer; } std::shared_ptr<renderengine::ExternalTexture> ClientCache::get(const client_cache_t& cacheId) { Loading
services/surfaceflinger/ClientCache.h +13 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,17 @@ namespace android { // This class manages a cache of buffer handles between SurfaceFlinger clients // and the SurfaceFlinger process which optimizes away some of the cost of // sending buffer handles across processes. // // Buffers are explicitly cached and uncached by the SurfaceFlinger client. When // a buffer is uncached, it is not only purged from this cache, but the buffer // ID is also passed down to CompositionEngine to purge it from a similar cache // used between SurfaceFlinger and Composer HAL. The buffer ID used to purge // both the SurfaceFlinger side of this other cache, as well as Composer HAL's // side of the cache. // class ClientCache : public Singleton<ClientCache> { public: ClientCache(); Loading @@ -41,7 +52,8 @@ public: base::expected<std::shared_ptr<renderengine::ExternalTexture>, AddError> add( const client_cache_t& cacheId, const sp<GraphicBuffer>& buffer); void erase(const client_cache_t& cacheId); sp<GraphicBuffer> erase(const client_cache_t& cacheId); std::shared_ptr<renderengine::ExternalTexture> get(const client_cache_t& cacheId); Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/CompositionRefreshArgs.h +3 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,9 @@ struct CompositionRefreshArgs { // All the layers that have queued updates. Layers layersWithQueuedFrames; // All graphic buffers that will no longer be used and should be removed from caches. std::vector<uint64_t> bufferIdsToUncache; // Controls how the color mode is chosen for an output OutputColorSetting outputColorSetting{OutputColorSetting::kEnhanced}; Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/LayerFECompositionState.h +0 −1 Original line number Diff line number Diff line Loading @@ -163,7 +163,6 @@ struct LayerFECompositionState { // The buffer and related state sp<GraphicBuffer> buffer; int bufferSlot{BufferQueue::INVALID_BUFFER_SLOT}; sp<Fence> acquireFence = Fence::NO_FENCE; Region surfaceDamage; uint64_t frameNumber = 0; Loading