Closed Bug 1902860 Opened 3 months ago Closed 2 days ago

Firefox amdgpu 780M flickering Fedora 40 KDE

Categories

(Core :: Graphics, defect)

Firefox 127
Desktop
Linux
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: noperv, Assigned: ahale)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Linux; Android 10; Nokia 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.6367.179 Mobile Safari/537.36 OPR/82.5.4342.79868

Steps to reproduce:

Have laptop charger connected.
Go to YouTube.
Hoover mouse cursor on address URL and let it sit there.

Actual results:

Flickering when mouse cursor is not moved or CPU iGPU load is close to 0.

https://youtu.be/RqsklZ5rmvw?si=oeX41QA4uBcDh9K1

https://share.firefox.dev/45rYcq3

Fedora 40 updated 14 Jun 2024. Brave no issues, only Firefox with hardware acceleration flickers. I have seen similar issues in CachyOS. Looks to be long time bug from the beginning of Fedora 40. Bug was also present in old snap Firefox version 117 in Kubuntu 23.10.
Firefox has the debug tool. When i press debugging tool to start analyzing, all the flickering stops. Looks like the flickering starts when CPU or iGPU has no load. But even when i scroll browser page a little, the flickering stops. It has to be something with variable refresh rate or power saving feature. 99.99% i did not had this issue in KDE 5.27

  • Lenovo Legion Slim 5 16APH8
  • 7840HS
  • AMD Radeon 780M iGPU (EnvyControl)
  • Hybrid 780M + RTX 4060 Mobile

Expected results:

No flickering.

The Bugbug bot thinks this bug should belong to the 'Fenix::General' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → General
Product: Firefox → Fenix
Component: General → Graphics
OS: Unspecified → Linux
Product: Fenix → Core
Hardware: Unspecified → Desktop

Can you attach the text from about:support (click either of the top buttons and paste into a new attachment on this bug)? It may help to see whether compositing is enabled in the browser, and other details such as which GPU is being used to render the window.

Looking at your video, I notice a couple things:

  • The black portion of the screen is usually the same exact shape and moves with the page scrolling - this makes me think that it may be a compositor bug where the blits to compose the desktop from several bitmaps are not completing in time for scanout. Firefox uses multiple bitmaps to compose the page for optimal scrolling performance, so if some bitmaps are not rendered they could appear as black and it would move with the scrolling.
  • Some frames the entire desktop goes black.

While the comments on your video point to it being a voltage issue, I think it may just as easily be a compositing issue.

Here are some prefs you can toggle in about:config that might tickle the bug:

  • gfx.webrender.debug.force-picture-invalidation - turning this on causes the browser to refresh every vsync, which may change the power state of the iGPU, but it will certainly use more battery.
  • gfx.webrender.compositor - turning this off (and restarting the browser) may resolve the issue, but uses more battery, especially when playing videos.

If you attach the about:support, please do so without making any changes to those prefs, it would be important to see the decision log on what features are being used, and gfx.webrender.compositor in particular changes that.

Severity: -- → S2
Attached file Firefox about:support

(In reply to Ashley Hale [:ahale] from comment #2)

Sorry for late reply.
gfx.webrender.debug.force-picture-invalidation does not fix it.
gfx.webrender.compositor to false, removes flickering.
I attached about:support.txt from before i made any changes.

I started getting flickering again even with gfx.webrender changes, now even in Brave browser.
It's probably multiple different bugs with Mesa Plasma 6 and wayland.
So far i have not seen it when Bios Mux switch is on Nvidia 4060.
Maybe YouTube specific issue.
I will test X11 and Firefox flatpack tomorrow.
In Brave the issue is somewhat similar, if i hoover cursor over some links in YouTube, the screen blinks once or more. Has to be Wayland related.
Disabling v- sync made flickering faster.

X11 Plasma 6.0.5 in CachyOS not a single flicker.
Wayland with Mesa 24.1.1 flickers.

I got it to flicker in X11 too. Maybe Mesa or Kernel bug then.
Also with plasma floating panel disabled.

I tested the kernel parameter amdgpu.sg_display=0
and this did not fix it. https://www.phoronix.com/news/AMD-Scatter-Gather-Re-Enabled

I should test Debian and Kubuntu with Plasma 5.
If this does not fix it, then it's my hardware or Bios issue.

Operating System: CachyOS Linux
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kernel Version: 6.9.6-2-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7840HS w/ Radeon 780M Graphics
Memory: 96 GiB of RAM
Graphics Processor: AMD Radeon 780M
Manufacturer: LENOVO
Product Name: 82Y9
System Version: Legion Slim 5 16APH8

This is happening in plasma 5 X11 too.

Firefox 125.0.2
Mesa 23.2.1.0
Operating System: Kubuntu 24.04
KDE Plasma Version: 5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13
Kernel Version: 6.8.0-35-generic (64-bit)
Graphics Platform: X11

When flickering happens, i have this error in journalctl:
plasmashell[1313]: The cached device pixel ratio value was stale on window update.

Assigning Ashley for any follow-ups.

Assignee: nobody → ahale

Ashley, do you think this is something worthy of elevation to AMD?

Flags: needinfo?(ahale)

I have not seen this flickering for long time. Maybe it has been fixed. I'm on KDE 6.1.4, Wayland and Kernel 6.10.6-2 CachyOS.

Since the last report is that it is no longer occurring after OS updates, I will close this - feel free to reopen if it returns.

Status: UNCONFIRMED → RESOLVED
Closed: 2 days ago
Flags: needinfo?(ahale)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: