#1003806 firefox-esr: Screen tearing (diagonal line) when scrolling web pages

Package:
firefox-esr
Source:
firefox-esr
Description:
Mozilla Firefox web browser - Extended Support Release (ESR)
Submitter:
Matt Roberds
Date:
2022-01-16 01:21:02 UTC
Severity:
normal
#1003806#5
Date:
2022-01-16 00:44:34 UTC
From:
To:
Dear Maintainer,

I recently upgraded from Firefox 78 ESR to 91.5.0 ESR.  After doing
that, I observed screen tearing in the browser window when scrolling a
web page.  I did not expect the tearing; I expected the web page to
scroll smoothly, as it did in 78 ESR.

The tear appeared for me as a diagonal line; it started at the upper
right corner of the web page display area and ran "southwest" (down and
to the left) to about the center of the web page display area.  The line
did not extend to the menus or toolbars in the browser; it was only
visible in the web page display area.

The tear only appeared when I was scrolling a web page that was taller
than the browser window.  It appeared when I was scrolling both up and
down.  It appeared both with using the mouse wheel to scroll, and using
the scroll bar at the side of the window to scroll.  The tear wasn't
"permanent" - when I stopped scrolling, everything on the web page
displayed correctly.

A good test case was any long Wikipedia page.  Scrolling such a page
made the tear visible on the lines of text or images on the page.

I Googled and found a solution (changing things in about:config), which
I will post as a follow-up.

Thanks!

Matt Roberds

#1003806#10
Date:
2022-01-16 01:15:58 UTC
From:
To:
I Googled and found this Reddit post, by Reddit user Shamaoke, from
June 2021:

https://old.reddit.com/r/firefox/comments/nq5dy2/ff_89_tearing/

They were using Firefox 89 on Arch, but since they also reported screen
tearing, I decided to try their fixes.  The first fix they reported
worked:

I changed those two settings in about:config in Firefox and the problem
stopped happening - I can scroll web pages without observing the tearing
anymore.

Since the need for changing those settings might depend on what window
manager / X server / video driver / video card you have, here are the
versions I have installed of possibly-relevant packages, from dpkg:

ii  xfce4                      4.12.5
ii  xfce4-panel                4.12.2-1
ii  xfce4-session              4.12.1-6
ii  xfce4-settings             4.12.4-1
ii  xfce4-xkb-plugin           1:0.8.1-2
ii  xfconf                     4.12.1-1
ii  xfwm4                      4.12.5-1
ii  xserver-common             2:1.20.4-1+deb10u4
ii  xserver-xorg               1:7.7+19
ii  xserver-xorg-core          2:1.20.4-1+deb10u4
ii  xserver-xorg-video-all     1:7.7+19
ii  xserver-xorg-video-radeon  1:19.0.1-1

Here is what "lspci -v" says about my video card:

01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cedar [Radeon HD 5000/6000/7350/8350 Series] (prog-if 00 [VGA controller])
   Subsystem: ASUSTeK Computer Inc. Cedar [Radeon HD 5000/6000/7350/8350 Series]
   Flags: bus master, fast devsel, latency 0, IRQ 33
   Memory at e0000000 (64-bit, prefetchable) [size=256M]
   Memory at f7de0000 (64-bit, non-prefetchable) [size=128K]
   I/O ports at dc00 [size=256]
   Expansion ROM at 000c0000 [disabled] [size=128K]
   Capabilities: [50] Power Management version 3
   Capabilities: [58] Express Legacy Endpoint, MSI 00
   Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+
   Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?>
   Capabilities: [150] Advanced Error Reporting
   Kernel driver in use: radeon
   Kernel modules: radeon

What I think Debian should do:

If it's possible to detect the need for these settings at install time
(based on what window manager is installed, or what X says it supports),
the Firefox package should adjust those settings as needed after it
installs Firefox.

A difficulty there is that I'm pretty sure the about:config settings are
unique to each Firefox profile.  Since there may be many Firefox profiles
on the system, the installer would have to look for and change them all.

If it's not possible or not a good idea to set this up at install time,
perhaps having WebRender disabled should be the default in the Firefox
package.  However, this may cause lower graphics performance in Firefox
for users that have software and hardware that supports WebRender
correctly.

Other notes:

Shamaoke also reported a few other things in their Reddit post which
probably don't directly affect this bug, but might be useful in the
future.  In particular, one of the settings changes names at Firefox 92:

Thanks!

Matt Roberds