Commit Graph

1329 Commits

Author SHA1 Message Date
Cristian Tuns
44fb28a14e Backed out 13 changesets (bug 1440207) for causing multiple failures. CLOSED TREE
Backed out changeset c9f33dfc1cc5 (bug 1440207)
Backed out changeset 76d823a34925 (bug 1440207)
Backed out changeset 75a99142ee1c (bug 1440207)
Backed out changeset b4d283d3e8da (bug 1440207)
Backed out changeset ea81a08ce181 (bug 1440207)
Backed out changeset c581a4e8cd15 (bug 1440207)
Backed out changeset d13799a1dc26 (bug 1440207)
Backed out changeset 6d715586c911 (bug 1440207)
Backed out changeset 30ff6a4db1d0 (bug 1440207)
Backed out changeset 2da0bbfdfee5 (bug 1440207)
Backed out changeset f3445c3fdd5e (bug 1440207)
Backed out changeset 07fbed499fe4 (bug 1440207)
Backed out changeset 1c2ac609c466 (bug 1440207)
2024-09-24 19:10:35 -04:00
Andrew Osmond
7f604fc3ef Bug 1869182 - Make WebGL use SharedSurfacesChild/Parent to avoid copies with SourceSurfaceSharedData. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D196105
2024-09-24 21:00:49 +00:00
Nika Layzell
8698f6c068 Bug 1440207 - Part 3a: Migrate GeckoChildProcessHost callers to use ChildProcessArgs, r=ipc-reviewers,necko-reviewers,media-playback-reviewers,aosmond,mccr8
This patch implements the majority of the public interface for the new IPC
handle passing design.

The rough design is an expansion of `geckoargs` to allow passing
`UniqueFileHandle` arguments to child processes. This replaces the existing
extra options array to make the list of files explicit.

This currently just replaces things which were already passed this way on the
command line from outside of GeckoChildProcessHost. Note that this does not
migrate callers which were not already passing file handles using geckoargs,
and does not implement the actual OS-level support for passing arguments this
way.

Differential Revision: https://phabricator.services.mozilla.com/D221371
2024-09-24 19:28:09 +00:00
Andrew Osmond
5ae0b39d4b Bug 1919689 - Cleanup WorkerRunnable subclass constructors in graphics. r=gfx-reviewers,lsalzman
This patch removes no longer needed WorkerPrivate* parameters from the
runnable constructors. It also converts some instances of using
WorkerThreadRunnable as a base class when MainThreadWorkerRunnable is
more suitable.

Differential Revision: https://phabricator.services.mozilla.com/D222735
2024-09-19 13:59:16 +00:00
Nika Layzell
22a4aacd26 Bug 1908725 - Part 4: Switch some basic uses of OtherPid over to OtherChildID, r=smaug
There are many other uses of OtherPid which could be switched over to
OtherChildID, but these were a couple of obvious low-hanging fruit use-cases
which will work better when using OtherChildID.

Differential Revision: https://phabricator.services.mozilla.com/D217120
2024-08-07 20:39:40 +00:00
Nika Layzell
bdb401316d Bug 1908725 - Part 2: Make the ChildID available in the same places as OtherPid, r=ipc-reviewers,media-playback-reviewers,win-reviewers,alwu,rkraesig,gfx-reviewers,mccr8,nical
This requires quite a bit of piping to get the ChildID passed everywhere where
we currently pass the pid in IPC. This is done by adding a new struct type
(EndpointProcInfo), which is passed around instead of OtherPid in these places,
and contains the full pid.

In most cases, it was a fairly painless change to move over, however in some
cases, more complex changes were required, as the pid was being stored
previously in something like an Atomic<...>, and needed to be switched to using
a mutex-protected value.

In the future, it may be possible to remove OtherPid from IPDL actors once
everything is migrated to ChildID, but we're still a long way off from that, so
for now we unfortunately need to pass both around.

