[Gnome/Wayland][VSync] Painting stops every now and then on Linux
Categories
(Core :: Widget: Gtk, defect, P2)
Tracking
()
People
(Reporter: smaug, Assigned: stransky)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files)
|
46.42 KB,
text/plain
|
Details | |
|
520.48 KB,
text/plain
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
diannaS
:
approval-mozilla-beta+
|
Details | Review |
Every now and then painting of a window stops on Fedora 40. Neither the parent process side nor content process side gets painted, but it is per window, not per whole Firefox. This is a relatively recent regression. Not sure if this could be an issue on OS side or has there been any changes to painting on Gecko side.
Opening a new tab or focusing another window and then back to original window helps.
For user the not-painting feels like a jank, scrolling doesn't work etc. which is why I thought initially that there is some long running CC or GC, but when I managed to get this to a performance profile (which I unfortunately didn't save), there was basically nothing running.
And this has happened on multiple different FF profiles, but I've used only this AMD 7840HS based laptop.
| Assignee | ||
Comment 1•7 months ago
|
||
Please attach your about:support page.
Thanks.
| Reporter | ||
Comment 2•7 months ago
|
||
| Assignee | ||
Comment 3•7 months ago
|
||
Can you try to set widget.wayland.vsync.enabled to true, restart browser and check if you see it?
Thanks.
| Reporter | ||
Comment 4•7 months ago
|
||
Testing...
This happens for me in KDE too (Plasma 6.3.0) in 137.0b1.
widget.wayland.vsync.enabled is already set to true (seems to be default).
| Assignee | ||
Comment 6•7 months ago
|
||
Also can you try to switch to software WebRender?
Just tried setting
gfx.webrender.compositor = false
gfx.webrender.compositor.force-enabled = false
It does help - GPU usage stopped when page is idle.
| Reporter | ||
Comment 8•7 months ago
|
||
So far with widget.wayland.vsync.enabled==false I haven't seen the issue.
| Assignee | ||
Comment 9•7 months ago
|
||
(In reply to Olli Pettay [:smaug][bugs@pettay.fi] from comment #8)
So far with widget.wayland.vsync.enabled==false I haven't seen the issue.
Great, thanks for testing. Looks like there's a bug in processing wl_surface frame callbacks then. We've landed various fixes recently there, can you test Firefox 136 and/or latest nightly if you still see it?
If you see it with nightly I'll ask for vsync logs then.
Thanks.
| Assignee | ||
Comment 10•7 months ago
|
||
(In reply to Shmerl from comment #7)
Just tried setting
gfx.webrender.compositor = false
gfx.webrender.compositor.force-enabled = falseIt does help - GPU usage stopped when page is idle.
That's completely different issue, please file as blocker of Bug 1642854 (Linux/HDR/layered rendering).
Thanks.
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Updated•7 months ago
|
Comment 11•7 months ago
|
||
(In reply to Martin Stránský [:stransky] (ni? me) from comment #10)
That's completely different issue, please file as blocker of Bug 1642854 (Linux/HDR/layered rendering).
Thanks.
Yeah, sorry I got confused since I had two related issues opened. Should I file that blocker about higher than normal GPU usage when hardware webrdender path is used or about content corruptions with it (jankiness as described above)?
| Assignee | ||
Comment 12•7 months ago
|
||
(In reply to Shmerl from comment #11)
(In reply to Martin Stránský [:stransky] (ni? me) from comment #10)
That's completely different issue, please file as blocker of Bug 1642854 (Linux/HDR/layered rendering).
Thanks.Yeah, sorry I got confused since I had two related issues opened. Should I file that blocker about higher than normal GPU usage when hardware webrdender path is used or about content corruptions with it (jankiness as described above)?
Please stop reporting any bugs with gfx.webrender.compositor / gfx.webrender.compositor.force-enabled. This is not hardware Webrender, this is experimental layered rendering. Hardware WebRender has been enabled by default for all users for 4 years.
| Reporter | ||
Comment 13•7 months ago
•
|
||
(In reply to Martin Stránský [:stransky] (ni? me) from comment #9)
(In reply to Olli Pettay [:smaug][bugs@pettay.fi] from comment #8)
So far with widget.wayland.vsync.enabled==false I haven't seen the issue.
Great, thanks for testing. Looks like there's a bug in processing wl_surface frame callbacks then. We've landed various fixes recently there, can you test Firefox 136 and/or latest nightly if you still see it?
I use basically only Nightly. The issue happens in 138 and I saw it also in 137.
| Assignee | ||
Comment 14•7 months ago
|
||
Please set widget.wayland.vsync.enabled to true and run on terminal as:
MOZ_LOG="WidgetVSync:5" firefox
if you see the freeze, please check if Firefox is printing Vsync events to terminal. Also please copy the lines around the freeze.
Thanks.
| Reporter | ||
Comment 15•7 months ago
|
||
I think the part of the log captured the time when there was a stop in painting. See that WaylandVsyncSource::HiddenWindowCallback().
Looks like bug 1934497 changed some of the relevant code relatively recently.
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource frame callback, routed 0 time 263972988
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::VisibleWindowCallback() time 263972988
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::CalculateVsyncRateLocked start fps 89.490242
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: new fps 89.630135 correction 0.017440
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource frame callback, routed 0 time 263972999
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::VisibleWindowCallback() time 263972999
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::CalculateVsyncRateLocked start fps 89.630135
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: new fps 89.756409 correction 0.015696
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource frame callback, routed 0 time 263973011
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::VisibleWindowCallback() time 263973011
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::CalculateVsyncRateLocked start fps 89.756409
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: new fps 89.069885 correction 0.085873
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource frame callback, routed 0 time 263973021
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::VisibleWindowCallback() time 263973021
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::CalculateVsyncRateLocked start fps 89.069885
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: new fps 90.054176 correction 0.122714
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource frame callback, routed 0 time 263973032
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::VisibleWindowCallback() time 263973032
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::CalculateVsyncRateLocked start fps 90.054176
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: new fps 90.138947 correction 0.010443
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::DisableVsync fps 90.138947
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::HiddenWindowCallback(): quit, mVsyncEnabled 0 mWaylandSurface 7fddb30a2a00
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::EnableVsync fps 90.138947
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3eb2900]: WaylandVsyncSource::EnableVsync fps 33.237671
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3099900]: WaylandVsyncSource frame callback, routed 0 time 263984735
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3099900]: WaylandVsyncSource::VisibleWindowCallback() time 263984735
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3099900]: WaylandVsyncSource::CalculateVsyncRateLocked start fps 9.437446
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3099900]: new fps 4.718723 correction 105.960873
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3099900]: WaylandVsyncSource::SetHiddenWindowVSync()
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3fd5a00]: WaylandVsyncSource::EnableVsync fps 31.336401
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3eb2900]: WaylandVsyncSource frame callback, routed 0 time 263984753
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3eb2900]: WaylandVsyncSource::VisibleWindowCallback() time 263984753
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3eb2900]: WaylandVsyncSource::CalculateVsyncRateLocked start fps 33.237671
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3eb2900]: new fps 16.618835 correction 30.086345
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3eb2900]: WaylandVsyncSource::SetHiddenWindowVSync()
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource frame callback, routed 0 time 263984753
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::VisibleWindowCallback() time 263984753
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::CalculateVsyncRateLocked start fps 90.138947
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: new fps 45.069473 correction 11.093984
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::SetHiddenWindowVSync()
| Reporter | ||
Comment 16•7 months ago
•
|
||
Looks like I get similar looking log whenever first scrolling using touchpad/two fingers and then stop scrolling. But when the painting stopped for longer period, the log was stuck at HiddenWindowCallback.
(I'm trying to capture another log to ensure it looks similar to the one in the previous comment.)
| Reporter | ||
Comment 17•7 months ago
•
|
||
Got it again, or some variant of it. I wonder if it it is possible that it is somehow related hit testing / event targeting either somewhere in wayland/gnome level or in Gecko?
It seems to happen when I use Super+arrow keys to move a window around but not changing the cursor position and then using two finger scrolling.
But the issue I had when I filed this bug was/is different, since there I was just scrolling a page and it stopped working. No need to move window or anything.
| Assignee | ||
Comment 18•7 months ago
|
||
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::DisableVsync fps 90.138947
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::HiddenWindowCallback(): quit, mVsyncEnabled 0 mWaylandSurface 7fddb30a2a00
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddb7c31d00]: WaylandVsyncSource::EnableVsync fps 90.138947
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3eb2900]: WaylandVsyncSource::EnableVsync fps 33.237671
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3099900]: WaylandVsyncSource frame callback, routed 0 time 263984735
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3099900]: WaylandVsyncSource::VisibleWindowCallback() time 263984735
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3099900]: WaylandVsyncSource::CalculateVsyncRateLocked start fps 9.437446
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3099900]: new fps 4.718723 correction 105.960873
[Parent 2693266: Main Thread]: D/WidgetVSync [7fddc3099900]: WaylandVsyncSource::SetHiddenWindowVSync()
Looks like we're getting 'HiddenWindowCallback' although the window is still visible. I'll look at the vsync code how's that possible.
Thanks for the logs.
| Assignee | ||
Comment 19•7 months ago
•
|
||
Hm, I was wrong. If we get hidden window callback, it prints something like "WaylandVsyncSource::HiddenWindowCallback() we're hidden".
| Assignee | ||
Comment 20•7 months ago
|
||
Please run on terminal with MOZ_LOG="Widget:5" and try to filter out 'nsWindow::OnExposeEvent'.
If Firefox is frozen, is it painted again after 'nsWindow::OnExposeEvent' ?
It's also possible that we don't paint main window for some reason:
https://searchfox.org/mozilla-central/rev/391e86d9a0d82b655fc0ace236da04949970fb01/widget/gtk/nsWindow.cpp#3900
that may be also present in the log (reason why we skip painting).
Thanks.
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Comment 22•7 months ago
|
||
Or run it on terminal as:
MOZ_LOG="Widget:5 WidgetVsync:5" firefox > log.txt 2>&1
when you see the freeze, please switch to terminal, quit firefox by ctrl+c and attach the log.txt file here.
Thanks.
| Reporter | ||
Comment 23•7 months ago
•
|
||
I believe the last key_press is from the ctrl+tab to focus terminal. Before that I was trying to scroll the page using two finger scrolling. Nothing was re-painted. Immediately when focus starts to move to another window, painting happens again.
| Assignee | ||
Comment 24•6 months ago
|
||
(In reply to Martin Stránský [:stransky] (ni? me) from comment #22)
Or run it on terminal as:
MOZ_LOG="Widget:5 WidgetVsync:5" firefox > log.txt 2>&1when you see the freeze, please switch to terminal, quit firefox by ctrl+c and attach the log.txt file here.
Thanks.
Sorry, the log comment is incorrect. It's WidgetVSync, so:
MOZ_LOG="Widget:5 WidgetVSync:5" firefox > log.txt 2>&1
| Assignee | ||
Comment 25•6 months ago
|
||
I think I've got it from downstream: https://bugzilla.redhat.com/show_bug.cgi?id=2357706
We should reset hidden vsycn timer when vsync is enabled/disabled:
[Parent 1231517: Main Thread]: D/WidgetVSync [7fbc8f8fd600]: WaylandVsyncSource::DisableVsync fps 3.615839
[Parent 1231517: Main Thread]: D/WidgetVSync [7fbc8f8fd600]: WaylandVsyncSource::EnableVsync fps 3.615839
[Parent 1231517: Main Thread]: D/WidgetVSync [7fbc8f8fd600]: WaylandVsyncSource::HiddenWindowCallback() we're hidden, time since last VSync 1002 ms
That's obviously wrong, we can't mark window hidden right after vsync enable.
| Assignee | ||
Comment 26•6 months ago
|
||
Updated•6 months ago
|
| Assignee | ||
Updated•6 months ago
|
Comment 27•6 months ago
|
||
Comment 28•6 months ago
|
||
| bugherder | ||
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Comment 29•6 months ago
|
||
Can you please test latest nightly if it's fixed for you?
Thanks.
Comment 30•6 months ago
|
||
The patch landed in nightly and beta is affected.
:stransky, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox138towontfix.
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 31•6 months ago
|
||
Comment on attachment 9478149 [details]
Bug 1951249 [Wayland] Reset VSync state if VSync is enabled/disabled r?emilio
Beta/Release Uplift Approval Request
- User impact if declined/Reason for urgency: Firefox freeze, reported by various users/bug reports. Finally catch and fixed.
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Medium
- Why is the change risky/not risky? (and alternatives if risky): Updated VSync code which is always a bit tricky, but the patch doesn't look very risky/complicated to me. Just clear up and reset VSync state when it's enabled and disabled.
- String changes made/needed:
- Is Android affected?: Yes
Comment 32•6 months ago
|
||
Comment on attachment 9478149 [details]
Bug 1951249 [Wayland] Reset VSync state if VSync is enabled/disabled r?emilio
Approved for 138.0b7
Comment 33•6 months ago
|
||
| uplift | ||
Updated•6 months ago
|
Description
•