Bug 1352376 - Update device data while processing device reset; r?dvander draft
authorKevin Chen <kechen@mozilla.com>
Wed, 05 Apr 2017 15:17:36 +0800
changeset 559393 9ffd9bc96831de1ffbe52f95ab318d23745d8f5e
parent 559392 a1e5043844f295aa8f9a70517b7b76e34fecc634
child 623373 ed5aae993fbefa67da7a00773f78063bb75b309c
push id53071
push userbmo:kechen@mozilla.com
push dateMon, 10 Apr 2017 02:34:40 +0000
reviewersdvander
bugs1352376
milestone55.0a1
Bug 1352376 - Update device data while processing device reset; r?dvander MozReview-Commit-ID: 9sqdRhsX5HU
gfx/ipc/GPUChild.cpp
gfx/ipc/GPUChild.h
gfx/ipc/GPUParent.cpp
gfx/ipc/PGPU.ipdl
--- a/gfx/ipc/GPUChild.cpp
+++ b/gfx/ipc/GPUChild.cpp
@@ -193,18 +193,19 @@ GPUChild::RecvUpdateChildKeyedScalars(In
 mozilla::ipc::IPCResult
 GPUChild::RecvRecordChildEvents(nsTArray<mozilla::Telemetry::ChildEventData>&& aEvents)
 {
   TelemetryIPC::RecordChildEvents(GeckoProcessType_GPU, aEvents);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
-GPUChild::RecvNotifyDeviceReset()
+GPUChild::RecvNotifyDeviceReset(const GPUDeviceData& aData)
 {
+  gfxPlatform::GetPlatform()->ImportGPUDeviceData(aData);
   mHost->mListener->OnProcessDeviceReset(mHost);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 GPUChild::RecvProfile(const nsCString& aProfile)
 {
 #ifdef MOZ_GECKO_PROFILER
--- a/gfx/ipc/GPUChild.h
+++ b/gfx/ipc/GPUChild.h
@@ -55,17 +55,17 @@ public:
   mozilla::ipc::IPCResult RecvAccumulateChildKeyedHistograms(InfallibleTArray<KeyedAccumulation>&& aAccumulations) override;
   mozilla::ipc::IPCResult RecvUpdateChildScalars(InfallibleTArray<ScalarAction>&& aScalarActions) override;
   mozilla::ipc::IPCResult RecvUpdateChildKeyedScalars(InfallibleTArray<KeyedScalarAction>&& aScalarActions) override;
   mozilla::ipc::IPCResult RecvRecordChildEvents(nsTArray<ChildEventData>&& events) override;
 
   void ActorDestroy(ActorDestroyReason aWhy) override;
   mozilla::ipc::IPCResult RecvGraphicsError(const nsCString& aError) override;
   mozilla::ipc::IPCResult RecvNotifyUiObservers(const nsCString& aTopic) override;
-  mozilla::ipc::IPCResult RecvNotifyDeviceReset() override;
+  mozilla::ipc::IPCResult RecvNotifyDeviceReset(const GPUDeviceData& aData) override;
   mozilla::ipc::IPCResult RecvProfile(const nsCString& aProfile) override;
   mozilla::ipc::IPCResult RecvAddMemoryReport(const MemoryReport& aReport) override;
   mozilla::ipc::IPCResult RecvFinishMemoryReport(const uint32_t& aGeneration) override;
 
   void SendStartProfiler(const ProfilerInitParams& aParams) override;
   void SendStopProfiler() override;
   void SendPauseProfiler(const bool& aPause) override;
   void SendGatherProfile() override;
--- a/gfx/ipc/GPUParent.cpp
+++ b/gfx/ipc/GPUParent.cpp
@@ -136,17 +136,19 @@ GPUParent::NotifyDeviceReset()
     // If the device doesn't need to be reset then the device
     // has already been reset by a previous NotifyDeviceReset message.
     return;
   }
 #endif
 
   // Notify the main process that there's been a device reset
   // and that they should reset their compositors and repaint
-  Unused << SendNotifyDeviceReset();
+  GPUDeviceData data;
+  RecvGetDeviceStatus(&data);
+  Unused << SendNotifyDeviceReset(data);
 }
 
 mozilla::ipc::IPCResult
 GPUParent::RecvInit(nsTArray<GfxPrefSetting>&& prefs,
                     nsTArray<GfxVarUpdate>&& vars,
                     const DevicePrefs& devicePrefs,
                     nsTArray<LayerTreeIdMapping>&& aMappings)
 {
--- a/gfx/ipc/PGPU.ipdl
+++ b/gfx/ipc/PGPU.ipdl
@@ -120,17 +120,17 @@ child:
 
   // Messages for reporting telemetry to the UI process.
   async AccumulateChildHistograms(Accumulation[] accumulations);
   async AccumulateChildKeyedHistograms(KeyedAccumulation[] accumulations);
   async UpdateChildScalars(ScalarAction[] actions);
   async UpdateChildKeyedScalars(KeyedScalarAction[] actions);
   async RecordChildEvents(ChildEventData[] events);
 
-  async NotifyDeviceReset();
+  async NotifyDeviceReset(GPUDeviceData status);
 
   // Called in response to GatherProfile.
   async Profile(nsCString aProfile);
   async AddMemoryReport(MemoryReport aReport);
   async FinishMemoryReport(uint32_t aGeneration);
 };
 
 } // namespace gfx