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

473 Коммитов

Автор SHA1 Сообщение Дата
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
Randell Jesup fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli 2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup 4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Butkovits Atila 927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup 7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
Andrew Osmond 9769b476b0 Bug 1751816 - Improve error handling in GLContextEGL::CreateCompatibleSurface. r=jgilbert
Rather than just crashing, if we return a nullptr in
CreateCompatibleSurface, then we will just cause a context loss for
WebGL instances. This would be better for beta/release than just
crashing the content process on the user.

So that we can get a sense of what errors are causing this, we should
record it to the critical log. This will still crash on nightly as well
so we should get the reports.

Differential Revision: https://phabricator.services.mozilla.com/D136825
2022-01-27 17:07:19 +00:00
Robert Mader c3731eafe0 Bug 1736621 - [X11][EGL] Ensure to use the same swap interval as on Wayland, r=stransky,gfx-reviewers,jgilbert
While no issues with these cases are known yet, there is no reason
why we would want this case to diverge between Wayland and X11.

Spotted by Darkspirit.

Differential Revision: https://phabricator.services.mozilla.com/D128910
2021-10-19 22:59:05 +00:00
Nicolas Silva 962e3b930f Bug 1723134 - Make SwapInterval configurable via prefs for EGL and GLX. r=gfx-reviewers,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D128476
2021-10-19 15:04:08 +00:00
Robert Mader 873d1bdc06 Bug 1644606 - Add a pref to select between GLES and desktop GL contexts on EGL, r=gfx-reviewers,nical
This preference was requested by driver developers, simplifying
debugging processes. It is especially useful on Linux, but may
be handy on other platforms as well.

As a side effect it also ensures the two places with fallback paths
behave the same again on Android.

Depends on D128411

Differential Revision: https://phabricator.services.mozilla.com/D128592
2021-10-19 11:11:47 +00:00
Marian-Vasile Laza 35bb26d03e Backed out changeset af60c05d5dae (bug 1723134) for causing buid bustages on RenderCompositorEGL.cpp. 2021-10-19 13:52:26 +03:00
Nicolas Silva d3c8057ea3 Bug 1723134 - Make SwapInterval configurable via prefs for EGL and GLX. r=gfx-reviewers,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D128476
2021-10-19 09:22:01 +00:00
Robert Mader 882cbca923 Bug 1735939 - Never use CreateConfigScreen() on EGL on Linux, r=stransky
There is only one case left where we use the `CreateConfigScreen()`
path on Linux: on Software OpenGL / `gfx.webrender.software.opengl:true`.
It is not used when using WebGL with SW-WR.

It triggers an analogous bug like the one fixed in D109737. Given
that we disable EGL on 16bit configs already, also force 32bit
in this case.

Depends on D128411

