mirror of
https://github.com/Anything-at-25-00/android_device_tecno_LG8n.git
synced 2024-11-22 21:56:26 -08:00
262dfe35ac
* Commit Ib4590b7a3b839a993f6c747c5f09a6312f7ab329 modified GraphicBufferMapper::unlock overload. Create a shim to provide the old symbol for blobs that need it Change-Id: I0e90ac0b383b05904df83076d990ad9335a40664
36 lines
1.1 KiB
C++
36 lines
1.1 KiB
C++
/*
|
|
* Copyright (C) 2024 The LineageOS Project
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <stdint.h>
|
|
#include <sync/sync.h>
|
|
#include <ui/GraphicBufferMapper.h>
|
|
#include <ui/Rect.h>
|
|
#include <utils/Errors.h>
|
|
|
|
using android::Rect;
|
|
using android::status_t;
|
|
|
|
extern "C" {
|
|
status_t _ZN7android19GraphicBufferMapper4lockEPK13native_handlejRKNS_4RectEPPvPiS9_(
|
|
void* thisptr, buffer_handle_t handle, uint32_t usage, const Rect& bounds, void** vaddr,
|
|
int32_t* /*outBytesPerPixel*/, int32_t* /*outBytesPerStride*/) {
|
|
auto* gpm = static_cast<android::GraphicBufferMapper*>(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<android::GraphicBufferMapper*>(thisptr);
|
|
status_t status = gpm->unlock(handle, &outFence);
|
|
if (status == android::OK && outFence.get() >= 0) {
|
|
sync_wait(outFence.get(), -1);
|
|
outFence.reset();
|
|
}
|
|
return status;
|
|
}
|
|
}
|