Differential Revision: https://phabricator.services.mozilla.com/D217118
2024-08-07 20:39:39 +00:00
Lee Salzman
8250143072 Bug 1910138 - Disable Direct2D in Nightly. r=jrmuizel,aosmond
This disables the legacy Direct2D backend in Windows Nightly in favor
of using Accelerated Canvas2D instead. The goal of this experiment
is to collect performance and other bug feedback on AC2D versus Direct2D.

In general, AC2D has been fairly stable on other platforms, so it would be
nice to gradually move towards using AC2D on Windows as well so that we
are using one consistent acceleration solution.

This experiment is the first step towards that end.

Differential Revision: https://phabricator.services.mozilla.com/D217851
2024-07-27 09:25:23 +00:00
Sandor Molnar
f8ed40623e Backed out changeset 2f15b6efa248 (bug 1910138) for causing reftest failures CLOSED TREE 2024-07-27 12:13:07 +03:00
Lee Salzman
9f39fd1013 Bug 1910138 - Disable Direct2D in Nightly. r=jrmuizel,aosmond
This disables the legacy Direct2D backend in Windows Nightly in favor
of using Accelerated Canvas2D instead. The goal of this experiment
is to collect performance and other bug feedback on AC2D versus Direct2D.

In general, AC2D has been fairly stable on other platforms, so it would be
nice to gradually move towards using AC2D on Windows as well so that we
are using one consistent acceleration solution.

This experiment is the first step towards that end.

Differential Revision: https://phabricator.services.mozilla.com/D217851
2024-07-27 07:46:02 +00:00
Jamie Nicol
f90d2641fc Bug 1907135 - Do not treat GPU process loss as unstable whilst application is in background. r=aosmond
Rather than determine whether the previous GPU process was stable or
unstable when launching the subsequent process, do so immediately
following the process loss. This allows us to check the application's
foreground/background state at the time of the loss, and ensure that
we do not treat the process as unstable if we are killed whilst in the
background.

This is desireable because background process kills are expected
behavior on Android, and not in any way indicitive of the GPU process
being unstable. Treating them as unstable was leading to fallback to
software rendering and eventually the gpu process being disabled. This
patch is attempting to prevent that from occuring.

Previously added code that treated GPU processes that were *launched*
whilst in the background as stable can be removed, as it is no longer
required with this change.

Differential Revision: https://phabricator.services.mozilla.com/D217460
2024-07-23 17:06:21 +00:00
sotaro
583cc8ca31 Bug 1899379 - Notify VpAutoHDR and VpSuperResolution support to about:support r=gfx-reviewers,nical
It helps to know if driver supports VpAutoHDR and VpSuperResolution.

This is a preparation for Bug 1899378.

Differential Revision: https://phabricator.services.mozilla.com/D212518
2024-06-10 17:36:18 +00:00
Andrew McCreight
d4a8bd78d9 Bug 1899866 - Remove very frequent CanvasShutdownManager::Destroy() warning. r=gfx-reviewers,bradwerth
This is one of the most common sources of debug log spam.

Differential Revision: https://phabricator.services.mozilla.com/D212169
2024-05-30 19:35:40 +00:00
sotaro
c17ebc98c2 Bug 1896780 - Change IsGpuProcessEnabled() as to complete soon r=gfx-reviewers,bradwerth,jnicol
config state of gfx::Feature::GPU_PROCESS is mirrored to gfx::gfxVars::GPUProcessEnabled(). It is threadsafe.

Differential Revision: https://phabricator.services.mozilla.com/D210386
2024-05-16 00:06:33 +00:00
Jamie Nicol
becb5e70d3 Bug 1880503 - Handle sync IPC timeout in UiCompositorControllerChild. r=aosmond
Extend the sync IPC timeout mechanism in CompositorManagerChild to
additionally cover UiCompositorControllerChild. As
UiCompositorControllerChild runs on the Android UI thread, we ensure
GPUProcessManager::KillProcess dispatches to the gecko main thread.

