зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1313281 - Part 2: Remove DeliverFence. r=sotaro
This commit is contained in:
Родитель
bda6eacad9
Коммит
db63ec0ace
|
@ -156,28 +156,6 @@ TextureHost::GetIPDLActor()
|
|||
return mActor;
|
||||
}
|
||||
|
||||
bool
|
||||
TextureHost::SetReleaseFenceHandle(const FenceHandle& aReleaseFenceHandle)
|
||||
{
|
||||
if (!aReleaseFenceHandle.IsValid()) {
|
||||
// HWC might not provide Fence.
|
||||
// In this case, HWC implicitly handles buffer's fence.
|
||||
return false;
|
||||
}
|
||||
|
||||
mReleaseFenceHandle.Merge(aReleaseFenceHandle);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
FenceHandle
|
||||
TextureHost::GetAndResetReleaseFenceHandle()
|
||||
{
|
||||
FenceHandle fence;
|
||||
mReleaseFenceHandle.TransferToAnotherFenceHandle(fence);
|
||||
return fence;
|
||||
}
|
||||
|
||||
void
|
||||
TextureHost::SetAcquireFenceHandle(const FenceHandle& aAcquireFenceHandle)
|
||||
{
|
||||
|
|
|
@ -586,17 +586,6 @@ public:
|
|||
|
||||
int NumCompositableRefs() const { return mCompositableCount; }
|
||||
|
||||
/**
|
||||
* Store a fence that will signal when the current buffer is no longer being read.
|
||||
* Similar to android's GLConsumer::setReleaseFence()
|
||||
*/
|
||||
bool SetReleaseFenceHandle(const FenceHandle& aReleaseFenceHandle);
|
||||
|
||||
/**
|
||||
* Return a releaseFence's Fence and clear a reference to the Fence.
|
||||
*/
|
||||
FenceHandle GetAndResetReleaseFenceHandle();
|
||||
|
||||
void SetAcquireFenceHandle(const FenceHandle& aAcquireFenceHandle);
|
||||
|
||||
/**
|
||||
|
@ -610,8 +599,6 @@ public:
|
|||
|
||||
virtual bool NeedsFenceHandle() { return false; }
|
||||
|
||||
virtual FenceHandle GetCompositorReleaseFence() { return FenceHandle(); }
|
||||
|
||||
void DeserializeReadLock(const ReadLockDescriptor& aDesc,
|
||||
ISurfaceAllocator* aAllocator);
|
||||
|
||||
|
@ -624,8 +611,6 @@ public:
|
|||
protected:
|
||||
void ReadUnlock();
|
||||
|
||||
FenceHandle mReleaseFenceHandle;
|
||||
|
||||
FenceHandle mAcquireFenceHandle;
|
||||
|
||||
void RecycleTexture(TextureFlags aFlags);
|
||||
|
|
|
@ -876,12 +876,6 @@ CompositorBridgeChild::RecvParentAsyncMessages(InfallibleTArray<AsyncParentMessa
|
|||
const AsyncParentMessageData& message = aMessages[i];
|
||||
|
||||
switch (message.type()) {
|
||||
case AsyncParentMessageData::TOpDeliverFence: {
|
||||
const OpDeliverFence& op = message.get_OpDeliverFence();
|
||||
FenceHandle fence = op.fence();
|
||||
DeliverFence(op.TextureId(), fence);
|
||||
break;
|
||||
}
|
||||
case AsyncParentMessageData::TOpNotifyNotUsed: {
|
||||
const OpNotifyNotUsed& op = message.get_OpNotifyNotUsed();
|
||||
NotifyNotUsed(op.TextureId(), op.fwdTransactionId());
|
||||
|
@ -949,16 +943,6 @@ CompositorBridgeChild::NotifyNotUsed(uint64_t aTextureId, uint64_t aFwdTransacti
|
|||
mTexturesWaitingRecycled.Remove(aTextureId);
|
||||
}
|
||||
|
||||
void
|
||||
CompositorBridgeChild::DeliverFence(uint64_t aTextureId, FenceHandle& aReleaseFenceHandle)
|
||||
{
|
||||
RefPtr<TextureClient> client = mTexturesWaitingRecycled.Get(aTextureId);
|
||||
if (!client) {
|
||||
return;
|
||||
}
|
||||
client->SetReleaseFenceHandle(aReleaseFenceHandle);
|
||||
}
|
||||
|
||||
void
|
||||
CompositorBridgeChild::CancelWaitForRecycle(uint64_t aTextureId)
|
||||
{
|
||||
|
|
|
@ -189,8 +189,6 @@ public:
|
|||
*/
|
||||
void NotifyNotUsed(uint64_t aTextureId, uint64_t aFwdTransactionId);
|
||||
|
||||
void DeliverFence(uint64_t aTextureId, FenceHandle& aReleaseFenceHandle);
|
||||
|
||||
virtual void CancelWaitForRecycle(uint64_t aTextureId) override;
|
||||
|
||||
TextureClientPool* GetTexturePool(KnowsCompositor* aAllocator,
|
||||
|
|
|
@ -118,7 +118,6 @@ CompositorBridgeParentBase::NotifyNotUsed(PTextureParent* aTexture, uint64_t aTr
|
|||
}
|
||||
|
||||
if (texture->GetFlags() & TextureFlags::RECYCLE) {
|
||||
SendFenceHandleIfPresent(aTexture);
|
||||
uint64_t textureId = TextureHost::GetTextureSerial(aTexture);
|
||||
mPendingAsyncMessage.push_back(
|
||||
OpNotifyNotUsed(textureId, aTransactionId));
|
||||
|
|
|
@ -24,34 +24,6 @@ mozilla::ipc::SharedMemory::SharedMemoryType OptimalShmemType()
|
|||
return ipc::SharedMemory::SharedMemoryType::TYPE_BASIC;
|
||||
}
|
||||
|
||||
void
|
||||
HostIPCAllocator::SendFenceHandleIfPresent(PTextureParent* aTexture)
|
||||
{
|
||||
RefPtr<TextureHost> texture = TextureHost::AsTextureHost(aTexture);
|
||||
if (!texture) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(texture->GetFlags() & TextureFlags::RECYCLE) &&
|
||||
!texture->NeedsFenceHandle()) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint64_t textureId = TextureHost::GetTextureSerial(aTexture);
|
||||
|
||||
// Send a ReleaseFence of CompositorOGL.
|
||||
FenceHandle fence = texture->GetCompositorReleaseFence();
|
||||
if (fence.IsValid()) {
|
||||
mPendingAsyncMessage.push_back(OpDeliverFence(textureId, fence));
|
||||
}
|
||||
|
||||
// Send a ReleaseFence that is set to TextureHost by HwcComposer2D.
|
||||
fence = texture->GetAndResetReleaseFenceHandle();
|
||||
if (fence.IsValid()) {
|
||||
mPendingAsyncMessage.push_back(OpDeliverFence(textureId, fence));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
HostIPCAllocator::SendPendingAsyncMessages()
|
||||
{
|
||||
|
|
|
@ -136,8 +136,6 @@ public:
|
|||
|
||||
virtual void SendAsyncMessage(const InfallibleTArray<AsyncParentMessageData>& aMessage) = 0;
|
||||
|
||||
void SendFenceHandleIfPresent(PTextureParent* aTexture);
|
||||
|
||||
virtual void SendPendingAsyncMessages();
|
||||
|
||||
virtual void SetAboutToSendAsyncMessages()
|
||||
|
|
|
@ -245,16 +245,6 @@ ImageBridgeChild::NotifyNotUsed(uint64_t aTextureId, uint64_t aFwdTransactionId)
|
|||
mTexturesWaitingRecycled.Remove(aTextureId);
|
||||
}
|
||||
|
||||
void
|
||||
ImageBridgeChild::DeliverFence(uint64_t aTextureId, FenceHandle& aReleaseFenceHandle)
|
||||
{
|
||||
RefPtr<TextureClient> client = mTexturesWaitingRecycled.Get(aTextureId);
|
||||
if (!client) {
|
||||
return;
|
||||
}
|
||||
client->SetReleaseFenceHandle(aReleaseFenceHandle);
|
||||
}
|
||||
|
||||
void
|
||||
ImageBridgeChild::HoldUntilFenceHandleDelivery(TextureClient* aClient, uint64_t aTransactionId)
|
||||
{
|
||||
|
@ -265,15 +255,6 @@ ImageBridgeChild::HoldUntilFenceHandleDelivery(TextureClient* aClient, uint64_t
|
|||
NS_RUNTIMEABORT("not reached");
|
||||
}
|
||||
|
||||
void
|
||||
ImageBridgeChild::DeliverFenceToNonRecycle(uint64_t aTextureId, FenceHandle& aReleaseFenceHandle)
|
||||
{
|
||||
// XXX Re-enable fence handling
|
||||
return;
|
||||
|
||||
NS_RUNTIMEABORT("not reached");
|
||||
}
|
||||
|
||||
void
|
||||
ImageBridgeChild::NotifyNotUsedToNonRecycle(uint64_t aTextureId, uint64_t aTransactionId)
|
||||
{
|
||||
|
@ -1201,23 +1182,6 @@ ImageBridgeChild::RecvParentAsyncMessages(InfallibleTArray<AsyncParentMessageDat
|
|||
const AsyncParentMessageData& message = aMessages[i];
|
||||
|
||||
switch (message.type()) {
|
||||
case AsyncParentMessageData::TOpDeliverFence: {
|
||||
const OpDeliverFence& op = message.get_OpDeliverFence();
|
||||
FenceHandle fence = op.fence();
|
||||
DeliverFence(op.TextureId(), fence);
|
||||
break;
|
||||
}
|
||||
case AsyncParentMessageData::TOpDeliverFenceToNonRecycle: {
|
||||
// Notify ReleaseCompositableRef to a TextureClient that belongs to
|
||||
// LayerTransactionChild. It is used only on gonk to deliver fence to
|
||||
// a TextureClient that does not have TextureFlags::RECYCLE.
|
||||
// In this case, LayerTransactionChild's ipc could not be used to deliver fence.
|
||||
|
||||
const OpDeliverFenceToNonRecycle& op = message.get_OpDeliverFenceToNonRecycle();
|
||||
FenceHandle fence = op.fence();
|
||||
DeliverFenceToNonRecycle(op.TextureId(), fence);
|
||||
break;
|
||||
}
|
||||
case AsyncParentMessageData::TOpNotifyNotUsed: {
|
||||
const OpNotifyNotUsed& op = message.get_OpNotifyNotUsed();
|
||||
NotifyNotUsed(op.TextureId(), op.fwdTransactionId());
|
||||
|
|
|
@ -291,12 +291,8 @@ public:
|
|||
*/
|
||||
void NotifyNotUsed(uint64_t aTextureId, uint64_t aFwdTransactionId);
|
||||
|
||||
void DeliverFence(uint64_t aTextureId, FenceHandle& aReleaseFenceHandle);
|
||||
|
||||
void HoldUntilFenceHandleDelivery(TextureClient* aClient, uint64_t aTransactionId);
|
||||
|
||||
void DeliverFenceToNonRecycle(uint64_t aTextureId, FenceHandle& aReleaseFenceHandle);
|
||||
|
||||
void NotifyNotUsedToNonRecycle(uint64_t aTextureId, uint64_t aTransactionId);
|
||||
|
||||
void CancelWaitFenceHandle(TextureClient* aClient);
|
||||
|
|
|
@ -407,34 +407,6 @@ bool ImageBridgeParent::IsSameProcess() const
|
|||
return OtherPid() == base::GetCurrentProcId();
|
||||
}
|
||||
|
||||
void
|
||||
ImageBridgeParent::SendFenceHandleToNonRecycle(PTextureParent* aTexture)
|
||||
{
|
||||
RefPtr<TextureHost> texture = TextureHost::AsTextureHost(aTexture);
|
||||
if (!texture) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(texture->GetFlags() & TextureFlags::RECYCLE) &&
|
||||
!texture->NeedsFenceHandle()) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint64_t textureId = TextureHost::GetTextureSerial(aTexture);
|
||||
|
||||
// Send a ReleaseFence of CompositorOGL.
|
||||
FenceHandle fence = texture->GetCompositorReleaseFence();
|
||||
if (fence.IsValid()) {
|
||||
mPendingAsyncMessage.push_back(OpDeliverFenceToNonRecycle(textureId, fence));
|
||||
}
|
||||
|
||||
// Send a ReleaseFence that is set to TextureHost by HwcComposer2D.
|
||||
fence = texture->GetAndResetReleaseFenceHandle();
|
||||
if (fence.IsValid()) {
|
||||
mPendingAsyncMessage.push_back(OpDeliverFenceToNonRecycle(textureId, fence));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ImageBridgeParent::NotifyNotUsedToNonRecycle(PTextureParent* aTexture,
|
||||
uint64_t aTransactionId)
|
||||
|
@ -449,8 +421,6 @@ ImageBridgeParent::NotifyNotUsedToNonRecycle(PTextureParent* aTexture,
|
|||
return;
|
||||
}
|
||||
|
||||
SendFenceHandleToNonRecycle(aTexture);
|
||||
|
||||
uint64_t textureId = TextureHost::GetTextureSerial(aTexture);
|
||||
mPendingAsyncMessage.push_back(
|
||||
OpNotifyNotUsedToNonRecycle(textureId, aTransactionId));
|
||||
|
@ -502,7 +472,6 @@ ImageBridgeParent::NotifyNotUsed(PTextureParent* aTexture, uint64_t aTransaction
|
|||
return;
|
||||
}
|
||||
|
||||
SendFenceHandleIfPresent(aTexture);
|
||||
uint64_t textureId = TextureHost::GetTextureSerial(aTexture);
|
||||
mPendingAsyncMessage.push_back(
|
||||
OpNotifyNotUsed(textureId, aTransactionId));
|
||||
|
|
|
@ -113,8 +113,6 @@ public:
|
|||
|
||||
virtual bool IsSameProcess() const override;
|
||||
|
||||
void SendFenceHandleToNonRecycle(PTextureParent* aTexture);
|
||||
|
||||
void NotifyNotUsedToNonRecycle(PTextureParent* aTexture,
|
||||
uint64_t aTransactionId);
|
||||
|
||||
|
|
|
@ -416,16 +416,6 @@ union MaybeRegion {
|
|||
null_t;
|
||||
};
|
||||
|
||||
struct OpDeliverFence {
|
||||
uint64_t TextureId;
|
||||
FenceHandle fence;
|
||||
};
|
||||
|
||||
struct OpDeliverFenceToNonRecycle {
|
||||
uint64_t TextureId;
|
||||
FenceHandle fence;
|
||||
};
|
||||
|
||||
struct OpNotifyNotUsed {
|
||||
uint64_t TextureId;
|
||||
uint64_t fwdTransactionId;
|
||||
|
@ -514,8 +504,6 @@ union EditReply {
|
|||
};
|
||||
|
||||
union AsyncParentMessageData {
|
||||
OpDeliverFence;
|
||||
OpDeliverFenceToNonRecycle;
|
||||
OpNotifyNotUsed;
|
||||
OpNotifyNotUsedToNonRecycle;
|
||||
};
|
||||
|
|
|
@ -319,12 +319,6 @@ VRManagerChild::RecvParentAsyncMessages(InfallibleTArray<AsyncParentMessageData>
|
|||
const AsyncParentMessageData& message = aMessages[i];
|
||||
|
||||
switch (message.type()) {
|
||||
case AsyncParentMessageData::TOpDeliverFence: {
|
||||
const OpDeliverFence& op = message.get_OpDeliverFence();
|
||||
FenceHandle fence = op.fence();
|
||||
DeliverFence(op.TextureId(), fence);
|
||||
break;
|
||||
}
|
||||
case AsyncParentMessageData::TOpNotifyNotUsed: {
|
||||
const OpNotifyNotUsed& op = message.get_OpNotifyNotUsed();
|
||||
NotifyNotUsed(op.TextureId(), op.fwdTransactionId());
|
||||
|
@ -347,16 +341,6 @@ VRManagerChild::CreateTexture(const SurfaceDescriptor& aSharedData,
|
|||
return SendPTextureConstructor(aSharedData, aLayersBackend, aFlags, aSerial);
|
||||
}
|
||||
|
||||
void
|
||||
VRManagerChild::DeliverFence(uint64_t aTextureId, FenceHandle& aReleaseFenceHandle)
|
||||
{
|
||||
RefPtr<TextureClient> client = mTexturesWaitingRecycled.Get(aTextureId);
|
||||
if (!client) {
|
||||
return;
|
||||
}
|
||||
client->SetReleaseFenceHandle(aReleaseFenceHandle);
|
||||
}
|
||||
|
||||
void
|
||||
VRManagerChild::CancelWaitForRecycle(uint64_t aTextureId)
|
||||
{
|
||||
|
|
|
@ -144,8 +144,6 @@ private:
|
|||
void FireDOMVRDisplayConnectEventInternal();
|
||||
void FireDOMVRDisplayDisconnectEventInternal();
|
||||
void FireDOMVRDisplayPresentChangeEventInternal();
|
||||
|
||||
void DeliverFence(uint64_t aTextureId, FenceHandle& aReleaseFenceHandle);
|
||||
/**
|
||||
* Notify id of Texture When host side end its use. Transaction id is used to
|
||||
* make sure if there is no newer usage.
|
||||
|
|
Загрузка…
Ссылка в новой задаче