Граф коммитов

300 Коммитов

Автор SHA1 Сообщение Дата
Mike Hommey dace8a4e06 Bug 1766561 - Use %p for pointer types. r=gfx-reviewers,rkraesig,nika,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D144913
2022-05-03 20:49:06 +00:00
Nicolas Silva 752a0ee047 Bug 1763405 - Use a higher priority for the renderer thread. r=gfx-reviewers,jnicol
The renderer thread is at the end of the rendering pipeline. For smoothness it is important that it completes its work quickly as soon as it receives some. It does not produce work for other threads so we don't risk of causing some build up. On the other hand, the higher priority will help with with avoiding some cases of congestion of work coming from the content process.

This only bumps the priority of the renderer thread as opposed to the entire GPU process (Blink does the latter). This is because we currently have too many thread on the GPU process so there is a risk of completely starving other processes. It's still something we want to consider and might be safer after we have done the work of reducing the number of threads.

Differential Revision: https://phabricator.services.mozilla.com/D143056
2022-04-07 09:37:45 +00:00
Andrew Osmond dfd75c103a Bug 1761832 - Protect GLLibraryEGL singleton against race conditions. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D142257
2022-03-28 21:16:58 +00:00
Florian Quèze 9c9aca9d89 Bug 1757202 - Include the inner window id in the existing Composite markers, r=mstange.
Differential Revision: https://phabricator.services.mozilla.com/D139731
2022-03-11 07:49:05 +00:00
sotaro 7991ca6079 Bug 1757879 - Make SimulateDeviceReset() similar to actual device reset handling r=ipc-reviewers,gfx-reviewers,lsalzman,mccr8
SimulateDeviceReset() works differently from actual device reset handling. It seems better to make SimulateDeviceReset() more similar to actual device reset handling.

Differential Revision: https://phabricator.services.mozilla.com/D140161
2022-03-08 23:14:28 +00:00
Andrew Osmond 45ae50555d Bug 1754978 - Part 1. Refactor CompositableHandle infrastructure to allow in-process driven handles. r=sotaro
For WebGPU, we produce the textures in the compositor process and the
content process doesn't need to be that involved except for hooking up
the texture to the display list. Currently this is done via an external
image ID.

Given that WebGPU needs to work with OffscreenCanvas, it would be best
if its display pipeline was consistent whether it was gotten from an
HTMLCanvasElement, OffscreenCanvas on the main thread, or on a worker
thread. As such, using an AsyncImagePipeline would be best.

However there is no real need to bounce the handles across process
boundaries. Hence this patch which adds CompositableInProcessManager.
This static class is responsible for collecting WebRenderImageHost
objects backed by TextureHost objects which do not leave the compositor
process. This will allow WebGPUParent to schedule compositions directly
in future patches.

Differential Revision: https://phabricator.services.mozilla.com/D138588
2022-02-18 15:59:12 +00:00
Iulian Moraru 3dbfe82835 Backed out 2 changesets (bug 1754978) for causing valgrind bustages.
Backed out changeset 491a985fc34a (bug 1754978)
Backed out changeset 98983bf9eaed (bug 1754978)
2022-02-18 00:36:31 +02:00
Andrew Osmond 23a67affe1 Bug 1754978 - Part 1. Refactor CompositableHandle infrastructure to allow in-process driven handles. r=sotaro
For WebGPU, we produce the textures in the compositor process and the
content process doesn't need to be that involved except for hooking up
the texture to the display list. Currently this is done via an external
image ID.

Given that WebGPU needs to work with OffscreenCanvas, it would be best
if its display pipeline was consistent whether it was gotten from an
HTMLCanvasElement, OffscreenCanvas on the main thread, or on a worker
thread. As such, using an AsyncImagePipeline would be best.

However there is no real need to bounce the handles across process
boundaries. Hence this patch which adds CompositableInProcessManager.
This static class is responsible for collecting WebRenderImageHost
objects backed by TextureHost objects which do not leave the compositor
process. This will allow WebGPUParent to schedule compositions directly
in future patches.

Differential Revision: https://phabricator.services.mozilla.com/D138588
2022-02-16 22:23:19 +00:00
sotaro a0a0c88a98 Bug 1754388 - Forward more functions in RenderTextureHostWrapper r=gfx-reviewers,aosmond
This is a preparation for Bug 1754330.

Differential Revision: https://phabricator.services.mozilla.com/D138258
2022-02-09 13:44:13 +00:00
sotaro f9873bede0 Bug 1722447 - Add YUV SwapChain support to hardware decoded video r=gfx-reviewers,nical
Implementation is borrowed from chromium's SwapChainPresenter.