Along with the previous patch in this series this should provide us
with crash reports when the Android UI thread is hung waiting for the
GPU process to reply.

Differential Revision: https://phabricator.services.mozilla.com/D202167
2024-05-14 12:58:36 +00:00
Jamie Nicol
0056a7ee56 Bug 1880503 - Generate paired minidump when GPU process is killed following IPC timeout. r=aosmond,gsvelto
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
2024-05-14 12:58:35 +00:00
sotaro
2be68ff00a Bug 1879425 - Log GPU device reset to gfx Failure Log of about:support r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D209926
2024-05-14 10:50:23 +00:00
Stanca Serban
dcd1e2c3f0 Backed out changeset 1c48635919fb (bug 1879425) for causing build bustages. CLOSED TREE 2024-05-14 04:55:08 +03:00
sotaro
e18a85127f Bug 1879425 - Log GPU device reset to gfx Failure Log of about:support r=gfx-reviewers,lsalzman
Unify how to log device reset. It helps for debugging.

Differential Revision: https://phabricator.services.mozilla.com/D209926
2024-05-14 00:46:12 +00:00
Stanca Serban
ad459e5cb0 Backed out 3 changesets (bug 1880503) for causing build bustages in nsCOMPtr.h. CLOSED TREE
Backed out changeset 437063345a7b (bug 1880503)
Backed out changeset 9665aa5e821d (bug 1880503)
Backed out changeset 44d08ce97ae6 (bug 1880503)
2024-05-13 21:08:49 +03:00
Jamie Nicol
432347390a Bug 1880503 - Handle sync IPC timeout in UiCompositorControllerChild. r=aosmond
Extend the sync IPC timeout mechanism in CompositorManagerChild to
additionally cover UiCompositorControllerChild. As
UiCompositorControllerChild runs on the Android UI thread, we ensure
GPUProcessManager::KillProcess dispatches to the gecko main thread.

Along with the previous patch in this series this should provide us
with crash reports when the Android UI thread is hung waiting for the
GPU process to reply.

Differential Revision: https://phabricator.services.mozilla.com/D202167
2024-05-13 16:52:13 +00:00
Jamie Nicol
6e07140f91 Bug 1880503 - Generate paired minidump when GPU process is killed following IPC timeout. r=aosmond,gsvelto
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
2024-05-13 16:52:12 +00:00
Natalia Csoregi
ab9ee3940a Backed out 3 changesets (bug 1880503) for causing bustage on CrashReporterHost.h. CLOSED TREE
Backed out changeset 296455072556 (bug 1880503)
Backed out changeset 842611b8fcbc (bug 1880503)
Backed out changeset eae32f6ab26c (bug 1880503)
2024-04-30 18:26:00 +03:00
Jamie Nicol
28108055b6 Bug 1880503 - Handle sync IPC timeout in UiCompositorControllerChild. r=aosmond
Extend the sync IPC timeout mechanism in CompositorManagerChild to
additionally cover UiCompositorControllerChild. As
UiCompositorControllerChild runs on the Android UI thread, we ensure
GPUProcessManager::KillProcess dispatches to the gecko main thread.

Along with the previous patch in this series this should provide us
with crash reports when the Android UI thread is hung waiting for the
GPU process to reply.

Differential Revision: https://phabricator.services.mozilla.com/D202167
2024-04-30 15:06:21 +00:00
Jamie Nicol
e4dd0c49fb Bug 1880503 - Generate paired minidump when GPU process is killed following IPC timeout. r=aosmond,gsvelto
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
2024-04-30 15:06:21 +00:00
alwu
053270f7b0 Bug 1892516 - part5 : report Glean probe from the chrome process. r=media-playback-reviewers,padenot
According to [1], currently we can only set a labeled boolean from the
chrome process, so we need to adjust our design to report result from
reporting from the GPU/RDD process to the chrome process.

