Bug 485403 - Enabling HDR freezes system
Summary: Enabling HDR freezes system
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 6.0.3
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-11 23:26 UTC by jroddev
Modified: 2024-07-13 03:56 UTC (History)
2 users (show)

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


Attachments
kwin-drm-debug.log (399 bytes, text/plain)
2024-04-21 08:39 UTC, jroddev
Details
dmesg-drm-debug.log (248.00 KB, text/plain)
2024-04-21 08:39 UTC, jroddev
Details
kwin-drm-debug 90 seconds wait (399 bytes, text/plain)
2024-04-29 08:36 UTC, jroddev
Details
dmesg-drm-debug 90 second wait (248.00 KB, text/x-log)
2024-04-29 08:37 UTC, jroddev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jroddev 2024-04-11 23:26:59 UTC
SUMMARY

 I clicked ‘enable HDR’ on one of my monitors and something broke. The whole system froze up and the HDR monitor went black. If I reboot it freezes right after I login.

If I unplug that monitor or start in X11 instead of Wayland then everything is fine. Plugging the HDR monitor in while I’m logged into a Wayland session also freezes everything.

How can I disable the HDR setting? The monitor doesn’t show in System Settings whilst its unplugged so I’m hoping theirs some way to fix it on the CLI. The only place I’ve found HDR referenced is .config/kwinoutputconfig.json. I set HDR to false but after reboot it’s set to true again. I also tried deleting .config/kwinrc and .local/share/kscreen but no luck.


STEPS TO REPRODUCE
1. Enable HDR on Monitor in System Settings > Display


OBSERVED RESULT
- HDR monitor goes black
- Other monitor now unresponsive.
- System works if monitor is not plugged in on start up
- Cannot disable HDR setting in UI without the monitor plugged in. If I plug in the monitor then the system freezes.
- Monitor also does not appear in kscreen-doctor when unplugged.

EXPECTED RESULT
- System does not freeze
- Saved monitor settings can be modified or cleared even when disconnected.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro
KDE Plasma Version: 6.0.3
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.3

ADDITIONAL INFORMATION
Lemmy Community Discussion https://lemmy.kde.social/post/1104524
Similar to https://bugs.kde.org/show_bug.cgi?id=483600 but if I use only the HDR monitor it still has the issue.

Fixed by
- Ctrl + Alt + F3 to go into terminal
- Set `HighDynamicRange` and `WideColorGamut` to false in ~/.config/kwinoutputconfig.json
- Execute `plasmashell --replace`
- Reboot, Login, Reattach HDR Monitor


- AMD based Desktop
- Nvidia GPU
- Dual Monitor Setup (BenQ and Gigabyte)
- HDR setting enabled on Gigabyte.
- Installation is approximately 4 years old.
Comment 1 jroddev 2024-04-12 10:25:57 UTC
hardware probe: https://linux-hardware.org/?probe=66b49c3998
Comment 2 Zamundaaa 2024-04-16 22:59:05 UTC
We're gonna need some debug information, ideally from both KWin and the driver side. The best way to get it is probably to enable HDR, disconnect the monitor, log out, switch to a tty, connect the monitor again and then run the script from https://invent.kde.org/plasma/kwin/-/wikis/Debugging-DRM-issues
Afterwards, just attach kwin-drm-debug.log and dmesg-drm-debug.log here
Comment 3 jroddev 2024-04-21 08:39:11 UTC
Created attachment 168730 [details]
kwin-drm-debug.log
Comment 4 jroddev 2024-04-21 08:39:40 UTC
Created attachment 168731 [details]
dmesg-drm-debug.log
Comment 5 Zamundaaa 2024-04-25 16:01:00 UTC
hmm, I see nothing obviously wrong in there. There's a few atomic tests that fail with "needs modeset", but that's a normal part of KWin's startup sequence, and at the very end of the log I see KWin successfully doing a modeset to turn the screens on.

Maybe the problem only happens later... Could you bump the "sleep 3" in the script to "sleep 20" or something like that, and attach the logs for that again?
Comment 6 jroddev 2024-04-29 08:35:39 UTC
I changed it to 90 seconds for good measure.
It might also be worth noting that I can't recover the system once the monitor is plugged in.
It locks up immediate (at least visually) and even after disconnecting the monitor it doesn't start working again.
Even trying to switch out to terminals once the monitor is disconnected doesn't work. Need to reboot to get back in.
Comment 7 jroddev 2024-04-29 08:36:41 UTC
Created attachment 168990 [details]
kwin-drm-debug 90 seconds wait
Comment 8 jroddev 2024-04-29 08:37:12 UTC
Created attachment 168991 [details]
dmesg-drm-debug 90 second wait
Comment 9 Bug Janitor Service 2024-05-14 03:45:25 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 10 jroddev 2024-05-14 07:04:35 UTC
Whoops. Didn't know I needed to set Status to Reported
Comment 11 Zamundaaa 2024-05-22 14:04:01 UTC
hmm, the drm log is cut off in the exact same spot as the last one. That suggests to me something is going very wrong in the kernel. Please report this to NVidia, they might be able to do more about this
Comment 12 jroddev 2024-07-13 03:56:16 UTC
The lockout no longer occurs. I'm not sure exactly what fixed it, but it could be 
- Performed a bios updated on the motherboard.
- Switched from 5 year old Manjaro to fresh AuroraOS.
- Other general updates since I reported the issue.

Now when I enable HDR the system freezes for a moment and then resumed. 
The HDR setting gets set back to disabled (after closing and reopening system settings).
I believe this is now expected behaviour since there seems to be a problem with either my monitor or graphic card/drivers.