Bug 1410766 - Re-acquireDevices in gpu process when SimulateDeviceReset() is called r=dvander

This commit is contained in:
sotaro
2017-11-03 17:06:37 +09:00
parent 8606837a57
commit 42b40bc711
7 changed files with 35 additions and 0 deletions

View File

@@ -330,6 +330,17 @@ GPUParent::RecvGetDeviceStatus(GPUDeviceData* aOut)
return IPC_OK();
}
mozilla::ipc::IPCResult
GPUParent::RecvSimulateDeviceReset(GPUDeviceData* aOut)
{
#if defined(XP_WIN)
DeviceManagerDx::Get()->ForceDeviceReset(ForcedDeviceResetReason::COMPOSITOR_UPDATED);
DeviceManagerDx::Get()->MaybeResetAndReacquireDevices();
#endif
RecvGetDeviceStatus(aOut);
return IPC_OK();
}
mozilla::ipc::IPCResult
GPUParent::RecvNewContentCompositorManager(Endpoint<PCompositorManagerParent>&& aEndpoint)
{

View File

@@ -48,6 +48,7 @@ public:
mozilla::ipc::IPCResult RecvNewContentVRManager(Endpoint<PVRManagerParent>&& aEndpoint) override;
mozilla::ipc::IPCResult RecvNewContentVideoDecoderManager(Endpoint<PVideoDecoderManagerParent>&& aEndpoint) override;
mozilla::ipc::IPCResult RecvGetDeviceStatus(GPUDeviceData* aOutStatus) override;
mozilla::ipc::IPCResult RecvSimulateDeviceReset(GPUDeviceData* aOutStatus) override;
mozilla::ipc::IPCResult RecvAddLayerTreeIdMapping(const LayerTreeIdMapping& aMapping) override;
mozilla::ipc::IPCResult RecvRemoveLayerTreeIdMapping(const LayerTreeIdMapping& aMapping) override;
mozilla::ipc::IPCResult RecvNotifyGpuObservers(const nsCString& aTopic) override;

View File

@@ -421,6 +421,10 @@ GPUProcessManager::SimulateDeviceReset()
gfxPlatform::GetPlatform()->CompositorUpdated();
if (mProcess) {
GPUDeviceData data;
if (mGPUChild->SendSimulateDeviceReset(&data)) {
gfxPlatform::GetPlatform()->ImportGPUDeviceData(data);
}
OnRemoteProcessDeviceReset(mProcess);
} else {
OnInProcessDeviceReset();

View File

@@ -80,6 +80,10 @@ parent:
// one is available (i.e., Init has completed).
sync GetDeviceStatus() returns (GPUDeviceData status);
// Request to simulate device reset and to get the updated DeviceStatus from
// the GPU process. This blocks until one is available (i.e., Init has completed).
sync SimulateDeviceReset() returns (GPUDeviceData status);
// Have a message be broadcasted to the GPU process by the GPU process
// observer service.
async NotifyGpuObservers(nsCString aTopic);

View File

@@ -623,6 +623,18 @@ Compositor::SetDispAcquireFence(Layer* aLayer)
{
}
void
Compositor::UnlockAfterComposition(TextureHost* aTexture)
{
TextureSourceProvider::UnlockAfterComposition(aTexture);
// If this is being called after we shutdown the compositor, we must finish
// read unlocking now to prevent a cycle.
if (IsDestroyed()) {
ReadUnlockTextures();
}
}
bool
Compositor::NotifyNotUsedAfterComposition(TextureHost* aTextureHost)
{

View File

@@ -467,6 +467,7 @@ public:
return mLastCompositionEndTime;
}
void UnlockAfterComposition(TextureHost* aTexture) override;
bool NotifyNotUsedAfterComposition(TextureHost* aTextureHost) override;
/**

View File

@@ -930,6 +930,8 @@ description =
description =
[PGPU::GetDeviceStatus]
description =
[PGPU::SimulateDeviceReset]
description =
[PAPZCTreeManager::ReceiveMultiTouchInputEvent]
description =
[PAPZCTreeManager::ReceiveMouseInputEvent]