commit | 84f63e2e3e10ed7402010a689b19d67aa7b280c4 | [log] [tgz] |
---|---|---|
author | Tim Zimmermann <tim@linux4.de> | Wed Nov 01 10:38:38 2023 +0100 |
committer | Tim Zimmermann <tim@linux4.de> | Mon Jan 15 17:42:49 2024 +0100 |
tree | 7f3412fb6f6258c700964df53f9a3b3cfb91a7c9 | |
parent | bf1438e1f88378d78fb5be2d32a7d63e5b9d190e [diff] |
exynos: gralloc3: Bring back proper support for GRALLOC_USE_ASHMEM_METADATA * See https://android.googlesource.com/platform/hardware/google/gchips/+/85d965a6394d0a06ba9aa9bd1e04562013c22832%5E%21/#F1 Change-Id: Ibb4fc65f816b31ea5da1d9e1516bc384db32a9c6
diff --git a/gralloc3/src/mali_gralloc_reference.cpp b/gralloc3/src/mali_gralloc_reference.cpp index addbc53..748d0e0 100644 --- a/gralloc3/src/mali_gralloc_reference.cpp +++ b/gralloc3/src/mali_gralloc_reference.cpp
@@ -146,6 +146,17 @@ AERR("Unregistering/Releasing unknown buffer is not supported. Flags = %d", hnd->flags); } +#if GRALLOC_USE_ASHMEM_METADATA == 1 + /* + * Close shared attribute region file descriptor. It might seem strange to "free" + * this here since this can happen in a client process, but free here is nothing + * but unmapping and closing the duplicated file descriptor. The original ashmem + * fd instance is still open until alloc_device_free() is called. Even sharing + * of gralloc buffers within the same process should have fds dup:ed. + */ + gralloc_buffer_attr_free(hnd); +#endif + hnd->base = 0; } }