From 262dfe35ace7ec8ff511b68788d4c7be7c6e933c Mon Sep 17 00:00:00 2001 From: Giovanni Ricca Date: Sun, 16 Jun 2024 17:00:16 +0200 Subject: [PATCH] LG8n: libshims: Add android::GraphicBufferMapper::unlock shim * Commit Ib4590b7a3b839a993f6c747c5f09a6312f7ab329 modified GraphicBufferMapper::unlock overload. Create a shim to provide the old symbol for blobs that need it Change-Id: I0e90ac0b383b05904df83076d990ad9335a40664 --- libshims/libshim_ui/Android.bp | 1 + libshims/libshim_ui/GraphicBufferMapper.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/libshims/libshim_ui/Android.bp b/libshims/libshim_ui/Android.bp index c0ac3c0..33c0dc5 100644 --- a/libshims/libshim_ui/Android.bp +++ b/libshims/libshim_ui/Android.bp @@ -8,6 +8,7 @@ cc_library_shared { name: "libshim_ui", shared_libs: [ "libui", + "libsync", "libutils", ], srcs: [ diff --git a/libshims/libshim_ui/GraphicBufferMapper.cpp b/libshims/libshim_ui/GraphicBufferMapper.cpp index a3ceffb..23b2c9c 100644 --- a/libshims/libshim_ui/GraphicBufferMapper.cpp +++ b/libshims/libshim_ui/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; +} }