Bug 255344 - www/firefox: enable HW_COMPOSITING by default
Summary: www/firefox: enable HW_COMPOSITING by default
Status: Closed FIXED
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)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-23 09:58 UTC by skrech
Modified: 2021-06-08 10:58 UTC (History)
1 user (show)

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


Attachments

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
Hello,

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

Regards,
Kiristiyan
Comment 2 Jan Beich freebsd_committer freebsd_triage 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.,

https://searchfox.org/mozilla-release/rev/d6ba9f5ed372/widget/GfxInfoX11.cpp#792-798
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.

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

https://wiki.mozilla.org/Blocklisting/Blocked_Graphics_Drivers

"""
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 freebsd_triage 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
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-05-30 15:41:20 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f079b462f891b1e5c2cec31ac1190c73c17b0054

commit f079b462f891b1e5c2cec31ac1190c73c17b0054
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2021-05-30 14:20:26 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2021-05-30 15:38:23 +0000

    www/firefox: depend on libpci to qualify for WebRender by default

    On Intel Skylake this enables WebRender for Xorg and Wayland (wlroots).
    Xwayland isn't qualified yet but Firefox can be tricked by unsetting
    WAYLAND_DISPLAY or simply switching to native via MOZ_ENABLE_WAYLAND.

    PR:             255344
    Reported by:    Evgeniy Khramtsov (via gecko@ list)

 Mk/bsd.gecko.mk      | 3 +++
 www/firefox/Makefile | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
Comment 7 commit-hook freebsd_committer freebsd_triage 2021-05-30 15:41:21 UTC
A commit in branch 2021Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c6ce38ae4397e2e33b5d44bafbc558a3443ba33b

commit c6ce38ae4397e2e33b5d44bafbc558a3443ba33b
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2021-05-30 14:20:26 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2021-05-30 15:38:55 +0000

    www/firefox: depend on libpci to qualify for WebRender by default

    On Intel Skylake this enables WebRender for Xorg and Wayland (wlroots).
    Xwayland isn't qualified yet but Firefox can be tricked by unsetting
    WAYLAND_DISPLAY or simply switching to native via MOZ_ENABLE_WAYLAND.

    PR:             255344
    Reported by:    Evgeniy Khramtsov (via gecko@ list)

    (cherry picked from commit f079b462f891b1e5c2cec31ac1190c73c17b0054)

 Mk/bsd.gecko.mk      | 3 +++
 www/firefox/Makefile | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
Comment 8 Jan Beich freebsd_committer freebsd_triage 2021-05-30 15:50:19 UTC
skrech, does comment 6 help on your NVIDIA GPU? If so close the bug.
Comment 9 skrech 2021-06-05 16:20:36 UTC
Yes, with Firefox 89 and libpci, the following is in `about:support`:
Compositing	WebRender

Everything is perfect! :)