Commit Graph

809 Commits

Author SHA1 Message Date
Glenn Watson
9149dcfec2 Bug 1724846 - Split DL spatial tree to separate payload r=gfx-reviewers,nical
This will allow experimenting with different representations of
the spatial tree (such as interning and/or providing stable
indices during display list building). It may also simplify
future changes to the public API to expose the spatial tree
directly.

As part of these changes, refactor how the debug representation
for the capture format is (de)serialized, to make it simpler to
add different payload vector types in future.

Differential Revision: https://phabricator.services.mozilla.com/D122183
2021-08-24 02:18:51 +00:00
Iulian Moraru
534c6d12b2 Backed out changeset d93e8a61d529 (bug 1724846) for causing reftest failures on downscale-moz-icon-1.html. CLOSED TREE 2021-08-23 07:11:37 +03:00
Glenn Watson
c46752adac Bug 1724846 - Split DL spatial tree to separate payload r=gfx-reviewers,nical
This will allow experimenting with different representations of
the spatial tree (such as interning and/or providing stable
indices during display list building). It may also simplify
future changes to the public API to expose the spatial tree
directly.

As part of these changes, refactor how the debug representation
for the capture format is (de)serialized, to make it simpler to
add different payload vector types in future.

Differential Revision: https://phabricator.services.mozilla.com/D122183
2021-08-22 20:54:07 +00:00
Narcis Beleuzu
4c3fac01fa Backed out 2 changesets (bug 1723665, bug 1724846) as per gw`s request
Backed out changeset 5f2aff372a24 (bug 1724846)
Backed out changeset 0cc8e08b6937 (bug 1723665)
2021-08-18 03:17:33 +03:00
Glenn Watson
8f19dc96b0 Bug 1724846 - Split DL spatial tree to separate payload r=gfx-reviewers,nical
This will allow experimenting with different representations of
the spatial tree (such as interning and/or providing stable
indices during display list building). It may also simplify
future changes to the public API to expose the spatial tree
directly.

As part of these changes, refactor how the debug representation
for the capture format is (de)serialized, to make it simpler to
add different payload vector types in future.

Differential Revision: https://phabricator.services.mozilla.com/D122183
2021-08-15 20:44:03 +00:00
stransky
abf5182caf Bug 1722450 [Wayland] Pause compositor when screen scale changes and content is not updated yet, r=sotaro
We need to track window compositor state in various cases, when compositor is paused after window creation,
when compositor is paused for hidden window (EGLSurface is missing) and paused compositor when layout is not updated yet
and drawing will lead to incorrect / obsoleted window content.

In this patch we track compositor state by WindowCompositorState atomic enum (because it can be accessed from Compositor thread)
and two private methods (PauseCompositorHiddenWindow and ResumeCompositorHiddenWindow) and two public ones (PauseCompositor() and ResumeCompositor).

Private interface is used by nsWindow when EGLSurface is missing so we can't render to window - it's initial compositor pause and
pause when window is hidden.

Public interface is used by nsWindow and WebRender compositor to disable/enable rendering when window content is updated.
When compositor is disabled by public interface it will be enabled automatically after a timeout (1s) or when content layout is updated.

Changes in the patch:

- Implement GtkCompositorWidget::RemoteLayoutSizeUpdated() to notify GtkCompositorWidget widget about layout size update in content process.
- Track nsWindow compositor state by WindowCompositorState
- Implement nsWindow::PauseCompositorHiddenWindow() and ResumeCompositorHiddenWindow() to handle internal nsWindow states.
- Implement nsWindow::PauseCompositor() and nsWindow::ResumeCompositor() to allow compositor pause/resume during content layout updates.
- Use timeout to resume compositor paused by public interface as a fallback when content is not updated or it takes too long.

Differential Revision: https://phabricator.services.mozilla.com/D121650
2021-08-11 07:48:53 +00:00
Glenn Watson
2526d2cd07 Bug 1724344 - Split DL cache data into separate payload vec r=gfx-reviewers,kvark
Move the extra_data to be a specific cache_data separate vec in
the display list payload.

This shouldn't change any functionality, but serves as a proof
of concept for future changes which will introduce several other
separated payload vectors.

Differential Revision: https://phabricator.services.mozilla.com/D121937
2021-08-09 21:15:20 +00:00
Tom Ritter
7830c4464f Bug 1666222: Cut over a ton of NowUnfuzzed calls -> Now 4/5 r=smaug,extension-reviewers,zombie
With Fuzzyfox removed, Now() does what NowUnfuzzed() did.

Differential Revision: https://phabricator.services.mozilla.com/D119639
2021-07-14 18:18:17 +00:00
Nazım Can Altınova
7e485c1227 Bug 1690624 - Add profiler rust API for thread registration/unregistration r=gerald,emilio
Differential Revision: https://phabricator.services.mozilla.com/D116515
2021-06-09 11:22:55 +00:00
Matt Woodrow
dafb671fce Bug 1708325 - Change frame throttling code in nsRefreshDriver to explicitly track the pending frames. r=mstange
This makes it easier to understand and will make it easier to not include 'extra' frames (as we're hoping they will coalesce with the original frame on the compositor).

Differential Revision: https://phabricator.services.mozilla.com/D113736
2021-05-10 00:00:50 +00:00
Dorel Luca
204e6d71e2 Backed out 2 changesets (bug 1708325) for Build bustages in gecko/layout/base/nsRefreshDriver.h. CLOSED TREE
Backed out changeset 3fe338644983 (bug 1708325)
Backed out changeset edf1ac18cc8c (bug 1708325)
2021-05-10 01:52:44 +03:00
Matt Woodrow
d71ee18f9c Bug 1708325 - Change frame throttling code in nsRefreshDriver to explicitly track the pending frames. r=mstange
This makes it easier to understand and will make it easier to not include 'extra' frames (as we're hoping they will coalesce with the original frame on the compositor).

Differential Revision: https://phabricator.services.mozilla.com/D113736
2021-05-09 22:35:44 +00:00
Miko Mynttinen
511c218308 Bug 1676657 - Port paint phase weight histograms to WebRender r=nical
Differential Revision: https://phabricator.services.mozilla.com/D108043
2021-04-22 13:31:42 +00:00
Alexandru Michis
fbd17c6dbc Backed out changeset ca4d87f2ec7b (bug 1676657) for causing webrender bustages.
CLOSED TREE
2021-04-21 18:41:23 +03:00
Miko Mynttinen
5ce83f7070 Bug 1676657 - Port paint phase weight histograms to WebRender r=nical
Differential Revision: https://phabricator.services.mozilla.com/D108043
2021-04-21 15:13:42 +00:00
sotaro
4e5dcc4a3e Bug 1706000 - Remove WebRenderBridgeParent::mPaused r=jnicol,gfx-reviewers
WebRenderBridgeParent::mPaused does not hold correct paused state, initial state of mPaused was always false. And CompositorBridgeParent already keeps correct paused state.

Differential Revision: https://phabricator.services.mozilla.com/D112518
2021-04-19 21:59:46 +00:00
Hiroyuki Ikezoe
40730ead2d Bug 1658914 - Stop sampling animations via vsync ticks on WebRender when we are in testing refresh driver mode. r=boris
On WebRender there are two functions to be called for sampling animations, one is
OMTA::Sample which is called via vsync ticks in normal mode, the other is
OMTA::SampleForTesting which is called in testing refresh driver mode. The
former function is called on the sampler thread, if it gets called in between
we call nsIDOMWindowUtils.advanceTimeAndRefresh and
nsIDOMWindowUtils.getOMTAStyle AND IF the result of sampling via getOMTAStyle
was `SampleResult::None` or `SampleResult::Skipped`, we will use an incorrect
animation value via the OMTA::Sample call with the vsync timestamp, the vsync
timestamp is completely different from the value advanced by
the advanceTimeAndRefresh call.

Differential Revision: https://phabricator.services.mozilla.com/D110888
2021-04-06 21:36:19 +00:00
Jamie Nicol
9ee6d639d3 Bug 1701633 - Annotate crash reports with name of currently bound shader during draw calls. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D110115
2021-03-30 08:36:58 +00:00
Andrew Osmond
f7c577f7a1 Bug 1699224 - Part 5. Unmap shared surfaces if memory pressured during resource updates. r=jrmuizel
Before we start a resource update, we should check if we are virtual
memory pressured (32-bit Windows only). If so, pre-emptively unmap
shared surfaces until the pressure is relieved to try to avoid OOMs
elsewhere. This only applies to the GPU process because the parent
process actively watches its own memory pressure and dispatches a
low-memory event which our expiration tracker is an observer for.

Differential Revision: https://phabricator.services.mozilla.com/D109441
2021-03-29 22:43:28 +00:00
Noemi Erli
07bed1d614 Backed out 5 changesets (bug 1699224) for causing web platform and reftest failures CLOSED TREE
Backed out changeset bc232de0c5f8 (bug 1699224)
Backed out changeset 94c75dba6545 (bug 1699224)
Backed out changeset 206187cafb6f (bug 1699224)
Backed out changeset ef3ef367986e (bug 1699224)
Backed out changeset d2294fe6ef31 (bug 1699224)
2021-03-26 22:16:10 +02:00
Andrew Osmond
df0419c33a Bug 1699224 - Part 5. Unmap shared surfaces if memory pressured during resource updates. r=jrmuizel
Before we start a resource update, we should check if we are virtual
memory pressured (32-bit Windows only). If so, pre-emptively unmap
shared surfaces until the pressure is relieved to try to avoid OOMs
elsewhere. This only applies to the GPU process because the parent
process actively watches its own memory pressure and dispatches a
low-memory event which our expiration tracker is an observer for.

Differential Revision: https://phabricator.services.mozilla.com/D109441
2021-03-26 18:21:15 +00:00
Butkovits Atila
ca41cacc0e Backed out 5 changesets (bug 1699224) for causing build bustages on SharedSurfacesParent.cpp. CLOSED TREE
Backed out changeset f929f9783e61 (bug 1699224)
Backed out changeset 36bf68e01a50 (bug 1699224)
Backed out changeset 85f3499080db (bug 1699224)
Backed out changeset 8ce6ddf6ec6f (bug 1699224)
Backed out changeset f8b232382361 (bug 1699224)
2021-03-26 18:33:17 +02:00
Andrew Osmond
7a3183ded3 Bug 1699224 - Part 5. Unmap shared surfaces if memory pressured during resource updates. r=jrmuizel
Before we start a resource update, we should check if we are virtual
memory pressured (32-bit Windows only). If so, pre-emptively unmap
shared surfaces until the pressure is relieved to try to avoid OOMs
elsewhere. This only applies to the GPU process because the parent
process actively watches its own memory pressure and dispatches a
low-memory event which our expiration tracker is an observer for.

Differential Revision: https://phabricator.services.mozilla.com/D109441
2021-03-26 13:21:53 +00:00
sotaro
ebea25864d Bug 1700848 - Destroy RenderCompositor by root WebRenderBridgeParent's ClearResources() r=nical
Root WebRenderBridgeParent's  ClearResources() call is expected to destroy RenderCompositor. It is necessary to avoid conflict between RenderCompositors and to avoid use after free.

Differential Revision: https://phabricator.services.mozilla.com/D109693
2021-03-25 21:53:40 +00:00
Florian Quèze
7ca337c131 Bug 1699742 - Remove MOZ_GECKO_PROFILER ifdefs that are no longer needed, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D109078
2021-03-22 16:29:52 +00:00
Andrew Osmond
42c255aa7c Bug 1699209 - Ensure we release shmems from messages even if WebRenderBridgeParent is destroyed. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D108818
2021-03-17 19:43:51 +00:00
Brad Werth
61e67aca78 Bug 1692029 Part 1: Make TextureHost report a native texture policy. r=lsalzman
Whether or not we use a native texture or something else is affected by our
backend and the size of the texture. This patch adds a new function to
centralize that logic in TextureHost, and applies it in callsites that were
checking the backend to determine an image type.

Differential Revision: https://phabricator.services.mozilla.com/D106568
2021-03-10 18:27:28 +00:00
Brindusan Cristian
46cb51f43c Backed out changeset b0b87c410435 (bug 1692029) for bustages in RenderTextureHostSWGL.cpp. CLOSED TREE 2021-03-10 20:17:17 +02:00
Brad Werth
663b3dcf4c Bug 1692029 Part 1: Make TextureHost report a native texture policy. r=lsalzman
Whether or not we use a native texture or something else is affected by our
backend and the size of the texture. This patch adds a new function to
centralize that logic in TextureHost, and applies it in callsites that were
checking the backend to determine an image type.

Differential Revision: https://phabricator.services.mozilla.com/D106568
2021-03-10 16:52:32 +00:00
Alexandru Michis
927a7e7bcb Backed out changeset be5184939453 (bug 1692029) for causing bustages in RenderTextureHostSWGL.cpp
CLOSED TREE
2021-03-10 07:24:05 +02:00
Brad Werth
3c2db5c126 Bug 1692029 Part 1: Make TextureHost report a native texture policy. r=lsalzman
Whether or not we use a native texture or something else is affected by our
backend and the size of the texture. This patch adds a new function to
centralize that logic in TextureHost, and applies it in callsites that were
checking the backend to determine an image type.

Differential Revision: https://phabricator.services.mozilla.com/D106568
2021-03-10 00:46:32 +00:00
Andrew Osmond
0b0e0c4795 Bug 1694480 - Notify parent process of low virtual memory in GPU process. r=jrmuizel
On 32-bit Windows, we see crashes related to running out of virtual
memory address space in the GPU process. Prior to this patch, we did not
report any memory status information from the GPU process to the parent,
only from the parent to the GPU process. Now if we go below the
threshold we request memory to be cleared in the parent/content
processes. This should trickle down to the GPU process by freeing shared
memory resources such as images, allowing us to unmap them out of the
GPU process sooner.

We will see similar problems on any 32-bit platform. The only other
target of note with sufficient numbers is 32-bit Android. There is no
GPU process on Android, however we only monitor the virtual memory
address space on Windows.

Differential Revision: https://phabricator.services.mozilla.com/D106286
2021-02-25 15:38:45 +00:00
Andrew Osmond
1d19fa73aa Bug 1688096 - Part 1. Merge SW-WR and WR render texture host paths to allow mixed compositors. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D104854
2021-02-24 19:39:59 +00:00
Jim Blandy
3091e53384 Bug 1694547: Let chrome JavaScript control WebRender capture sequence parameters. r=jrmuizel
This patch is plumbing to get a path and a flags word through from the content
process to the graphics process, to pass to `wr_api_start_capture_sequence`.

Differential Revision: https://phabricator.services.mozilla.com/D106229
2021-02-24 18:52:08 +00:00
sotaro
c387a6c22b Bug 1690621 - Send DidComposite only when it is necessary r=nical
Differential Revision: https://phabricator.services.mozilla.com/D105591
2021-02-22 21:55:04 +00:00
Simon Giesecke
2634de766d Bug 1691913 - Rename nsClassHashtable::LookupOrAdd to GetOrInsertNew. r=xpcom-reviewers,nika
It should be called "Get" rather than "Lookup" because it returns
UserDataType. "Add" is called "Insert" in the other methods.

Differential Revision: https://phabricator.services.mozilla.com/D105470
2021-02-22 12:07:47 +00:00
Cosmin Sabou
9ef271b5ba Backed out 2 changesets (bug 1688096) for win webrender sw_compositor related crashes. CLOSED TREE
Backed out changeset aa0d1698aff8 (bug 1688096)
Backed out changeset 3ad2f4d0c317 (bug 1688096)
2021-02-18 19:52:29 +02:00
Andrew Osmond
cd218bcf63 Bug 1688096 - Part 1. Merge SW-WR and WR render texture host paths to allow mixed compositors. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D104854
2021-02-18 15:37:46 +00:00
smolnar
f7ba61e1f9 Backed out 2 changesets (bug 1688096) for linux debug build bustage in KnowsCompositor. CLOSED TREE
Backed out changeset 6cdfa0af2278 (bug 1688096)
Backed out changeset 6471b0910f45 (bug 1688096)
2021-02-18 14:34:49 +02:00
Andrew Osmond
b76cb0a8b0 Bug 1688096 - Part 1. Merge SW-WR and WR render texture host paths to allow mixed compositors. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D104854
2021-02-18 11:50:05 +00:00
Andrew Osmond
bd88b98bbf Bug 1691065 - Discard invalid resource update transactions due to namespace changes. r=jrmuizel
When we change the namespace, we discard all cached resources and their
associated keys from the WebRender cache. As such if any transaction
comes in with the old namespace ID, we can safefully discard the entire
update, since we will need to recreate any that we are using anyways.

This patch also adds new asserts to ensure we never get old namespace
IDs for individual keys in a valid resource update. This should never
happen in practice.

Differential Revision: https://phabricator.services.mozilla.com/D104236
2021-02-06 13:29:47 +00:00
Mihai Alexandru Michis
f49e550b87 Backed out changeset d96ca6e90aa2 (bug 1691065) for causing Bug 1691125.
CLOSED TREE
2021-02-05 22:56:17 +02:00
Andrew Osmond
25c0854faf Bug 1691065 - Discard invalid resource update transactions due to namespace changes. r=jrmuizel
When we change the namespace, we discard all cached resources and their
associated keys from the WebRender cache. As such if any transaction
comes in with the old namespace ID, we can safefully discard the entire
update, since we will need to recreate any that we are using anyways.

This patch also adds new asserts to ensure we never get old namespace
IDs for individual keys in a valid resource update. This should never
happen in practice.

Differential Revision: https://phabricator.services.mozilla.com/D104236
2021-02-05 16:32:53 +00:00
Bogdan Tara
f0aef678f7 Backed out changeset 43ea8faea099 (bug 1690857) for causing bug 1691025 a=backout 2021-02-05 15:29:17 +02:00
Andrew Osmond
5973e10d9c Bug 1690857 - Add diagnostic assert to ensure we aren't using stale blob keys in the compositor process. r=jrmuizel
Similar to bug 1690821 in the content process, this adds an assert in
the other side in case of a race condition.

Differential Revision: https://phabricator.services.mozilla.com/D104086
2021-02-04 19:05:50 +00:00
sotaro
f533797d0c Bug 1688144 - Add more error logs to WebRenderBridgeParent::UpdateResources() r=nical,aosmond
It seems better to add more error logs to WebRenderBridgeParent::UpdateResources().

Differential Revision: https://phabricator.services.mozilla.com/D102691
2021-01-22 12:42:28 +00:00
Andrew Osmond
83618d3569 Bug 1682367 - Add crash report annotation for which WebRender shader is being compiled. r=jrmuizel,chutten
This patch adds infrastructure for crash reporter annotations to
WebRender. This is used to expose the new annotation,
GraphicsCompileShader, to indicate which shader we are in the process of
compiling. We often see crash reports when compiling shaders, and it
would be useful to know which one it is compiling.

This also adds another annotation, IsWebRenderResourcePathOverridden,
which is useful to know if someone overrode the shader resource path for
testing purposes. We can likely ignore any crash reports that have this
annotation set.

Differential Revision: https://phabricator.services.mozilla.com/D99736
2020-12-15 16:24:04 +00:00
Markus Stange
70a314f909 Bug 1677929 - Store APZScroll composition payloads based on composition vsync ID, not based on epoch. r=kats
The epoch doesn't change during pure-APZ scrolling, so we were picking up
payloads from a future composite. As a result, we were computing incorrect
latencies, when the actual latencies were in fact one frame higher.

Differential Revision: https://phabricator.services.mozilla.com/D97536
2020-12-08 22:47:56 +00:00
Markus Stange
46ea354af1 Bug 1677929 - Add a way to specify an ID for a generated frame, and propagate the ID to the APZSampler. r=gw,kats
This ID allows the compositor to track per-frame information from frame
generation, through APZ sampling, to the NotifyDidRender notification.

Differential Revision: https://phabricator.services.mozilla.com/D97535
2020-12-09 03:35:50 +00:00
Markus Stange
a867907ff8 Bug 1677929 - Record payloads with the correct composition end timestamp. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D97534
2020-12-08 22:40:33 +00:00