mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1163681 - Fix fence handling r=mwu
This commit is contained in:
parent
bb8bdad0fd
commit
98078d2a0e
@ -315,18 +315,27 @@ GonkDisplayJB::DequeueBuffer()
|
||||
return static_cast<ANativeWindowBuffer*>(mBootAnimBuffer.get());
|
||||
}
|
||||
ANativeWindowBuffer *buf;
|
||||
mSTClient->dequeueBuffer(mSTClient.get(), &buf, &mFence);
|
||||
int fenceFd = -1;
|
||||
mSTClient->dequeueBuffer(mSTClient.get(), &buf, &fenceFd);
|
||||
sp<Fence> fence(new Fence(fenceFd));
|
||||
#if ANDROID_VERSION == 17
|
||||
fence->waitForever(1000, "GonkDisplayJB_DequeueBuffer");
|
||||
// 1000 is what Android uses. It is a warning timeout in ms.
|
||||
// This timeout was removed in ANDROID_VERSION 18.
|
||||
#else
|
||||
fence->waitForever("GonkDisplayJB_DequeueBuffer");
|
||||
#endif
|
||||
return buf;
|
||||
}
|
||||
|
||||
bool
|
||||
GonkDisplayJB::QueueBuffer(ANativeWindowBuffer* buf)
|
||||
{
|
||||
bool success = Post(buf->handle, -1);
|
||||
int error = 0;
|
||||
if (!mBootAnimBuffer.get()) {
|
||||
error = mSTClient->queueBuffer(mSTClient.get(), buf, mFence);
|
||||
error = mSTClient->queueBuffer(mSTClient.get(), buf, -1);
|
||||
}
|
||||
bool success = Post(mDispSurface->lastHandle, mDispSurface->GetPrevDispAcquireFd());
|
||||
return error == 0 && success;
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,6 @@ private:
|
||||
android::sp<ANativeWindow> mSTClient;
|
||||
android::sp<android::IGraphicBufferAlloc> mAlloc;
|
||||
android::sp<android::GraphicBuffer> mBootAnimBuffer;
|
||||
int mFence;
|
||||
hwc_display_contents_1_t* mList;
|
||||
uint32_t mWidth;
|
||||
uint32_t mHeight;
|
||||
|
Loading…
Reference in New Issue
Block a user