Differential Revision: https://phabricator.services.mozilla.com/D136460
2022-01-26 00:17:37 +00:00
sotaro 54e275e8ad Bug 1749183 - Fix RenderThread::HandleDeviceReset() for simulate device reset r=gfx-reviewers,aosmond
Current RenderThread::HandleDeviceReset() does nothing for simulate device reset.

Differential Revision: https://phabricator.services.mozilla.com/D135590
2022-01-20 00:22:36 +00:00
sotaro 5de1ee0b12 Bug 1750557 - Clear RenderTextureHosts in RenderThread::ShutDownTask() r=gfx-reviewers,aosmond
Need to destroy RenderTextureHosts in RenderThread::ShutDownTask().

Differential Revision: https://phabricator.services.mozilla.com/D136124
2022-01-19 00:05:48 +00:00
sotaro a1fc801ef7 Bug 1743972 - Reduce Runnable usage in RenderThread::AddRenderTextureOp() r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D132666
2021-12-06 23:23:20 +00:00
sotaro e589a4b731 Bug 1744186 - A bit of clean up of RenderThread::HandleDeviceReset() r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D132762
2021-12-06 23:22:53 +00:00
sotaro 8fd3a5894c Bug 1740675 - Cleanup device handling around RenderThread r=nical,gfx-reviewers
RenderCompositorANGLE::ShutdownEGLLibraryIfNecessary() is not necessary since Bug 1656034 fix. Device reset handling could be more platform independent.

Differential Revision: https://phabricator.services.mozilla.com/D130960
2021-11-25 02:49:29 +00:00
Nicolas Silva df84c8ca7c Bug 1741742 - Put the window ID in the composite profile marker name. r=gfx-reviewers,jrmuizel
It's useful to be able to see in profiles when multiple windows are being rendered.

Differential Revision: https://phabricator.services.mozilla.com/D131510
2021-11-19 10:07:59 +00:00
sotaro 1b44e05e92 Bug 1741784 - Remove unused code around CompositableHost r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D131466
2021-11-19 07:41:29 +00:00
Narcis Beleuzu ce6ad351e2 Backed out changeset 12736f9bf7b5 (bug 1741784) for compositor leakchecks. CLOSED TREE 2021-11-18 18:07:09 +02:00
sotaro 2dc3b69cde Bug 1741784 - Remove unused code around CompositableHost r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D131466
2021-11-18 14:16:35 +00:00
Alexandru Michis b4ca6a1ac3 Backed out changeset 413c914dd84b (bug 1740675) for causing geckoview failures.
CLOSED TREE
2021-11-17 04:50:58 +02:00
sotaro 8ca63c894d Bug 1740675 - Cleanup device handling around RenderThread r=nical,gfx-reviewers
RenderCompositorANGLE::ShutdownEGLLibraryIfNecessary() is not necessary since Bug 1656034 fix. Device reset handling could be more platform independent.

Differential Revision: https://phabricator.services.mozilla.com/D130960
2021-11-17 01:18:05 +00:00
sotaro e13c31b137 Bug 1739553 - Use wr::ExternalImageId in more places r=gfx-reviewers,bradwerth
It could make code more explicit.

Differential Revision: https://phabricator.services.mozilla.com/D130434
2021-11-07 07:26:45 +00:00
Andrew Osmond cdc239b74f Bug 1734649 - Part 2. Create PCanvasManager to manage WebGL instances. r=jrmuizel
This patch adds the necessary IPDL plumbing to allow us to create WebGL
instances off the main thread in the content process, and to execute
them on the Renderer thread in the compositor process.

Differential Revision: https://phabricator.services.mozilla.com/D127839
2021-11-04 16:29:44 +00:00
Nicolas Silva cb6ac0df62 Bug 1690619 - Keep track of where the request to rendering something comes from. r=gfx-reviewers,mstange
This patch adds plumbing to keep track of why we request frames to be rendered.
This information is then displayed in gecko profile markers on the renderer thread as well as in profiler HUD counters (See "Render reasons" in profiler.rs).

