Bug 480960 - Adaptive Sync screen may freeze when multiple display-related settings are changed at the same time
Summary: Adaptive Sync screen may freeze when multiple display-related settings are ch...
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.93.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-02-06 16:25 UTC by Dmitrii Chermnykh
Modified: 2024-02-09 21:12 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
configurationg change script (2.33 KB, application/x-shellscript)
2024-02-06 16:25 UTC, Dmitrii Chermnykh
Details
screen configuration (104.13 KB, image/webp)
2024-02-06 16:26 UTC, Dmitrii Chermnykh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitrii Chermnykh 2024-02-06 16:25:55 UTC
Created attachment 165619 [details]
configurationg change script

SUMMARY

I have the following setup:
2 screens, fractional scaling 150%, the bottom one has adaptive sync (see the screen configuration screenshot)

I use zsh aliases to change between day/night mode

STEPS TO REPRODUCE
1. Configure an adaptive sync screen to have "adaptive sync: always"
2. Open a terminal and move it and the mouse cursor to the adaptive sync screen
3. Run the attached script which:
- Changes the wallpaper
- Changes the screen backlight level
- Changes the color temperature
- Changes the cursor theme & color scheme

OBSERVED RESULT
The Adaptive Sync screen freezes

EXPECTED RESULT
The screen should not freeze 

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.93.0
KDE Frameworks Version: 5.249.0
Qt Version: 6.7.0
Kernel Version: 6.7.3-zen1-2-zen (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800H with Radeon Graphics
Memory: 23.1 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3050 Ti Laptop GPU/PCIe/SSE2

ADDITIONAL INFORMATION
Setting 'adaptive sync' to 'Never' or running the actions sequentially works as a workaround 

ADDITIONAL ENVVARS
# workaround for nvidia+amd hybrid setup lags
export OGL_DEDICATED_HW_STATE_PER_CONTEXT=ENABLE_ROBUST
# workaround for cursor not respecting night color
export KWIN_FORCE_SW_CURSOR=1
Comment 1 Dmitrii Chermnykh 2024-02-06 16:26:38 UTC
Created attachment 165620 [details]
screen configuration
Comment 2 Dmitrii Chermnykh 2024-02-06 16:37:12 UTC
system logs (freeze time: 21:29 on kde clock):
Feb 06 21:28:54 laptop root[13302]: ACPI group/action undefined: button/up / UP
Feb 06 21:28:54 laptop systemd-udevd[602]: /usr/lib/udev/rules.d/70-opentabletdriver.rules:1 Invalid key/value pair, ignoring.
Feb 06 21:28:54 laptop systemd-udevd[602]: /usr/lib/udev/rules.d/70-opentabletdriver.rules:2 Invalid key/value pair, ignoring.
Feb 06 21:28:59 laptop systemd-udevd[602]: /usr/lib/udev/rules.d/70-opentabletdriver.rules:1 Invalid key/value pair, ignoring.
Feb 06 21:28:59 laptop systemd-udevd[602]: /usr/lib/udev/rules.d/70-opentabletdriver.rules:2 Invalid key/value pair, ignoring.
Feb 06 21:29:00 laptop kded6[2117]: xsettingsd: Reloading configuration
Feb 06 21:29:00 laptop kded6[2117]: xsettingsd: Loaded 14 settings from /home/chermnyx/.config/xsettingsd/xsettingsd.conf
Feb 06 21:29:00 laptop plasmashell[7302]: qt.svg: <input>:377:362: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:00 laptop plasmashell[7302]: qt.svg: <input>:378:110: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:00 laptop plasmashell[7302]: qt.svg: <input>:379:110: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:00 laptop plasmashell[7302]: qt.svg: <input>:379:353: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:00 laptop plasmashell[7302]: qt.svg: <input>:380:109: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:00 laptop plasmashell[7302]: qt.svg: <input>:381:108: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:00 laptop plasmashell[7302]: qt.svg: <input>:382:109: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:00 laptop plasmashell[7302]: qt.svg: <input>:383:109: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:00 laptop plasmashell[7302]: qt.svg: <input>:384:109: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:00 laptop plasmashell[7302]: qt.svg: <input>:384:339: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:00 laptop plasmashell[7302]: qt.svg: <input>:384:571: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:05 laptop plasmashell[7302]: qt.gui.imageio: libpng warning: iCCP: known incorrect sRGB profile
Feb 06 21:29:05 laptop systemd-udevd[602]: /usr/lib/udev/rules.d/70-opentabletdriver.rules:1 Invalid key/value pair, ignoring.
Feb 06 21:29:05 laptop systemd-udevd[602]: /usr/lib/udev/rules.d/70-opentabletdriver.rules:2 Invalid key/value pair, ignoring.
Feb 06 21:29:05 laptop kded6[2117]: xsettingsd: Reloading configuration
Feb 06 21:29:05 laptop kded6[2117]: xsettingsd: Loaded 14 settings from /home/chermnyx/.config/xsettingsd/xsettingsd.conf
Feb 06 21:29:05 laptop plasmashell[7302]: qt.gui.imageio: libpng warning: iCCP: known incorrect sRGB profile
Feb 06 21:29:05 laptop plasmashell[7302]: qt.svg: <input>:377:362: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:05 laptop plasmashell[7302]: qt.svg: <input>:378:110: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:05 laptop plasmashell[7302]: qt.svg: <input>:379:110: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:05 laptop plasmashell[7302]: qt.svg: <input>:379:353: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:05 laptop plasmashell[7302]: qt.svg: <input>:380:109: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:05 laptop plasmashell[7302]: qt.svg: <input>:381:108: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:05 laptop plasmashell[7302]: qt.svg: <input>:382:109: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:05 laptop plasmashell[7302]: qt.svg: <input>:383:109: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:05 laptop plasmashell[7302]: qt.svg: <input>:384:109: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:05 laptop plasmashell[7302]: qt.svg: <input>:384:339: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:05 laptop plasmashell[7302]: qt.svg: <input>:384:571: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:14 laptop root[13460]: ACPI group/action undefined: button/up / UP
Feb 06 21:29:14 laptop systemd-udevd[602]: /usr/lib/udev/rules.d/70-opentabletdriver.rules:1 Invalid key/value pair, ignoring.
Feb 06 21:29:14 laptop systemd-udevd[602]: /usr/lib/udev/rules.d/70-opentabletdriver.rules:2 Invalid key/value pair, ignoring.
Feb 06 21:29:19 laptop systemd-udevd[602]: /usr/lib/udev/rules.d/70-opentabletdriver.rules:1 Invalid key/value pair, ignoring.
Feb 06 21:29:19 laptop systemd-udevd[602]: /usr/lib/udev/rules.d/70-opentabletdriver.rules:2 Invalid key/value pair, ignoring.
Feb 06 21:29:20 laptop kded6[2117]: xsettingsd: Reloading configuration
Feb 06 21:29:20 laptop kded6[2117]: xsettingsd: Loaded 14 settings from /home/chermnyx/.config/xsettingsd/xsettingsd.conf
Feb 06 21:29:20 laptop plasmashell[7302]: qt.svg: <input>:377:362: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:20 laptop plasmashell[7302]: qt.svg: <input>:378:110: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:20 laptop plasmashell[7302]: qt.svg: <input>:379:110: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:20 laptop plasmashell[7302]: qt.svg: <input>:379:353: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:20 laptop plasmashell[7302]: qt.svg: <input>:380:109: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:20 laptop plasmashell[7302]: qt.svg: <input>:381:108: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:20 laptop plasmashell[7302]: qt.svg: <input>:382:109: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:20 laptop plasmashell[7302]: qt.svg: <input>:383:109: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:20 laptop plasmashell[7302]: qt.svg: <input>:384:109: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:20 laptop plasmashell[7302]: qt.svg: <input>:384:339: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:20 laptop plasmashell[7302]: qt.svg: <input>:384:571: Could not add child element to parent element because the types are incorrect.
Feb 06 21:29:25 laptop plasmashell[7302]: qt.gui.imageio: libpng warning: iCCP: known incorrect sRGB profile
Feb 06 21:29:25 laptop systemd-udevd[602]: /usr/lib/udev/rules.d/70-opentabletdriver.rules:1 Invalid key/value pair, ignoring.
Feb 06 21:29:25 laptop systemd-udevd[602]: /usr/lib/udev/rules.d/70-opentabletdriver.rules:2 Invalid key/value pair, ignoring.
Feb 06 21:29:25 laptop kded6[2117]: xsettingsd: Reloading configuration
Feb 06 21:29:25 laptop kded6[2117]: xsettingsd: Loaded 14 settings from /home/chermnyx/.config/xsettingsd/xsettingsd.conf
Feb 06 21:29:25 laptop plasmashell[7302]: qt.gui.imageio: libpng warning: iCCP: known incorrect sRGB profile
Feb 06 21:29:35 laptop systemd[1]: dbus-:1.4-org.kde.powerdevil.backlighthelper@3.service: Deactivated successfully.
Feb 06 21:29:52 laptop root[13914]: ACPI group/action undefined: button/down / DOWN
Feb 06 21:29:53 laptop root[13916]: ACPI group/action undefined: button/up / UP
Feb 06 21:30:07 laptop root[13918]: ACPI group/action undefined: button/down / DOWN
Feb 06 21:30:07 laptop root[13920]: ACPI group/action undefined: button/down / DOWN
Feb 06 21:30:07 laptop root[13922]: ACPI group/action undefined: button/down / DOWN
Feb 06 21:30:07 laptop root[13924]: ACPI group/action undefined: button/down / DOWN
Feb 06 21:30:07 laptop root[13927]: ACPI group/action undefined: button/down / DOWN
Feb 06 21:30:07 laptop root[13929]: ACPI group/action undefined: button/down / DOWN

There are nothing in the kernel logs around the freeze
Comment 3 Dmitrii Chermnykh 2024-02-06 16:37:39 UTC
It requires multiple runs of the script to reproduce the issue
Comment 4 Zamundaaa 2024-02-07 14:34:06 UTC
It should be fixed with https://invent.kde.org/plasma/kwin/-/merge_requests/5038. If you can still reproduce it on git master or in 6.0 anyways, just reopen this
Comment 5 Dmitrii Chermnykh 2024-02-09 18:32:09 UTC
Can still reproduce on git master (6.0.0_r26100.g7644499e20)
Now the log right after the freeze is the following :
Feb 09 23:26:28 laptop kwin_wayland[248173]: kwin_wayland_drm: Pageflip timed out! This is a kernel bug
Feb 09 23:26:28 laptop kwin_wayland[248173]: kwin_wayland_drm: atomic commit failed: Device or resource busy
Feb 09 23:26:28 laptop kwin_wayland[248173]: kwin_wayland_drm: atomic commit failed: Device or resource busy

And it keeps showing `kwin_wayland_drm: atomic commit failed: Device or resource busy` for each subsequent screen update in the system log
Comment 6 Dmitrii Chermnykh 2024-02-09 18:38:36 UTC
Edit: it's not git master, the latest log is with `Plasma/6.0` kwin branch
Comment 7 Zamundaaa 2024-02-09 18:45:51 UTC
hmm, the newly implemented page flip timeout fallback doesn't recover the session, but it at least tells you about the actual problem now: "This is a kernel bug". "atomic commit failed: Device or resource busy" also confirms that it's not just KWin misreporting anything, but the kernel is convinced that there's still a frame that needs to be presented first.

Please report this to https://gitlab.freedesktop.org/drm/amd/-/issues, and attach the same snippet from the log + the output of dmesg after triggering the problem there.
Comment 8 Dmitrii Chermnykh 2024-02-09 19:31:47 UTC
It's on NVIDIA, not AMD (the integrated is disabled in BIOS) 
Probably it's https://forums.developer.nvidia.com/t/545-29-06-18-1-flip-event-timeout-error-on-startup-shutdown-and-sometimes-suspend-wayland-unusable/274788
Comment 9 Zamundaaa 2024-02-09 21:00:33 UTC
Interesting that it allows disabling the integrated gpu entirely. Does it have a mux switch for the internal display?
Comment 10 Dmitrii Chermnykh 2024-02-09 21:12:59 UTC
Yes, it has a mux switch