forked from BrowserWorks/Waterfox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPGPU.ipdl
141 lines (114 loc) · 5.67 KB
/
PGPU.ipdl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
include GraphicsMessages;
include MemoryReportTypes;
include HangTypes;
include protocol PAPZInputBridge;
include protocol PCompositorManager;
include protocol PImageBridge;
include protocol PProfiler;
include protocol PVRGPU;
include protocol PVRManager;
include protocol PVsyncBridge;
include protocol PUiCompositorController;
include protocol PVideoDecoderManager;
using base::ProcessId from "base/process.h";
using mozilla::dom::NativeThreadId from "mozilla/dom/TabMessageUtils.h";
using mozilla::Telemetry::HistogramAccumulation from "mozilla/TelemetryComms.h";
using mozilla::Telemetry::KeyedHistogramAccumulation from "mozilla/TelemetryComms.h";
using mozilla::Telemetry::ScalarAction from "mozilla/TelemetryComms.h";
using mozilla::Telemetry::KeyedScalarAction from "mozilla/TelemetryComms.h";
using mozilla::Telemetry::ChildEventData from "mozilla/TelemetryComms.h";
using mozilla::Telemetry::DiscardedData from "mozilla/TelemetryComms.h";
using mozilla::gfx::Feature from "gfxFeature.h";
using mozilla::gfx::Fallback from "gfxFallback.h";
using mozilla::layers::LayersId from "mozilla/layers/LayersTypes.h";
namespace mozilla {
namespace gfx {
struct LayerTreeIdMapping {
LayersId layersId;
ProcessId ownerId;
};
// This protocol allows the UI process to talk to the GPU process. There is one
// instance of this protocol, with the GPUParent living on the main thread of
// the GPU process and the GPUChild living on the main thread of the UI process.
sync protocol PGPU
{
manages PAPZInputBridge;
parent:
// Sent from the UI process to initialize a new APZ input bridge when a new
// top-level compositor is created.
async PAPZInputBridge(LayersId aLayersId);
// Sent by the UI process to initiate core settings.
async Init(GfxPrefSetting[] prefs,
GfxVarUpdate[] vars,
DevicePrefs devicePrefs,
LayerTreeIdMapping[] mapping);
async InitCompositorManager(Endpoint<PCompositorManagerParent> endpoint);
async InitVsyncBridge(Endpoint<PVsyncBridgeParent> endpoint);
async InitImageBridge(Endpoint<PImageBridgeParent> endpoint);
async InitVRManager(Endpoint<PVRManagerParent> endpoint);
async InitUiCompositorController(LayersId rootLayerTreeId, Endpoint<PUiCompositorControllerParent> endpoint);
async InitProfiler(Endpoint<PProfilerChild> endpoint);
// Forward GPU process its endpoints to the VR process.
async InitVR(Endpoint<PVRGPUChild> endpoint);
// Called to update a gfx preference or variable.
async UpdatePref(GfxPrefSetting pref);
async UpdateVar(GfxVarUpdate var);
// Create a new content-process compositor bridge.
async NewContentCompositorManager(Endpoint<PCompositorManagerParent> endpoint);
async NewContentImageBridge(Endpoint<PImageBridgeParent> endpoint);
async NewContentVRManager(Endpoint<PVRManagerParent> endpoint);
async NewContentVideoDecoderManager(Endpoint<PVideoDecoderManagerParent> endpoint);
// Called to notify the GPU process of who owns a layersId.
sync AddLayerTreeIdMapping(LayerTreeIdMapping mapping);
async RemoveLayerTreeIdMapping(LayerTreeIdMapping mapping);
// Request the current DeviceStatus from the GPU process. This blocks until
// 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);
async RequestMemoryReport(uint32_t generation,
bool anonymize,
bool minimizeMemoryUsage,
FileDescriptor? DMDFile);
async ShutdownVR();
child:
// Sent when the GPU process has initialized devices. This occurs once, after
// Init().
async InitComplete(GPUDeviceData data);
// Sent when APZ detects checkerboarding and apz checkerboard reporting is enabled.
async ReportCheckerboard(uint32_t severity, nsCString log);
// Graphics errors, analogous to PContent::GraphicsError
async GraphicsError(nsCString aError);
async InitCrashReporter(Shmem shmem, NativeThreadId threadId);
async CreateVRProcess();
async ShutdownVRProcess();
// Have a message be broadcasted to the UI process by the UI process
// observer service.
async NotifyUiObservers(nsCString aTopic);
// Messages for reporting telemetry to the UI process.
async AccumulateChildHistograms(HistogramAccumulation[] accumulations);
async AccumulateChildKeyedHistograms(KeyedHistogramAccumulation[] accumulations);
async UpdateChildScalars(ScalarAction[] actions);
async UpdateChildKeyedScalars(KeyedScalarAction[] actions);
async RecordChildEvents(ChildEventData[] events);
async RecordDiscardedData(DiscardedData data);
async NotifyDeviceReset(GPUDeviceData status);
async AddMemoryReport(MemoryReport aReport);
async FinishMemoryReport(uint32_t aGeneration);
// Update the UI process after a feature's status has changed. This is used
// outside of the normal startup flow.
async UpdateFeature(Feature aFeature, FeatureFailure aChange);
// Notify about:support/Telemetry that a fallback occurred.
async UsedFallback(Fallback aFallback, nsCString message);
async BHRThreadHang(HangDetails aDetails);
};
} // namespace gfx
} // namespace mozilla