Differential Revision: https://phabricator.services.mozilla.com/D127274
2021-10-05 12:54:39 +00:00
sotaro 641ab17cd9 Bug 1727511 - Add mozlog around WebRenderBridgeParent and RenderThread r=gfx-reviewers,jrmuizel,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D123616
2021-09-01 22:27:15 +00:00
criss 10c4c4351f Backed out changeset 25acfe977062 (bug 1727511) for causing valgrind build bustages. CLOSED TREE 2021-08-27 18:24:28 +03:00
sotaro a4dae9b314 Bug 1727511 - Add mozlog around WebRenderBridgeParent and RenderThread r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D123616
2021-08-27 06:37:32 +00:00
Jamie Nicol ebb76fd7e3 Bug 1719437 - Do not initialize shaders when creating SingletonGL for software webrender. r=aosmond
It leads to OpenGL errors, as we must initialize a webrender Device in
order to initialize the shaders, and this Device attempts to use
OpenGL commands not supported by the GL context. For example the GL
context may only support GLES 2, hence why we are using SWGL in the
first place.

Differential Revision: https://phabricator.services.mozilla.com/D120356
2021-07-20 19:10:58 +00:00
Brad Werth 3094cf0606 Bug 1717887 Part 2: Make RenderThread backed by nsIThread, with a hang monitor. r=gfx-reviewers,jrmuizel
The background hang monitor uses the same timing thresholds as the one used by
the compositor thread, for similar reasons.

Differential Revision: https://phabricator.services.mozilla.com/D120117
2021-07-19 17:35:55 +00:00
Brad Werth 0034019aba Bug 1717887 Part 1: Abstract RenderThread task pushing, and make it private. r=gfx-reviewers,jrmuizel
Instead of warning against callers directly accessing the thread message loop,
actuually prevent them from doing so. This is also a preliminary step to
changing the type of the internally-created thread, which will no longer
directly expose its message loop.

Differential Revision: https://phabricator.services.mozilla.com/D119562
2021-07-19 17:35:55 +00:00
Csoregi Natalia 7543c5e82b Backed out changeset fb2f9cfe820d (bug 1716579) for valgrind bustage. CLOSED TREE 2021-06-17 19:40:08 +03:00
Nicolas Silva 7dc5b1ba84 Bug 1716579 - Minimize memory usage of windows that haven't been rendered for a long time. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D117918
2021-06-17 12:42:02 +00:00
Robert Mader da50a756c0 Bug 1713468 - Support RenderCompositorEGL on X11-only builds,
Right now X11-only builds will use `RendenderCompositorOGL` with EGL,
which could lead to unexpected bugs that are hard to diagnose.

It also makes code harder to read if code in `MOZ_WAYLAND` blocks
is used by the X11 backend.

While on it, rename and reorder `PauseRemoteRenderer()` so it matches
its counterpart `MaybeResumeCompositor()` better.

Note: This revision was accepted in D116315 but some bug in lando
required a recreation.

Differential Revision: https://phabricator.services.mozilla.com/D116530
2021-06-01 23:55:28 +00:00
Robert Mader 89349d8182 Bug 1699985 - Implement basic native Wayland compositor backend, r=stransky,mstange,aosmond
This implements a mostly working native backend for Wayland. It can
be enabled via `gfx.webrender.compositor.force-enabled`.

The focus here was to get a basic structure in place while mini-
mising changes in shared code.

Known issues and limitations:
 - No readback - this will likely require an internal compositor
   again, as Wayland doesn't allow easily allow readback of the
   composited image, at least not without asking for permission.
   Alternatively, a new Wayland extension could be written for it.
 - Frame-call related issues when using a compositor that optimizes
   them (e.g. Gnome-Shell). This will be fixed in a follow-up, in
   the mean time disabling `widget.wayland.opaque-region.enabled`
   and `widget.wayland.vsync.enabled` works around the issues.
 - Only works on Weston or very recent versions of Gnome-Shell, see
   bug 1699754

Differential Revision: https://phabricator.services.mozilla.com/D111662
2021-05-11 13:38:59 +00:00
Robert Mader 68fa6c04b1 Bug 1707943 - webrender_bindings: Fix warnings and apply suggestions form static analysis, r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D113603
2021-04-28 12:33:55 +00:00
Andrew Osmond 77a93b91d2 Bug 1704227. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D113191
2021-04-26 21:04:29 +00:00
Andrew Osmond ee7fc9f3fd Bug 1699224 - Part 3. Complete shutdown of SharedSurfacesParent on the main thread. r=jrmuizel
We want to use nsExpirationTracker to decide when we should unmap shared
surfaces from our address space. This relies upon the observer service
and we need to be both initialized and shutdown on the main thread to
add/remove the observer. SharedSurfacesParent is already initialized on
the main thread, and we just need to complete shutdown on the main
thread.

