mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1670543 - Remove fence argument from AndroidHardwareBuffer::Unlock() r=jnicol
The function does not need fence argument. It could be handled within AndroidHardwareBuffer. Though all tested recent Android devices did not return valid fence. AndroidHardwareBuffer usage is not enabled on gecko. Differential Revision: https://phabricator.services.mozilla.com/D93217
This commit is contained in:
parent
88e5d3073e
commit
c74c1e1e13
@ -249,8 +249,25 @@ int AndroidHardwareBuffer::Lock(uint64_t aUsage, const ARect* aRect,
|
||||
aRect, aOutVirtualAddress);
|
||||
}
|
||||
|
||||
int AndroidHardwareBuffer::Unlock(int32_t* aFence) {
|
||||
return AndroidHardwareBufferApi::Get()->Unlock(mNativeBuffer, aFence);
|
||||
int AndroidHardwareBuffer::Unlock() {
|
||||
int rawFd = -1;
|
||||
// XXX All tested recent Android devices did not return valid fence.
|
||||
int ret = AndroidHardwareBufferApi::Get()->Unlock(mNativeBuffer, &rawFd);
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
ipc::FileDescriptor acquireFenceFd;
|
||||
// The value -1 indicates that unlocking has already completed before
|
||||
// the function returned and no further operations are necessary.
|
||||
if (rawFd >= 0) {
|
||||
acquireFenceFd = ipc::FileDescriptor(UniqueFileHandle(rawFd));
|
||||
}
|
||||
|
||||
if (acquireFenceFd.IsValid()) {
|
||||
SetAcquireFence(std::move(acquireFenceFd));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AndroidHardwareBuffer::SendHandleToUnixSocket(int aSocketFd) {
|
||||
|
@ -103,7 +103,7 @@ class AndroidHardwareBuffer
|
||||
virtual ~AndroidHardwareBuffer();
|
||||
|
||||
int Lock(uint64_t aUsage, const ARect* aRect, void** aOutVirtualAddress);
|
||||
int Unlock(int32_t* aFence);
|
||||
int Unlock();
|
||||
|
||||
int SendHandleToUnixSocket(int aSocketFd);
|
||||
|
||||
|
@ -322,7 +322,7 @@ AndroidHardwareBufferTextureData::BorrowDrawTarget() {
|
||||
|
||||
void AndroidHardwareBufferTextureData::OnForwardedToHost() {
|
||||
if (mIsLocked) {
|
||||
mAndroidHardwareBuffer->Unlock(nullptr);
|
||||
mAndroidHardwareBuffer->Unlock();
|
||||
mAddress = nullptr;
|
||||
mIsLocked = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user