Therefore, we have to always check HEVC first, and trim it later in
order to not to incorrectly support HEVC if the pref for HEVC is off.

[1] https://firefox-source-docs.mozilla.org/toolkit/components/glean/dev/ipc.html#forbidding-non-commutative-operations

Differential Revision: https://phabricator.services.mozilla.com/D208716
2024-04-29 17:46:29 +00:00
alwu
2b1351d2b2 Bug 1892516 - part3 : use Glean API and report the probe on more platforms. r=padenot
`device_hardware_decoding_support` was previously only recorded on
Windows and we want to extend this probe to other platforms as well.

Differential Revision: https://phabricator.services.mozilla.com/D208245
2024-04-29 17:46:28 +00:00
alwu
cb1209a5df Bug 1892516 - part2 : report false for unsupported codecs. r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D208244
2024-04-29 17:46:28 +00:00
alwu
20c124ffe1 Bug 1892516 - part1 : explicitly disable HEVC support to avoid running the initialization again. r=media-playback-reviewers,padenot
We can actually control whether HEVC is enabled by setting
`sForceEnableHEVC` to false without running decoder module's
initialization again, which can save some time because the
initialization is expensive.

[1] https://searchfox.org/mozilla-central/rev/ee9fd5e2df79c6d69af5aa9bc36041166f483227/dom/media/platforms/wmf/WMFDecoderModule.cpp#486

Differential Revision: https://phabricator.services.mozilla.com/D208243
2024-04-29 17:46:27 +00:00
Sandor Molnar
6d01c0b28a Backed out 3 changesets (bug 1892516) for causing multiple failures @ toolkit/components/glean/api/src/private/boolean.rs CLOSED TREE
Backed out changeset 842a809422f9 (bug 1892516)
Backed out changeset 5155a959fe13 (bug 1892516)
Backed out changeset d1cebb819ab9 (bug 1892516)
2024-04-25 21:30:10 +03:00
alwu
dbd07bdc6a Bug 1892516 - part3 : use Glean API and report the probe on more platforms. r=padenot
`device_hardware_decoding_support` was previously only recorded on
Windows and we want to extend this probe to other platforms as well.

Differential Revision: https://phabricator.services.mozilla.com/D208245
2024-04-25 17:32:16 +00:00
alwu
83af8f4c6e Bug 1892516 - part2 : report false for unsupported codecs. r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D208244
2024-04-25 17:32:15 +00:00
alwu
8d2a25def5 Bug 1892516 - part1 : explicitly disable HEVC support to avoid running the initialization again. r=media-playback-reviewers,padenot
We can actually control whether HEVC is enabled by setting
`sForceEnableHEVC` to false without running decoder module's
initialization again, which can save some time because the
initialization is expensive.

[1] https://searchfox.org/mozilla-central/rev/ee9fd5e2df79c6d69af5aa9bc36041166f483227/dom/media/platforms/wmf/WMFDecoderModule.cpp#486

Differential Revision: https://phabricator.services.mozilla.com/D208243
2024-04-25 17:32:15 +00:00
alwu
f4425129ba Bug 1885671 - part3 : initialize Media Foundation earlier for GPU process. r=media-playback-reviewers,padenot
This is used to fix the failures [1] on Windows xpcshell test on the try
server. As we've changed the timing of initailizing in previous patches,
that delays the timing of setting clean-up for MediaFoundationInitializer.

MediaFoundationInitializer has to be clean on MTA thread, but on the try
server, when the runnable for clean-up being dispatched on the main
thread, the MTA thread has been shutdowned.

Therefore, we would like to run the initialization earlier to ensure the
clean-up can be setup properly, which is like what we do for RDD [2].

[1] https://treeherder.mozilla.org/logviewer?job_id=455059875&repo=autoland&lineNumber=2090
[2] https://searchfox.org/mozilla-central/rev/eb4700a6be8371fe07053bc066c2d48ba813ce3d/dom/media/ipc/RDDParent.cpp#108-111

