Closed Bug 1629140 Opened 5 years ago Closed 4 years ago

Wayland: Enable frame callback based VsyncSource by default

Categories

(Core :: Graphics, enhancement, P3)

Unspecified
Linux
enhancement

Tracking

()

RESOLVED FIXED
85 Branch
Tracking Status
firefox85 --- wontfix
firefox86 --- fixed

People

(Reporter: rmader, Assigned: rmader)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file, 1 obsolete file)

Using the frame callback based VsyncSource (widget.wayland_vsync.enabled: true), apart from bringing a better experience on non-60hz monitors, offers significant power savings in in scenarios where FF is not visible. On Gnome Shell this includes being hidden by other windows (new in 3.36) or being on a not focused workspace.

Given that the feature has baked for a number of cycles already and previously found bugs should be fixed / shipped by now, lets enable it by default to get more feedback in nightly/beta. If it causes problems we can still disable it in the release channel.

STR for the previously mentioned powersavings on GS 3.36:

  • enable widget.wayland_vsync.enabled
  • open a taxing website like https://www.vsynctester.com/
  • open gnome-terminal and run htop
  • maximize and unmaximize the terminal in front of firefox and compare the cpu usage
  • compare to widget.wayland_vsync.enabled: false
Blocks: wayland
Assignee: nobody → robert.mader
Depends on: 1627863

I've had this enabled for a while, the only issue I've seen is this:

https://bugzilla.mozilla.org/show_bug.cgi?id=1619246

I can confirm that this is still an issue in nightly 77

Depends on: 1619246

Dell XPS 9350, Intel -- Mesa Intel(R) HD Graphics 520 (SKL GT2)
native Firefox 75 (gentoo) - no change after setting vsync
flatpak 73_beta3 - no change after setting vsync.

Running webrender on both.

:okias Please open a separate issue. In that issue, specify what compositor you use, verification that you are indeed running in Wayland mode, as well as reproduction and expected behavior of the problem you see.

That issue can then be made a blocker if deemed necessary, but we can't track issues in comments.

Blocks: vsync

Resetting severity to default of --.

offers significant power savings in in scenarios where FF is not visible. On Gnome Shell this includes being hidden by other windows (new in 3.36) or being on a not focused workspace

The same should be true for wlroots/sway. Tested with Firefox developer edition 76.0b5 and wlroots/sway git master for VESA adaptive sync support:

  1. enable adaptive sync and idle -> screen refreshes at minimum rate (40 Hz)
  2. open Firefox, open a page with animation/video -> screen refreshes at video rate (e.g. 60 Hz)
  3. move to another workspace, FF is invisible now but the screen still refreshes at the higher refresh rate

This issue was also described in https://github.com/swaywm/sway/issues/5076#issuecomment-599133439

With widget.wayland_vsync.enabled, the screen refreshes with the minimal possible refresh rate again once FF is invisble (on another workspace or covered by a fullscreen window), as it would be expected.

Pushed by cbrindusan@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d412b7923e10 Enable frame callback based VsyncSource by default. r=stransky
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
Regressions: 1632519
Status: RESOLVED → UNCONFIRMED
Depends on: 1632519, 1632399
Resolution: FIXED → ---

Reopening as it got disabled again in bug 1632519. Lets properly fix the bugs and try again.

Depends on: 1634903
Status: UNCONFIRMED → NEW
Ever confirmed: true
Target Milestone: mozilla77 → ---
Depends on: 1638084
Depends on: 1641174
Depends on: 1616894
Depends on: 1601966
Depends on: 1601962
Blocks: 1569673
Depends on: 1542808
Blocks: 1560461
No longer blocks: 1569673
No longer blocks: 1560461
See Also: → 1645528
Depends on: 1656943
Depends on: 1670444
Depends on: 1645528
See Also: 1645528
Depends on: 1670924

Unfortunately the test infrastructure still uses Ubuntu 18.04 (or even 16.04) which in the Wayland world is quite old and has many known bugs. I opened https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1570 / https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1905330 which will be needed for the vsyncsource. Alternatively we could force-off the pref for testing - but that would be somewhat hacky.

Martin, as soon as bug 1645528 lands I'd like to reland this. Unfortunately that may get into the way of you testing infrastructure work (see comment above). Would it be easy for you to disable the pref in the tests?

Flags: needinfo?(stransky)

(In reply to Robert Mader [:rmader] from comment #12)

Martin, as soon as bug 1645528 lands I'd like to reland this. Unfortunately that may get into the way of you testing infrastructure work (see comment above). Would it be easy for you to disable the pref in the tests?

The testsuite it broken anyway so don't hold your horses just because of it.

Flags: needinfo?(stransky)

The issues from last time seem to be fixed, lets try again.

Pushed by btara@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9658708ceaea Enable frame callback based VsyncSource by default. r=stransky
Status: NEW → RESOLVED
Closed: 5 years ago4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch

For the record: with regards to bug 1655282 comment 10 I expect a slightly higher crash rate with Webrender enabled now, although nothing completely new - however, if the problem pointed out there is indeed the culprit, we should be able to come up with a fix in time before 85 enters beta.

See Also: → 1655282

I think this is causing some pretty annoying problems under KDE/KWin 5.20.3, on a Mesa 20.2.3 / Intel Kabylake setup (openSUSE Tumbleweed). For the last couple of nightly builds, basically, the window isn't updating most of the time. Sometimes there'll be bursts of animation, and sometimes the screen will stay stuck on one frame for a while. It works perfectly if I force it to run under XWayland with GDK_BACKEND=x11, so this is definitely a Wayland issue. It seems consistent with the idea that new frames are not being sent to the wayland compositor (or are being discarded or unused there), which could be because a vsync callback or something isn't being triggered.

I think I've successfully traced it back to this vsync setting: disabling it fixes the issue, and a bisect with mozregression-gui (which I think I was using correctly) showed the commit above (9658708ceaea) which enabled it by default. (This was with webrender force-enabled.)

(Please let me know if you want more info, or if this sounds like it is worth filing a separate bug either here or with KDE for. In the meantime, it may be worth reconsidering making this a default.)

(In reply to David Gow from comment #18)

...

Yes, this is a known issue in KWin, see bug 1616894 and https://bugs.kde.org/show_bug.cgi?id=428499

As the Wayland backend is not yet activated by default, IMO we should not implement any detection for that in FF and hope KWin devs fix the issue.

See Also: → 1695227
See Also: → 1693317
Attachment #9190169 - Attachment is obsolete: true

(In reply to Robert Mader [:rmader] from comment #19)

(In reply to David Gow from comment #18)

...

Yes, this is a known issue in KWin

I encountered it using Gnome Shell too, see bug 1700005.

Regressions: 1700005
Regressions: 1786247
No longer regressions: 1786247
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: