[REGRESSION 6.2][Bisected] Damage clips with PSR-SU ocassionally does not update
Brief summary of the problem:
Since Linux 6.2, I experience partial screen freezes when editing text in neovim running in foot
under the sway
compositor.
An easy way to reproduce this behaviour is to open nvim, enter insert mode and notice that the cursor becomes a line instead of a block. Press escape to exit insert mode and notice that the cursor does not become a block as expected, and stays as a line. If it does work as expected, enter and exit insert mode a couple more times and it should reproduce pretty reliably.
Adding amdgpu.dcdebugmask=0x10
to disable PSR works around the issue
I've bisected the issue to this commit:
commit 30ebe41582d1ea5a7de990319f9e593dad4886f7
Author: Hamza Mahfooz <hamza.mahfooz@amd.com>
Date: Tue Nov 15 11:58:45 2022 -0500
drm/amd/display: add FB_DAMAGE_CLIPS support
Currently, userspace doesn't have a way to communicate selective updates
to displays. So, enable support for FB_DAMAGE_CLIPS for DCN ASICs newer
than DCN301, convert DRM damage clips to dc dirty rectangles and fill
them into dirty_rects in fill_dc_dirty_rects().
Reviewed-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
I don't have an Intel system with PSR-SU support so I can't judge if it's an issue with sway
, amdgpu
, or the panel itself. But from setting drm.debug=0x12
, the debug messages for "PSR SU dirty rect" seem to make sense and correspond to what should actually be updated on the screen. I have also noticed that my bar (which has a timestamp which updates once per second) does not seem to encounter this issue, and the PSR SU logs show that those atomic commits have only one FB_DAMAGE_CLIP attached (with neovim, there are typically two damage clips).
I've found similar issues reported here: https://github.com/swaywm/sway/issues/7492.
Hardware description:
- Model: Lenovo ThinkBook 13s G4
- CPU: Ryzen 7 6800U
- GPU: 63:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt [Radeon 680M] [1002:1681] (rev c1)
- System Memory: 16GB
- Display(s): Built-in panel - 2560x1600 (sway -t get_outputs reports 'California Institute of Technology 0x1310 Unknown', but that doesn't seem right)
- Type of Display Connection: eDP
System information:
- Distro name and Version: Arch Linux
- Kernel version: Linux 6.2.2-arch1-1 #1 (closed) SMP PREEMPT_DYNAMIC Fri, 03 Mar 2023 15:58:31 +0000 x86_64 GNU/Linux