Differential Revision: https://phabricator.services.mozilla.com/D208250
2024-04-25 02:20:22 +00:00
alwu
478cb296e2 Bug 1885671 - part1 : run the method of getting codec supported on the background thread in order not to block the main thread. r=jrmuizel
There are modifications needed for PDMfactory and the decoder modules in
order to run their methods on non-mainthread and keep them threadsafe.

Differential Revision: https://phabricator.services.mozilla.com/D206420
2024-04-25 02:20:21 +00:00
Nika Layzell
f3ebfed97b Bug 1875528 - Part 2: Break the strong reference cycle between WebGPUChild and CanvasManagerChild, r=webgpu-reviewers,nical
The strong reference from CanvasManagerChild to WebGPUChild was never cleared
when the WebGPUChild dies, meaning that it would form a strong cycle through
the `Manager()` reference.

Under the new system, the WebGPUChild actor is kept alive by the IPC
connection, and will be torn down when the IPC connection dies.

Differential Revision: https://phabricator.services.mozilla.com/D198625
2024-04-22 17:13:23 +00:00
Eden Chuang
2f65cf28ae Bug 1769913 - P3 Remove WorkerRunnable::mWorkerPrivate. r=dom-worker-reviewers,asuth
WorkerRunnable no longer keeps a raw pointer(mWorkerPrivate) for the associated WorkerPrivate in this patch.
Removing the WorkerRunnable::mWorkerPrivate needs to fix the following problems.

1. Thread assertions in WorkerRunnable::Dispatch()

To fix this problem, the associated WorkerPrivate is as a parameter and passed to WorkerRunnable::Dispatch() for the dispatching thread assertions. This associated WorkerPrivate is also propagated to PreDispatch() and PostDispatch() for the children classes of WorkerRunnable()

2. Get the associated WorkerPrivate in WorkerRunnable::Run() for environment setup(GlobabObject, JSContext setting for the runnable)

- For WorkerThreadRunnable

Since WorkerThreadRunnable is supposed to run on the worker thread, it does not need to keep a raw pointer to WorkerPrivate as its class member. GetCurrentThreadWorkerPrivate() should always get the correct WorkerPrivate for WorkerThreadRunnable.

- For WorkerParentThreadRunnable

WorkerParentRef is introduced to keep a RefPtr<WorkerPrivate> for WorkerParentThreadRunnable instead of using a raw pointer.
Checking the associated WorkerPrivate existence by WorkerParentRef at the beginning of WorkerParentThreadRunnable::Run(). If the Worker has already shut down, WorkerParentThreadRunnable cannot do anything with the associated WorkerPrivate, so WorkerParentThreadRunnable::Run() will return NS_OK directly but with a warning.

The associated WorkerPrivate is also passed into WorkerRun(), PreRun(), and PostRun(), so the majority of implementations of child classes of WorkerRunnable do not need to be changed.

If there are any cases in which the child classes of WorkerThreadRunnable/WorkerParentThreadRunnable want to keep the associated WorkerPrivate, they should use WorkerRefs instead of raw pointers.

Depends on D205679

Differential Revision: https://phabricator.services.mozilla.com/D207039
2024-04-19 09:41:58 +00:00
Eden Chuang
e22d6ca385 Bug 1769913 - P1 Make WorkerRunnable to be a base class for runnables on Worker thread and Worker's parent thread. r=dom-worker-reviewers,asuth
This is the first step in splitting the parent thread runnable out of WorkerRunnable.

To reuse the runnable dispatching codes in Worker, we still need a base class for runnable on the worker thread and the parent thread.

In this patch, we rename the original WorkerRunnable to WorkerThreadRunnable and make WorkerRunnable to be WorkerThreadRunnable's parent class.

In the second patch, we will create WorkerParentThreadRunnable and its sub-classes, split from WorkerThreadRunnable for runnable on the Worker's parent thread.

