Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 90553da7 authored by Brian Lindahl's avatar Brian Lindahl
Browse files

Clear HWC layer buffer slots by assiging a placeholder buffer

When buffers are discarded by SurfaceFlinger clients, the memory should
be free'd immediately. This includes clearing references to them from
within the implementation of Composer HAL, specifically in cache slots
associated with the layer.

Since there is no HAL API to clear the slot directly, prior to writing
any other buffer to the layer, we set the layer's buffer multiple times
to a placeholder buffer, using each of the slot numbers that need to be
cleared. This replaces the reference to the client-discarded buffer
inside Composer HAL with a reference to the placeholder buffer, causing
the reference count to drop, allowing the buffer memory to be freed.

Bug: 258196272
Test: atest OutputLayerUncacheBufferTest
Change-Id: Id85482e8859490566f0eedbd8d8729c47a7349fb
parent d1d22742
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment