Make uncache buffer transactions oneway.
Buffers that were previously sent to SurfaceFlinger have a death callback attached which sends a transaction to SurfaceFlinger to remove the buffer from SurfaceFlinger's caches for prompt memory cleanup. Originally, this transaction was applied synchronously, which contributes to performance issues when the producer side of a BlastBufferQueue disconnects and destroys all buffers in the queue. This is particularly problematic when: 1. the producer is a media decoder which tend to allocate 20+ buffers, and: 2. the disconnect happens on the UI thread, which is typical when using SurfaceView with RecyclerView for a scrolling list of videos which is a common UX for contemporary social media applications. On some devices, the synchronous binder calls can be more expensive for CPU walltime than freeing the backing memory for the buffers. Marking these transactions as one-way will reduce the risk of UI jank. Bug: 248533454 Test: Test application with SurfaceView scrolling + media playback Change-Id: Ie5c50f2eb6c65f3c8652df84a91c2116327b8c0e
Loading
Please register or sign in to comment