Switch all six SendRequestMemoryReport implementations to use the
promise-returning overload with ->Then(). This also removes the needless
[&] lambda captures that were present in the callback-based versions.
Differential Revision: https://phabricator.services.mozilla.com/D292771
This limits the abilities of the GPU process more appropriately than
the previous approach which used a generic message that could
dispatch any observer notification.
Differential Revision: https://phabricator.services.mozilla.com/D288592
When webrender's GL context is created, query the GL strings and
report them back to gfxInfo. This is used as a sanity check that
gfxInfo's cached values were correct. If they differ we don't change
any blocklisting decisions for the current session, but we do update
the cache so that the next run will use the correct values.
In practice we do not expect the cached values to differ from the
reported ones, as Android devices tend not to change their GPU, nor
update drivers without an OS update.
Differential Revision: https://phabricator.services.mozilla.com/D278247
In the case where the GPU process channel is connected asynchronously
we unfortunately send a synchronous GPUChild::SendGetDeviceStatus()
message immediately afterwards. This is a regression from bug 1993758,
which added a call to GPUChild::EnsureGPUReady() to
GPUProcessManager::OnProcessLaunchComplete(). Ideally we'd like to
avoid using this synchronous message unless required, and instead
allow time for the asynchronous Init()/InitComplete() callback to
complete.
This patch achieves just that by delaying calling the listener's
OnProcessLaunchComplete() callback until after the post-connection
initialization is complete, rather than immediately after the channel
has connected. This means that by the time the GPUProcessManager calls
EnsureGPUReady(), initialization will have already completed.
A new "Connected" LaunchPhase is added prior to "Complete", indicating
that the channel has been connected but post-connection initialization
has not yet completed. Upon connection we start asynchronous
initialization as before, but now track its completion using a Promise
and call OnProcessLaunchComplete when that resolves.
As before, if GPUProcessManager requires the launch to complete
synchronously it calls GPUProcessHost::WaitForLaunch(). This will now
additionally ensure initialization has completed prior to returning by
sending the synchronous SendGetDeviceData message.
Differential Revision: https://phabricator.services.mozilla.com/D272308
This reverts commit 8b91e5ff50.
Revert "Bug 1999645 - Avoid synchronous GPUChild::SendGetDeviceStatus after GPU process channel is connected asynchronously. r=aosmond"
This reverts commit b535b81d7c.
Revert "Bug 1999645 - Use live token instead of ipc::TaskFactory in GPUProcessHost. r=aosmond"
This reverts commit 6d17a0731b.
In the case where the GPU process channel is connected asynchronously
we unfortunately send a synchronous GPUChild::SendGetDeviceStatus()
message immediately afterwards. This is a regression from bug 1993758,
which added a call to GPUChild::EnsureGPUReady() to
GPUProcessManager::OnProcessLaunchComplete(). Ideally we'd like to
avoid using this synchronous message unless required, and instead
allow time for the asynchronous Init()/InitComplete() callback to
complete.
This patch achieves just that by delaying calling the listener's
OnProcessLaunchComplete() callback until after the post-connection
initialization is complete, rather than immediately after the channel
has connected. This means that by the time the GPUProcessManager calls
EnsureGPUReady(), initialization will have already completed.
A new "Connected" LaunchPhase is added prior to "Complete", indicating
that the channel has been connected but post-connection initialization
has not yet completed. Upon connection we start asynchronous
initialization as before, but now track its completion using a Promise
and call OnProcessLaunchComplete when that resolves.
As before, if GPUProcessManager requires the launch to complete
synchronously it calls GPUProcessHost::WaitForLaunch(). This will now
additionally ensure initialization has completed prior to returning by
sending the synchronous SendGetDeviceData message.
Differential Revision: https://phabricator.services.mozilla.com/D272308
In the case where the GPU process channel is connected asynchronously
we unfortunately send a synchronous GPUChild::SendGetDeviceStatus()
message immediately afterwards. This is a regression from bug 1993758,
which added a call to GPUChild::EnsureGPUReady() to
GPUProcessManager::OnProcessLaunchComplete(). Ideally we'd like to
avoid using this synchronous message unless required, and instead
allow time for the asynchronous Init()/InitComplete() callback to
complete.
This patch achieves just that by delaying calling the listener's
OnProcessLaunchComplete() callback until after the post-connection
initialization is complete, rather than immediately after the channel
has connected. This means that by the time the GPUProcessManager calls
EnsureGPUReady(), initialization will have already completed.
A new "Connected" LaunchPhase is added prior to "Complete", indicating
that the channel has been connected but post-connection initialization
has not yet completed. Upon connection we start asynchronous
initialization as before, but now track its completion using a Promise
and call OnProcessLaunchComplete when that resolves.
As before, if GPUProcessManager requires the launch to complete
synchronously it calls GPUProcessHost::WaitForLaunch(). This will now
additionally ensure initialization has completed prior to returning by
sending the synchronous SendGetDeviceData message.
Differential Revision: https://phabricator.services.mozilla.com/D272308
This patch simplifies that device reset logic to ensure that we always
finish completing a device reset, regardless of our present state. This
is because once we are in the middle of a device reset, we fail to
create new compositor sessions. So even if we managed to somehow
partially recover (particularly from the Windows perspective) or never
had a full reset, we should always complete the transaction to make the
parent process recreate all of its compositor sessions, in process or
remote.
We also now unify that device reset handling from nsWindow::Paint on
Windows so that if there are multiple pathways we trigger the same
device reset, we will always complete handling it properly.
Differential Revision: https://phabricator.services.mozilla.com/D271126
This patch reduces the complexity in EnsureGPUReady to account for
different failure scenarios that are not properly handled with the
current logic.
We can fail to initialize a GPU process because:
1) We are already in shutdown.
2) The initial launch request itself fails.
3) The launch response fails.
4) The GPUChild actor fails its first sync IPDL call.
We were failing to account for the fact that 4) can both fail, and not
disable the GPU process to allow for a retry of the launch.
Now instead we simplify the logic to:
1) Early exit for the most common success cases.
2) Only check for shutdown once after that.
3) Reduce the necessary logic, trusting (with asserts) that the
expected methods will be called to set our state correctly.
4) Make disabling WebRender without restarting the GPU process perform
the necessary synchronization inline, since it is going to happen
shortly anyways due to the config change and compositor resets.
Differential Revision: https://phabricator.services.mozilla.com/D270555
Now that Direct2D is no longer supported, we can start removing the associated Feature
and queries of it.
This patch does the awkward work of removing Direct2D feature testing throughout Gecko.
Differential Revision: https://phabricator.services.mozilla.com/D269855
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
When we update gfxVars, if we create gfxVarsCollectUpdates on the stack,
we can consolidate those updates into a single notification and IPC
message per process. This will save on churn, particularly for the media
processes, which may want to monitor multiple gfxVars for changes
affecting hardware video decoding/encoding.
This also moves the CodecSupportInfo from a gfxVar into a member of
GfxInfoBase since that is the only place that needs access to it. This
avoids bouncing back a gfxVar update back to all of the child processes
after a codec support update from each of them.
Differential Revision: https://phabricator.services.mozilla.com/D259335
The current logic results in all `BACKGROUND_CHILD` process types ending
up as GPU processes (if they aren't an extension process), however
rather than rely on this behavior, it's a better idea to send the actual
process type name through to the Android crash handling code.
Differential Revision: https://phabricator.services.mozilla.com/D245979
When sync IPC under the top-level PCompositorManager protocol does not
reply within a certain time threshold we purposefully kill the GPU
process. While this allows the user to recover from a stuck GPU
process, we have little visibility about the underlying cause.
This patch makes it so that we generate a paired minidump for the GPU
and parent processes prior to killing the GPU process in
GPUProcessHost::KillHard(). The implementation roughly follows the
equivalent for content processes in ContentParent::KillHard().
As the GPU process can be purposefully killed during normal operation,
and because generating minidumps can be expensive, we are careful to
only do so when the new argument aGenerateMinidump is true. We
additionally remove the aReason argument as it is unused (and
currently innacurate in some places).
As these minidumps may not automatically submitted we limit the
minidumps generation to twice per session in order to avoid
accumulating a large number of unsubmitted minidumps on disk.
Differential Revision: https://phabricator.services.mozilla.com/D202166
When sync IPC under the top-level PCompositorManager protocol does not
reply within a certain time threshold we purposefully kill the GPU
process. While this allows the user to recover from a stuck GPU
process, we have little visibility about the underlying cause.
This patch makes it so that we generate a paired minidump for the GPU
and parent processes prior to killing the GPU process in
GPUProcessHost::KillHard(). The implementation roughly follows the
equivalent for content processes in ContentParent::KillHard().
As the GPU process can be purposefully killed during normal operation,
and because generating minidumps can be expensive, we are careful to
only do so when the new argument aGenerateMinidump is true. We
additionally remove the aReason argument as it is unused (and
currently innacurate in some places).
As these minidumps may not automatically submitted we limit the
minidumps generation to twice per session in order to avoid
accumulating a large number of unsubmitted minidumps on disk.
Differential Revision: https://phabricator.services.mozilla.com/D202166
When sync IPC under the top-level PCompositorManager protocol does not
reply within a certain time threshold we purposefully kill the GPU
process. While this allows the user to recover from a stuck GPU
process, we have little visibility about the underlying cause.
This patch makes it so that we generate a paired minidump for the GPU
and parent processes prior to killing the GPU process in
GPUProcessHost::KillHard(). The implementation roughly follows the
equivalent for content processes in ContentParent::KillHard().
As the GPU process can be purposefully killed during normal operation,
and because generating minidumps can be expensive, we are careful to
only do so when the new argument aGenerateMinidump is true. We
additionally remove the aReason argument as it is unused (and
currently innacurate in some places).
As these minidumps may not automatically submitted we limit the
minidumps generation to twice per session in order to avoid
accumulating a large number of unsubmitted minidumps on disk.
Differential Revision: https://phabricator.services.mozilla.com/D202166
This patch makes the remote canvas enabled state global. If we failed to
create a context, then it cannot recover, so we should never try again.
In the event of stream errors, it is likely due to virtual memory
shortages.
Differential Revision: https://phabricator.services.mozilla.com/D187718
When we fallback without recreating the GPU process, we should ensure
that the gfxVar updates have been processed before recreating the
compositor sessions. This is achieved by blocking on the sync
PGPU::SendDeviceStatus IPDL message. This additional sync message only
happens during fallback and thus should be fairly cheap.
Differential Revision: https://phabricator.services.mozilla.com/D162020