And in the third patch, we will re-structure the content of WorkerParentThreadRunnable to remove unnecessary members.

Differential Revision: https://phabricator.services.mozilla.com/D205178
2024-04-19 09:41:57 +00:00
Stanca Serban
5a5e8146fd Backed out 2 changesets (bug 1885671) for causing Windows xpcshell assertion failures on ClearOnShutdown.cpp. CLOSED TREE
Backed out changeset 0c53f738aa7f (bug 1885671)
Backed out changeset 1189be6d8d0e (bug 1885671)
2024-04-18 23:52:53 +03:00
alwu
6a0a4e413c Bug 1885671 - run the method of getting codec supported on the background thread in order not to block the main thread. r=jrmuizel
There are modifications needed for PDMfactory and the decoder modules in
order to run their methods on non-mainthread and keep them threadsafe.

Differential Revision: https://phabricator.services.mozilla.com/D206420
2024-04-18 17:15:34 +00:00
Cristina Horotan
1a34259635 Backed out changeset 68ea681f466b (bug 1885671) for causing xpcshell failures at test_privacy_transition.js CLOSED TREE 2024-04-17 00:42:33 +03:00
alwu
ddec4dc371 Bug 1885671 - run the method of getting codec supported on the background thread in order not to block the main thread. r=jrmuizel
There are modifications needed for PDMfactory and the decoder modules in
order to run their methods on non-mainthread and keep them threadsafe.

Differential Revision: https://phabricator.services.mozilla.com/D206420
2024-04-16 19:20:13 +00:00
Lee Salzman
3df91287ff Bug 1888338 - Use a single SharedContextWebgl. r=aosmond
This shares a global SharedContextWebgl among all instances of CanvasTranslator.
The goal is that regardless of how many windows are open, we only have to pay the
startup costs and shader compilation times for SharedContextWebgl once. In the
event that all CanvasTranslators are gone, the SharedContextWebgl is kept around
while its internal caches and textures are discarded to avoid significant memory
usage when no canvases are in use, while at the same time saving on startup
costs the next time a first live CanvasTranslator is created.

Differential Revision: https://phabricator.services.mozilla.com/D205977
2024-03-28 17:33:58 +00:00
Andrew Osmond
503fb4c624 Bug 1887729 - Implement context lost/restored support for CanvasRenderingContext2D. r=webidl,gfx-reviewers,smaug,lsalzman
Remote canvas can run in the GPU process, and if the GPU process
crashes, we need to notify the application using canvas. Historically we
just failed, and the application may have been able to continue drawing
but with the contents prior to the crash lost. Later we regressed to
prevent the canvas from being used at all.

This patch makes it so that we can restore functionality to any
application that supports the contextlost/contextrestored events. This
will allow for a theoretical complete graceful recovery for the user
with minimal disruption.

Differential Revision: https://phabricator.services.mozilla.com/D205608
2024-03-28 14:50:20 +00:00
Butkovits Atila
da7915ebcd Backed out changeset 40fa8e4b06c8 (bug 1887729) for causing failures at test_accelerated_canvas_context_loss.html. CLOSED TREE 2024-03-28 05:09:32 +02:00
Andrew Osmond
da63648349 Bug 1887729 - Implement context lost/restored support for CanvasRenderingContext2D. r=webidl,gfx-reviewers,smaug,lsalzman
Remote canvas can run in the GPU process, and if the GPU process
crashes, we need to notify the application using canvas. Historically we
just failed, and the application may have been able to continue drawing
but with the contents prior to the crash lost. Later we regressed to
prevent the canvas from being used at all.

This patch makes it so that we can restore functionality to any
application that supports the contextlost/contextrestored events. This
will allow for a theoretical complete graceful recovery for the user
with minimal disruption.