Differential Revision: https://phabricator.services.mozilla.com/D109439
2021-03-29 22:43:27 +00:00
sotaro be748acc0e Bug 1701563 - Recreate RenderThread::mSingletonGL during fallback to RenderCompositorEGL r=nical
GLContext for CompositorOGL does not need depth buffer. Then it is better to re-create the mSingletonGL during fallback to RenderCompositorOGLSWGL.

Differential Revision: https://phabricator.services.mozilla.com/D110057
2021-03-29 13:34:16 +00:00
sotaro 4b1f1757e1 Bug 1701135 - Share ShaderProgramOGLs between CompositorOGLs during sw-wr + CompositorOGL r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D109856
2021-03-28 23:55:05 +00:00
Noemi Erli ebaee4ef03 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 a5c6568905 Bug 1699224 - Part 3. Complete shutdown of SharedSurfacesParent on the main thread. r=jrmuizel
We want to use nsExpirationTracker to decide when we should unmap shared
surfaces from our address space. This relies upon the observer service
and we need to be both initialized and shutdown on the main thread to
add/remove the observer. SharedSurfacesParent is already initialized on
the main thread, and we just need to complete shutdown on the main
thread.

Differential Revision: https://phabricator.services.mozilla.com/D109439
2021-03-26 18:21:15 +00:00
Butkovits Atila a8a0f140d3 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 fb0a72803b Bug 1699224 - Part 3. Complete shutdown of SharedSurfacesParent on the main thread. r=jrmuizel
We want to use nsExpirationTracker to decide when we should unmap shared
surfaces from our address space. This relies upon the observer service
and we need to be both initialized and shutdown on the main thread to
add/remove the observer. SharedSurfacesParent is already initialized on
the main thread, and we just need to complete shutdown on the main
thread.

Differential Revision: https://phabricator.services.mozilla.com/D109439
2021-03-26 13:21:52 +00:00
sotaro 51f31c2181 Bug 1699598 - Create GLContext for CompositorOGL when sw-wr is enabled on Android r=jnicol
Confirmed that the change work on Mali-400 MP device.
GLContextProviderEGL::CreateForCompositorWidget() with aWebRender=true failed to create GLContext when GLES3 is not supported on device. When aWebRender=false, it does not request depth buffer nor GLES3. Though when android device supports GLES3, GLES3 context was created on android devices that I tested.

Differential Revision: https://phabricator.services.mozilla.com/D109015
2021-03-23 12:10:58 +00:00
stransky 97fe4dc9a5 Bug 1684194 [Linux] Use RenderCompositorEGL on X11/EGL, r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D108508
2021-03-18 13:46:03 +00:00
sotaro 429fab5354 Bug 1699001 - Rename RenderThread::SharedGL() to SingletonGL() r=nical
Name of Singleton is commonly used in gecko.

Name of SharedGL is confusing. It looks like "shared context", but it is not. The GL context is actually a singleton GLContext that is used by all WebRender. Each window creates one EGLSurface for each window. EGLSurface is switched for each window rendering.

Differential Revision: https://phabricator.services.mozilla.com/D108714
2021-03-17 10:51:45 +00:00
Jan Alexander Steffens (heftig) 4920407bb3 Bug 1696845 - Use dlsym for gdk_*_display_get_type. r=stransky
Using `dlsym` for `gdk_wayland_display_get_type` is a cleaner solution
to bug 1696319, allowing running with a GTK that lacks the Wayland
backend.

Also adds a symmetric implementation for `gdk_x11_display_get_type`,
which should help running without X11.

Differential Revision: https://phabricator.services.mozilla.com/D107406
2021-03-11 14:32:53 +00:00
Narcis Beleuzu 198358fc15 Backed out changeset a4f4f640eaa7 (bug 1696845) for bustages on pangofc-fontmap.h 2021-03-10 04:49:51 +02:00
Jan Alexander Steffens (heftig) 1261a74d17 Bug 1696845 - Use dlsym for gdk_*_display_get_type. r=stransky
Using `dlsym` for `gdk_wayland_display_get_type` is a cleaner solution
to bug 1696319, allowing running with a GTK that lacks the Wayland
backend.

Also adds a symmetric implementation for `gdk_x11_display_get_type`,
which should help running without X11.

Differential Revision: https://phabricator.services.mozilla.com/D107406
2021-03-09 22:55:47 +00:00
sotaro 66df971f6f Bug 1696105 - Remove aBridge argument from RenderThread::HandleDeviceReset() r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D107033
2021-03-03 10:29:40 +00:00