From c69c85fcad3d9433ad4099ed0372d1613fb8b082 Mon Sep 17 00:00:00 2001 From: Giovanni Ricca Date: Sun, 16 Jun 2024 17:00:16 +0200 Subject: [PATCH] libui: Add GraphicBufferMapper::unlock shims * Commit Ib4590b7a3b839a993f6c747c5f09a6312f7ab329 modified GraphicBufferMapper::unlock overload. Create a shim to provide the old symbol for blobs that need it Change-Id: I0e90ac0b383b05904df83076d990ad9335a40664 --- Android.bp | 1 + libui/GraphicBufferMapper.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/Android.bp b/Android.bp index 28889b4..75375be 100644 --- a/Android.bp +++ b/Android.bp @@ -396,6 +396,7 @@ cc_library_shared { name: "libui_shim", shared_libs: [ "libui", + "libsync", "libutils", ], srcs: [ diff --git a/libui/GraphicBufferMapper.cpp b/libui/GraphicBufferMapper.cpp index a3ceffb..23b2c9c 100644 --- a/libui/GraphicBufferMapper.cpp +++ b/libui/GraphicBufferMapper.cpp @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -19,4 +20,16 @@ status_t _ZN7android19GraphicBufferMapper4lockEPK13native_handlejRKNS_4RectEPPvP auto* gpm = static_cast(thisptr); return gpm->lock(handle, usage, bounds, vaddr); } + +status_t _ZN7android19GraphicBufferMapper6unlockEPK13native_handle(void* thisptr, + buffer_handle_t handle) { + android::base::unique_fd outFence; + auto* gpm = static_cast(thisptr); + status_t status = gpm->unlock(handle, &outFence); + if (status == android::OK && outFence.get() >= 0) { + sync_wait(outFence.get(), -1); + outFence.reset(); + } + return status; +} }