Differential Revision: https://phabricator.services.mozilla.com/D205608
2024-03-28 01:51:23 +00:00
Andrew Osmond
0a149a309c Bug 1886022 - Refactor canvas shutdown to account for process crashes. r=gfx-reviewers,lsalzman
We previously refactor canvas shutdown to account for the fact that they
needed to be shutdown in conjunction with the DOM worker reference
kept alive by the CanvasManagerChild. Unfortunately if the compositor
process crashes, or otherwise the CanvasManagerChild actor is torn down,
we also prematurely shutdown the canvas when it would previously
fallback to Skia in the content process.

This patch abstracts out canvas shutdown into the CanvasShutdownManager
which has the owning reference to the ThreadSafeWorkerRef. It corrects a
similar bug on the main thread as well for HTMLCanvasElement.

Differential Revision: https://phabricator.services.mozilla.com/D204988
2024-03-19 14:09:13 +00:00
Cosmin Sabou
cb3c42a748 Backed out changeset 0e250e45603a (bug 1886022) for causing build bustages on CanvasShutdownManager. CLOSED TREE 2024-03-19 09:42:20 +02:00
Andrew Osmond
7d7daabe06 Bug 1886022 - Refactor canvas shutdown to account for process crashes. r=gfx-reviewers,lsalzman
We previously refactor canvas shutdown to account for the fact that they
needed to be shutdown in conjunction with the DOM worker reference
kept alive by the CanvasManagerChild. Unfortunately if the compositor
process crashes, or otherwise the CanvasManagerChild actor is torn down,
we also prematurely shutdown the canvas when it would previously
fallback to Skia in the content process.

This patch abstracts out canvas shutdown into the CanvasShutdownManager
which has the owning reference to the ThreadSafeWorkerRef. It corrects a
similar bug on the main thread as well for HTMLCanvasElement.

Differential Revision: https://phabricator.services.mozilla.com/D204988
2024-03-19 00:39:55 +00:00
Gabriele Svelto
aa43fa218e Bug 1831092 - Use the new pull-based API for all crash annotations and remove the global annotations table r=jgilbert,necko-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,padenot,handyman,afranchuk,valentin,alwu,sotaro
This changes comes with several different refactorings all rolled into one,
unfotunately I couldn't find a way to pull them apart:
- First of all annotations now can either recorded (that is, we copy the value
  and have the crash reporting code own the copy) or registered. Several
  annotations are changed to use this functionality so that we don't need to
  update them as their value change.
- The code in the exception handler is modified to read the annotations from
  the mozannotation_client crate. This has the unfortunate side-effect that
  we need three different bits of code to serialize them: one for annotations
  read from a child process, one for reading annotations from the main process
  outside of the exception handler and one for reading annotations from the
  main process within the exception handler. As we move to fully
  out-of-process crash reporting the last two methods will go away.
- The mozannotation_client crate now doesn't record annotation types anymore.
  I realized as I was working on this that storing types at runtime has two
  issues: the first one is that buggy code might change the type of an
  annotation (that is record it under two different types at two different
  moments), the second issue is that types might become corrupt during a
  crash, so better enforce them at annotation-writing time. The end result is
  that the mozannotation_* crates now only store byte buffers, track the
  format the data is stored in (null-terminated string, fixed size buffer,
  etc...) but not the type of data each annotation is supposed to contain.
- Which brings us to the next change: concrete types for annotations are now
  enforced when they're written out. If an annotation doesn't match the
  expected type it's skipped. Storing an annotation with the wrong type will
  also trigger an assertion in debug builds.

Differential Revision: https://phabricator.services.mozilla.com/D195248
2024-03-04 10:24:43 +00:00
sotaro
b41ff7d6db Bug 1851736 - Enable NVIDIA RTX Video Super Resolution for video overlay on Windows only during power charge r=gfx-reviewers,ahale
Super Resolution consumes more power. Then it is better to enable it only during power charging.

Differential Revision: https://phabricator.services.mozilla.com/D202781
2024-03-01 04:00:59 +00:00