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

This commit is contained in:
sotaro 2017-10-26 19:40:24 +09:00
parent 6bb51d72d4
commit fa6c47dce5
5 changed files with 22 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

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