Differential Revision: https://phabricator.services.mozilla.com/D128586
2021-10-16 07:40:32 +00:00
Robert Mader 7226949026 Bug 1702546 - Make sure to request EGL configs with matching alpha visual, r=stransky
`GLContextEGL::FindVisual()` currently does not work correctly for
multiple reasons. This patch:
 - fixes transparency issues on Nvidia
 - fixes occasional `EGL_BAD_MATCH` errors on Nvidia
 - allows fixed Mesa (#149) to also use `GLContextEGL::FindVisual()`,
   falling back to `GLContextGLX::FindVisual()` on older versions.
 - does some cleanups that are now possible

Some context:
 - When using EGL we essentially always want visuals with alpha
   nowadays as we do not implement Xshape in HW Webrender. This also
   matches what we do on Wayland and the performance cost is negligible
   as we use opaque regions on toplevel windows.
 - When using `RenderCompositorEGL` we create a global EGL context
   before creating windows. Some drivers (Mesa) are very liberal about
   EGL configs matching visuals, but others (Nvidia) require exact
   matches.
 - Nvidia places EGL configs with non-alpha visuals first, so the
   current code always chooses a config for the global context that,
   when calling `GLContextEGL::FindVisual()` later, results in a
   non-transparent window.
 - Mesa will behave similar once fixed. Currently it does not offer any
   visuals with alpha.

In this patch we make sure to always pick EGL configs that have a
matching visual, i.e. one with alpha if alpha is requested for the
config.
In practice we thus always pick 32bit RGBA8888 configs and visuals.

For Mesa, where currently no such configs are provided, we continue to
provide a fallback config and use GLX to pick some visual with alpha.
This is what we already do right now and what appears to work well.
Once the fix is available, we stop using the fallback code
automatically.

Note: in theory `GLContextEGL::FindVisual()` IMO should not call
`CreateConfig()`, but rather take an existing config or context in
and then just provide the matching visual. This, however, would require
significant work with little benefit. The calls to `CreateConfig()`
should always provide the same and thus matching results.

Differential Revision: https://phabricator.services.mozilla.com/D128411
2021-10-16 07:34:41 +00:00
Robert Mader 27ed750ccc Bug 1733094 - Assume UseWebRender for FindVisual, r=stransky,emilio
`gfxVars::UseWebRender()` now always returns `true`, thus stop passing
it around as argument. And as HW-WR unconditionally requires an alpha
channel, remove that from the code as well.

While on it, also stop requesting a depth buffer. It's not needed any
more after D113532 and D115216.

Finally, some small drive-by cleanups.

Differential Revision: https://phabricator.services.mozilla.com/D126922
2021-10-06 11:30:37 +00:00
Cristian Tuns ae2fa375ec Backed out changeset 94ec92a5e99f (bug 1733094) for causing mochitest failures on test_drawWindow_widget_layers.html. CLOSED TREE 2021-10-04 19:45:34 -04:00
Robert Mader d7319e8f22 Bug 1733094 - Assume UseWebRender for FindVisual, r=stransky,emilio
`gfxVars::UseWebRender()` now always returns `true` thus stop passing
it around as argument.

At the same time, WR does not require a depth buffer any more, thus
stop requesting it when choosing a matching XVisual.

While on it, also stop requesting an alpha channel were it shouldn't
be needed. This point will require some regression testing, making
this patch 95 material.

Differential Revision: https://phabricator.services.mozilla.com/D126922
2021-10-04 20:28:24 +00:00
Jeff Muizelaar 4d2306308f Bug 1728991 - Drop some unused gfxASurface includes. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D124456
2021-09-03 16:00:34 +00:00
Robert Mader f691c9ecf9 Bug 1718569 - Implement custom FBO management, r=jgilbert,gfx-reviewers
Instead of using the Wayland EGL platform. The later is very convenient
but has several limitations. Managing FBOs allows to make our code more
similar to that of MacOS as well as the Wayland software backend.

Most importantly, it will allow us to cleanly implement partial damage
by giving us direct acces to previously submitted buffers, allowing us
to blit back from them, similar like in
`NativeLayerCA::HandlePartialUpdate`.
There are several other fields where more control over buffers will
come in handy, too many to describe them here in detail.

Note: we still use individual buffer pools for each tile. However, this
change brings everything into place to allow us to change to a more
`SurfacePoolCA`-style shared pool. That will reduce GPU-memory usage.

Includes some minor cleanups here and there.

Depends on D119013

Differential Revision: https://phabricator.services.mozilla.com/D118925
2021-07-13 13:44:12 +00:00
Sandor Molnar 6c075398dd Backed out 2 changesets (bug 1718570, bug 1718569) for causing wpt failures in /css/css-flexbox/flexbox-align-self-vert-001. CLOSED TREE
Backed out changeset 59cdbaaa6a7b (bug 1718570)
Backed out changeset 489ce763c140 (bug 1718569)
2021-07-13 08:52:28 +03:00
Robert Mader f3231d9976 Bug 1718569 - Implement custom FBO management, r=jgilbert,gfx-reviewers
Instead of using the Wayland EGL platform. The later is very convenient
but has several limitations. Managing FBOs allows to make our code more
similar to that of MacOS as well as the Wayland software backend.

Most importantly, it will allow us to cleanly implement partial damage
by giving us direct acces to previously submitted buffers, allowing us
to blit back from them, similar like in
`NativeLayerCA::HandlePartialUpdate`.
There are several other fields where more control over buffers will
come in handy, too many to describe them here in detail.

Note: we still use individual buffer pools for each tile. However, this
change brings everything into place to allow us to change to a more
`SurfacePoolCA`-style shared pool. That will reduce GPU-memory usage.

Includes some minor cleanups here and there.

Depends on D119013

Differential Revision: https://phabricator.services.mozilla.com/D118925
2021-07-13 00:55:29 +00:00
Jeff Muizelaar a7817816b7 Bug 1716559 - Remove TextureImageEGL. r=jnicol,jgilbert
TextureImageEGL doesn't seem to provide any value beyond
BasicTextureImage. It's last usage was bug 814159.

Removing this has the side effect of using BasicTextureImage
for small images instead of always using TilingTextureImage.

Differential Revision: https://phabricator.services.mozilla.com/D117904
2021-06-15 21:10:47 +00:00
Dorel Luca 2190a59721 Backed out changeset c30c8b8dc0b5 (bug 1715902) on Dev's request. CLOSED TREE 2021-06-11 15:48:11 +03:00
Andrew Osmond 330727f6e8 Bug 1715902 - Refuse WebRender on Linux if backed by software driver. r=jrmuizel
When trying to create a GLContextEGL or GLContextGLX, we should check to
see what our display is backed by. If using a software driver, we should
fail to create the context for WebRender, so that it can fallback to
Software WebRender.

Differential Revision: https://phabricator.services.mozilla.com/D117473
2021-06-11 12:16:36 +00:00
Robert Mader de931f5505 Bug 1712472 - Reenable depth-buffer in EGL config if native compositor is used, r=jgilbert,gw
After D113532, a depth-buffer is not needed any more for the draw
compositor and it was subsequently removed from the EGL and GLX
context providers in D115216. This, however, broke the experimental
Wayland native compositor integration, which still needs it.

`SurfacePoolCA` solves this by manually attaching a depth buffer in
`CreateFramebufferForTexture`. `SurfacePoolWayland` will likely be
able to do the same eventually, however until that is the case
we need the GL context to provide it.

While on it, move the hardcoded bits into a better place below the
hard-coded values for ANGLE and remove now used code to make things
less cluttered.

Context: the `aDepth` argument was introduced in D76417 for EGL on X11
support, which used `RenderCompositorOGL`. This was changed in D108508,
making X11/EGL use `RenderCompositorEGL` instead, which uses a shared
GL singleton. This again required the color depth to be independent of
the window, so 32bit color depth was hardcoded in D109737. Therefore,
the `aDepth` and other things introduced in D76417 can be removed again.
Finally, it was found that we only need 32bit depth when used with
HW-WR, see also D114959.

Differential Revision: https://phabricator.services.mozilla.com/D115760
2021-05-25 08:03:28 +00:00
Jeff Muizelaar 4e1bc5a36f Bug 1711490 - Stop using allocating a depth buffer for the main window. r=nical
In bug 1696905 we removed our need for depth buffer when running the
composite shader.

Differential Revision: https://phabricator.services.mozilla.com/D115216
2021-05-17 19:54:35 +00:00
Robert Mader 76023e93e9 Bug 1709606 - Rename CompositorWidget::AsX11() to CompositorWidget->AsGTK(), r=stransky,nical
Nowadays we often use it for Wayland, which is confusing. Also, it
has a bunch of GTK specific functions, which an alternative X11
implementation would like not have. So a explicit name is probably
deserved.

Depends on D114424

Differential Revision: https://phabricator.services.mozilla.com/D114425
2021-05-07 12:31:28 +00:00
sotaro 1001dc3ad6 Bug 1700524 - Rename aWebRender of CreateForCompositorWidget() to aHardwareWebRender r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D109570
2021-04-07 07:04:43 +00:00
Robert Mader 1dcdf4e04c Bug 1699864 - Request 32bit color depth on Linux/EGL by default, r=stransky,jgilbert
Since D108508 the X11/EGL backend creates a shared GL context via
`CreateGLContextEGL()` which chains up to `CreateForCompositorWidget()`
with a `nullptr` widget. With the OGL compositor we relied on the
widget giving us a valid color depth, while now we'd fall back to
`gfxVars::ScreenDepth()`.

On X11 color depth is defined as:
> depth means the number of bits in a pixel that are actually used
> to determine the pixel color

i.e. we on a usual system we would get 24bit.

As we require an alpha channel when using WR, the result would be
disappointing. Thus hardcode 32bit color depth for X11/EGL when
creating contexts without widget for now.

In order to keep X11 and Wayland code close together, do the same
on Wayland, even if `gfxVars::ScreenDepth()` returns valid values
there.

Differential Revision: https://phabricator.services.mozilla.com/D109737
2021-03-25 18:44:13 +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
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
Simon Giesecke ad01a10a3b Bug 1634281 - Use nsTHashMap instead of nsDataHashtable. r=xpcom-reviewers,necko-reviewers,jgilbert,nika,valentin
Note that this patch only transforms the use of the nsDataHashtable type alias
to a directly equivalent use of nsTHashMap. It does not change the specification
of the hash key type to make use of the key class deduction that nsTHashMap
allows for in some cases. That can be done in a separate step, but requires more
attention.

Differential Revision: https://phabricator.services.mozilla.com/D106008
2021-03-10 10:47:47 +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
Simon Giesecke 4f75368dcb Bug 1691913 - Rename nsBaseHashtable::GetOrInsert(With) to LookupOrInsert(With). r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
The functions should be called "Lookup" rather than "Get" because they return
a DataType& (rather than UserDataType).

Differential Revision: https://phabricator.services.mozilla.com/D105472
2021-02-26 09:11:45 +00:00
Simon Giesecke d2caea36fa Bug 1691894 - Simplify uses of WithEntryHandle that only use OrInsert(With) by using GetOrInsertWith. r=xpcom-reviewers,necko-reviewers,jgilbert,nika
Differential Revision: https://phabricator.services.mozilla.com/D104676
2021-02-22 12:07:46 +00:00
Simon Giesecke 8df74b1582 Bug 1688833 - Migrate LookupForAdd to WithEntryHandle in gfx. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D104216
2021-02-09 18:19:40 +00:00
Andrew Osmond a750b3733f Bug 1680759 - Enable EGL robustness with WebRender on Linux. r=jgilbert
This patch enables EGL robustness with WebRender. It also tries harder
to get RBAB, favouring KHR+RBAB over EXT-RBAB, as testing with Intel and
NVIDIA Mesa drivers on Ubuntu suggests we can get KHR+RBAB but not
EXT+RBAB. It also adds support for requesting NVIDIA specific resets via
EGL_NV_robustness_video_memory_purge.

Differential Revision: https://phabricator.services.mozilla.com/D102971
2021-01-26 02:25:08 +00:00
Andi-Bogdan Postelnicu 7b246e293f Bug 1683551 - Make `gfx` buildable outside of `unified-build` environment. r=sg,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D100209
2021-01-04 14:20:17 +00:00
Andrew Osmond ca9f3b661d Bug 1677165 - Add support for partial present to GLX. r=kvark,jgilbert
This adds support for GLX_EXT_buffer_age if available to minimize how
much must be redrawn when using GLX.

Differential Revision: https://phabricator.services.mozilla.com/D93098
2020-11-13 18:41:41 +00:00
Jeff Gilbert 962773730d Bug 1663152 - Ask for 3.2core+ if !REQUIRE_COMPAT_PROFILE on EGL. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D93041
2020-11-07 00:37:07 +00:00
Kartikaya Gupta 6d47eac4ee Bug 1666802 - Remove LayersLogging.*. r=mattwoodrow
The remaining functions are moved to be with their brethren in xpcom.

Differential Revision: https://phabricator.services.mozilla.com/D93146
2020-10-11 21:20:46 +00:00
Dorel Luca f1977d1074 Backed out changeset 016992fe00d7 (bug 1663152) for Browser-chrome failures in browser/base/content/test/performance/browser_startup_mainthreadio.js. CLOSED TREE 2020-10-09 10:53:09 +03:00
Jeff Gilbert 7ac2fb745a Bug 1663152 - Ask for 3.2core+ if !REQUIRE_COMPAT_PROFILE on EGL. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D93041
2020-10-09 00:34:31 +00:00
Jeff Gilbert a426e3880b Bug 1669381 - Replace GLLibraryEGL nsIGfxInfo use with gfxVars. r=mattwoodrow
+ Remove now-unused gfxUtils::ThreadSafeGetFeatureStatus.

Differential Revision: https://phabricator.services.mozilla.com/D92529
2020-10-06 05:43:33 +00:00
Jamie Nicol 7adec85b80 Bug 1575765 - Implement KHR_partial_update for webrender. r=sotaro,jgilbert
KHR_partial_update allows us to avoid rerendering the entire
backbuffer every frame, and instead only render what has changed on
the current frame, as well as the difference between the current
backbuffer and the current frontbuffer. It works similarily to
EXT_buffer_age, which we already support, with the additional
requirement that we must call eglSetDamageRegion each frame before
rendering to the backbuffer.

Modify GLContextEGL::GetBufferAge() so that it queries the age if
either EXT_buffer_age or KHR_partial_update are available. This will
now automatically be queried by webrender through the
PartialPresentCompositor trait. Add a new function to that trait,
set_buffer_damage_region(), whose RenderCompositorEGL implementation
calls eglSetDamageRegion(). Call this from composite_simple(), once
the damage rect has been calculated but before rendering to the
backbuffer.

Additionally, change both RenderCompositorEGL and
RenderCompositorOGL's implementations of
ShouldDrawPreviousPartialPresentRegions() to unconditionally return
true, rather than checking for the existence of EXT_buffer_age (or
adding a new check for KHR_partial_update). The lack of these
extensions does not mean that webrender is able to skip rendering
previous frames' damage. Rather the opposite, it means we cannot
render *only* the previous frames' damage, and must instead always
render the entire buffer.

Differential Revision: https://phabricator.services.mozilla.com/D91203
2020-10-02 10:23:56 +00:00
Razvan Maries 63b41aa30f Backed out 3 changesets (bug 1656533, bug 1575765) for WebRender bustages. CLOSED TREE
Backed out changeset 84c31fd9ff82 (bug 1575765)
Backed out changeset 48c1532d1d9d (bug 1575765)
Backed out changeset ed9075d9319b (bug 1656533)
2020-10-02 12:51:55 +03:00
Jamie Nicol 5b8c7d826e Bug 1575765 - Implement KHR_partial_update for webrender. r=sotaro,jgilbert
KHR_partial_update allows us to avoid rerendering the entire
backbuffer every frame, and instead only render what has changed on
the current frame, as well as the difference between the current
backbuffer and the current frontbuffer. It works similarily to
EXT_buffer_age, which we already support, with the additional
requirement that we must call eglSetDamageRegion each frame before
rendering to the backbuffer.

Modify GLContextEGL::GetBufferAge() so that it queries the age if
either EXT_buffer_age or KHR_partial_update are available. This will
now automatically be queried by webrender through the
PartialPresentCompositor trait. Add a new function to that trait,
set_buffer_damage_region(), whose RenderCompositorEGL implementation
calls eglSetDamageRegion(). Call this from composite_simple(), once
the damage rect has been calculated but before rendering to the
backbuffer.

Additionally, change both RenderCompositorEGL and
RenderCompositorOGL's implementations of
ShouldDrawPreviousPartialPresentRegions() to unconditionally return
true, rather than checking for the existence of EXT_buffer_age (or
adding a new check for KHR_partial_update). The lack of these
extensions does not mean that webrender is able to skip rendering
previous frames' damage. Rather the opposite, it means we cannot
render *only* the previous frames' damage, and must instead always
render the entire buffer.

Differential Revision: https://phabricator.services.mozilla.com/D91203
2020-10-02 08:38:29 +00:00
stransky c14c6f5775 Bug 1663003 [Linux/EGL] When we can't find EGLConfig with actual XVisual, use the first suitable one, r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D89720
2020-09-11 10:39:56 +00:00
Narcis Beleuzu 69a21ed2df Backed out 2 changesets (bug 1663003) for bustages on nsWindow.cpp . CLOSED TREE
Backed out changeset 50a87c4ddf15 (bug 1663003)
Backed out changeset c3035ba4d8fc (bug 1663003)
2020-09-10 23:40:09 +03:00