Pretty much the same problem as in this forum post: Graphical Glitches
Sorry for the delay, I missed the notification (too many e-mails!) and only came across this reply now. In order:
amdgpu.dcdebugmask=0x410
Sets an AMD Display Core debug mask. You can find documentation about the Display Core architecture here. This has been my starting point and how I tested things to exclude other more common problems.
Next, I read the documentation on amdgpu module parameters. In this page you can find:
dcdebugmask (uint)
Override display features enabled. See
enum DC_DEBUG_MASK
in drivers/gpu/drm/amd/include/amd_shared.h.
So, I went to the stated file in the source code. You can see the enum at line 259. Looking at this code, it looks like the amdgpu
module takes a kernel parameter that can enable one ore more options from here.
Through a combination of trial-end-error and various GitLab threads, I noticed that my artifacting issues started exactly since updating my system with a kernel version new enough to have the “Panel Replay” option, and I saw that other GitLab threads already linked further up this thread suggest disabling PSR (Panel Self-Refresh) as a solution. My attempt was to disable both PSR and Replay. It makes sense: PSR and PR are technologies to save power on the integrated eDP-1 panel, and I never got flickering on my external monitors ran through USB, so this seemed like the right track.
Do do this, we want DC_DISABLE_PSR = 0x10
and DC_DISABLE_REPLAY = 0x400
. So, we get:
>>> result = 0x10 + 0x400
>>> print(hex(result))
0x410
We can further prove that both PSR and Panel Replay are off:
% sudo -s
Place your right index finger on the fingerprint reader
[root@theseus]/home/luca# grep '' /sys/kernel/debug/dri/0000*/eDP-1/*_capability
/sys/kernel/debug/dri/0000:c1:00.0/eDP-1/hdcp_sink_capability:eDP-1:93 HDCP version: None
/sys/kernel/debug/dri/0000:c1:00.0/eDP-1/psr_capability:Sink support: yes [0x01]
/sys/kernel/debug/dri/0000:c1:00.0/eDP-1/psr_capability:Driver support: no [0xffffffff]
/sys/kernel/debug/dri/0000:c1:00.0/eDP-1/replay_capability:Sink support: yes
/sys/kernel/debug/dri/0000:c1:00.0/eDP-1/replay_capability:Driver support: no
/sys/kernel/debug/dri/0000:c1:00.0/eDP-1/replay_capability:Config support: no
amdgpu.abmlevel=0
This disables ABM, as you say. Several display flickers on the Framework 16 are caused by the ABM changing the contrast on the display. This operation can sometimes require the panel to reboot and flicker, so that removes a cause. To double-check this claim, I tried to boot Linux with no added kernel parameters and I am able to reproduce a flicker when I am on battery and I switch between the Performance and Balanced power-profile.
There is an interaction between PPD/TuneD and the amdgpu kernel module for setting these brightness levels, so a potentially less invasive option to explore would be to disable or tune this feature from the user-space rather than passing the kernel parameter. I admit that I did not look into this due to laziness.
I do agree that this needs a proper fix. This workaround is not free, it costs a lot of battery life. It looks like they are aware of all these bugs caused by Panel Replay, but still no solution.
Fun fact: Panel Replay also broke the adaptive brightness sensor.
EDIT 2: Oh, you are quoting my comment from the Reddit thread. Ideally, I should have copy pasted that to here in the first place. I apologize again for the confusion, I understand it’s not good practice to past kernel parameters without explaining what they do and why they work.
Great write-up!
Sorry I wanted more details - I figured the cost to battery would be terrible - but wanted to make sure I knew what these flags did before I threw them in the kernel params.
I haven’t done it yet, only because its not “bad” on my external monitor.
I was using the laptop disconnected the other day and saw just how bad the flickering is… hopefully they figure out the bug soon - but if not - Ill likely use your steps.
Again, awesome find!
Thanks! I can’t take all the credit though. This was a group effort in a group chat