cmeissl · GitHub

At the moment firefox is not working properly.
Firefox does not enable hardware acceleration when run on anvil/smithay.
The window has a lot of graphical glitches, especially on youtube and during scrolling.
At least on winit (and my pc) network requests and closing tabs or the window will
hang for a long time.
This issues are not present when running firefox on sway or weston.

I looked at the debug lop of firefox and the wayland debug logs when run on anvil, sway and weston.
Some of the following issues are the result from the found differences.

The one thing that seems to indicate there is an issue with buffer handling (or something timing related) is the following
log entry in the firefox log Buffer is attached and we can't switch, return null. This message is not present in the log
when not run on anvil. And another things i find suspicious is that two buffers of the same size are allocated.
firefox.anvil.moz_log.log

2021-07-12 17:32:10.298143 UTC - [Parent 192835: Renderer]: D/WidgetWayland WindowSurfaceWayland::LockWaylandBuffer [7f2de82b9000] Requesting buffer 1280 x 720
2021-07-12 17:32:10.298147 UTC - [Parent 192835: Renderer]: D/WidgetWayland WindowSurfaceWayland::GetWaylandBuffer [7f2de82b9000] Requested buffer [1280 x 720] can switch 0
2021-07-12 17:32:10.298149 UTC - [Parent 192835: Renderer]: D/WidgetWayland     Recent WindowBackBuffer [7f2ddfb9f540]
2021-07-12 17:32:10.298153 UTC - [Parent 192835: Renderer]: D/WidgetWayland         WindowBackBuffer [0][7f2de6e80fc0] width 1280 height 720 attached 0
2021-07-12 17:32:10.298156 UTC - [Parent 192835: Renderer]: D/WidgetWayland         WindowBackBuffer [1][7f2ddfb9f540] width 1280 height 720 attached 1
2021-07-12 17:32:10.298159 UTC - [Parent 192835: Renderer]: D/WidgetWayland         WindowBackBuffer [2] null
2021-07-12 17:32:10.298161 UTC - [Parent 192835: Renderer]: D/WidgetWayland     Buffer is attached and we can't switch, return null

What did make a difference, but did not entierly solve the issue, is changing the timing the the winit loop by moving the rendering into a calloop idle task.

Debugging Notes

Activating firefox debug log

export MOZ_LOG=WidgetWayland:5,timestamp
export MOZ_LOG_FILE=/tmp/firefox

Tracking wayland buffers

export MOZ_WAYLAND_DUMP_DIR=/tmp
export MOZ_WAYLAND_DUMP_WL_BUFFERS=1

Read the original on github.com ↗