Bug 255344 - www/firefox: enable HW_COMPOSITING by default
Summary: www/firefox: enable HW_COMPOSITING by default
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-gecko (Nobody)
Depends on:
Reported: 2021-04-23 09:58 UTC by skrech
Modified: 2021-04-23 16:21 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (gecko)


Note You need to log in before you can comment on or make changes to this bug.
Description skrech 2021-04-23 09:58:27 UTC

I've recently updated my PC and added a dGPU nVidia GT710. Up until now I was using the built-in graphics in my AMD processor. I don't remember having any issues. However, after switching to nVidia and downloaded nvidia-drivers package I started noticing tearing/skipping artifacts when scrolling in Firefox. Since I'm new to nvidia tools and configurations, I've spent several days trying to find what is causing the tearing problem while mainly suspecting the driver or KDE. At some point I've noticed that this tearing problem is happening only in Firefox, and resizing/moving windows around the screen was smooth. So, apparently the problem was neither in the driver nor KDE, but in Firefox. I've checked what is written in about:support and noticed the following:

HW_COMPOSITING: available by default, blocked by env: Acceleration blocked by platform

After forcing the hw compositing with `layers.acceleration.force-enabled=True` in about:config scrolling became silky smooth. 

So, is there a reason for disabling hardware compositing by default? In my opinion, with the state of nvidia and amd drivers currently, most of the users would expect these relatively basic accelerations to be enabled by default. If they have problems with something, just then should they try to disable the problematic feature. If there are serious problems, then at least a post-installation message pointing the user to enable acceleration will be very beneficial in both performance and tearing-free experience.
Comment 1 skrech 2021-04-23 10:15:21 UTC
Sorry, forgot to mention that I'm on FreeBSD-13.0-RELEASE with Firefox 88

Comment 2 Jan Beich freebsd_committer 2021-04-23 10:57:52 UTC
(In reply to skrech from comment #0)
> So, is there a reason for disabling hardware compositing by default?

Nothing is disabled downstream. Upstream usually disable features globally then enable via platform whitelists e.g.,

Comment 3 skrech 2021-04-23 12:24:58 UTC
Hello Jan,

The link you gave me seems to be related to WebRender. I'm talking about HW_COMPOSITING. I'm not really sure that they are connected?

Either way, as far as I understand, proprietary drivers should be enabled after v460.32.03 and I'm currently using 460.73.01. Unfortunately, in about:support:

WEBRENDER: disabled by env: Not qualified

I guess this comes from the `#ifdef EARLY_BETA_OR_EARLIER` line. I'm confused since firefox 88 is not an early beta, isn't it? Maybe we are looking at older code snippet?

Anyway, the 'not qualified' output even more signifies that HW_COMPOSITING is not related to WebRender, in my opinion.

Comment 4 skrech 2021-04-23 14:09:23 UTC
OK, from this page:


GL layers acceleration is not yet enabled by default (see bug 594876). You can enable it by setting layers.acceleration.force-enabled=true in about:config. 

Checking bug 594876, closed 24 days ago:

Taking the freedom to close this - accelerated layers are going away in favor of Webrender, which is tracked in bug 1491303.

In other words -- enabling accelerated layers is "self-service" :)
So, it appears that this is really not a port/package problem, we can close this issue.
Comment 5 Jan Beich freebsd_committer 2021-04-23 15:16:26 UTC
(Legacy) OpenGL compositing for Gtk platforms has been on ice[1] due to many regressions. WebRender needed[2] OpenGL compositing due to shared code. As WebRender matured some drivers were qualified[3]. Only Tier1 platforms were qualified, so BSDs and Solaris which also use Gtk and share widget/compositing code with Linux were left out. For example, FreeBSD would be[4] detected as OperatingSystem::Unknown.

HW_COMPOSITING used to show AccelerateLayersByDefault() value but nowadays is overriden via WEBRENDER_QUALIFIED.

[1] https://hg.mozilla.org/mozilla-central/rev/6e02d48ef122
[2] https://hg.mozilla.org/mozilla-central/rev/89d7853edd64
[3] https://hg.mozilla.org/mozilla-central/rev/f3fcf307ee80
[4] https://searchfox.org/mozilla-release/rev/d6ba9f5ed372/widget/GfxInfoBase.cpp#312-357