Bug 484037 - Primary display loses its resolution configuration when resuming from sleep
Summary: Primary display loses its resolution configuration when resuming from sleep
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (show other bugs)
Version: 6.0.2
Platform: openSUSE Linux
: HI normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: multiscreen, regression
: 483654 486504 490462 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-03-20 03:21 UTC by smishos
Modified: 2024-07-21 17:33 UTC (History)
7 users (show)

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


Attachments
Screenshot of the display settings after resuming from sleep (112.45 KB, image/png)
2024-03-20 03:21 UTC, smishos
Details
drm_info.correct (266.51 KB, application/octet-stream)
2024-03-26 00:53 UTC, smishos
Details
Requested drm_info when the display is broken (266.49 KB, application/octet-stream)
2024-03-26 00:55 UTC, smishos
Details
kwinoutputconfig.json when correct (3.17 KB, text/plain)
2024-03-26 00:56 UTC, smishos
Details
kwinoutputconfig.json when broken (3.17 KB, text/plain)
2024-03-26 00:56 UTC, smishos
Details
logs of failing wakeup and working wakeup (15.01 KB, text/plain)
2024-05-27 16:31 UTC, Ed Tomlinson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description smishos 2024-03-20 03:21:41 UTC
Created attachment 167494 [details]
Screenshot of the display settings after resuming from sleep

SUMMARY
Randomly, when resuming from sleep, the primary display will be running at 640x480 rather than its usual 4K resolution. The resolution can be reverted to 4K and the screen can be repositioned using Display Configuration in System Settings.

STEPS TO REPRODUCE
1. allow the system to sleep
2. resume from sleep

OBSERVED RESULT
Randomly observe the primary display losing its resolution settings.

EXPECTED RESULT
Displays would retain their configuration when resuming from sleep.

SOFTWARE/OS VERSIONS
Linux: openSUSE Tumbleweed 20240318
(available in About System)
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION
Kernel Version: 6.7.9-1-default (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz
Memory: 62.5 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: Intel(R) Client Systems
Product Name: NUC11PAHi5
System Version: M15533-302
Comment 1 David Edmundson 2024-03-24 23:28:34 UTC
*** Bug 483654 has been marked as a duplicate of this bug. ***
Comment 2 Zamundaaa 2024-03-25 01:43:52 UTC
Please attach the output of drm_info as well as your ~/.config/kwinoutputconfiguration.json when the resolution is correct, and when it's wrong.
Comment 3 smishos 2024-03-26 00:53:33 UTC
Created attachment 167771 [details]
drm_info.correct

Requested drm_info when the displays are correct.
Comment 4 smishos 2024-03-26 00:55:20 UTC
Created attachment 167772 [details]
Requested drm_info when the display is broken

Requested drm_info when the display is broken
Comment 5 smishos 2024-03-26 00:56:01 UTC
Created attachment 167773 [details]
kwinoutputconfig.json when correct

kwinoutputconfig.json when correct
Comment 6 smishos 2024-03-26 00:56:31 UTC
Created attachment 167774 [details]
kwinoutputconfig.json when broken

kwinoutputconfig.json when broken
Comment 7 smishos 2024-03-26 00:58:21 UTC
(In reply to Zamundaaa from comment #2)
> Please attach the output of drm_info as well as your
> ~/.config/kwinoutputconfiguration.json when the resolution is correct, and
> when it's wrong.

Uploaded the requested files.

I'll note that the issue has only occurred once in approximately 4 times today.
Comment 8 Bug Janitor Service 2024-04-10 03:47:44 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 9 Zamundaaa 2024-05-22 19:08:28 UTC
The resolution was 1080p in this case, but the mode list looks okay. The EDID hash also hasn't changed... my best guess would be that at some point, the driver exposes the display with lower resolution modes only, so KWin falls back to that as well, and it doesn't restore the actually intended mode later when it gets the correct modelist.
Comment 10 Bug Janitor Service 2024-05-22 20:15:09 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5761
Comment 11 Zamundaaa 2024-05-22 20:33:30 UTC
*** Bug 486504 has been marked as a duplicate of this bug. ***
Comment 12 Nate Graham 2024-05-23 04:39:49 UTC
*** Bug 486504 has been marked as a duplicate of this bug. ***
Comment 13 smishos 2024-05-23 04:56:58 UTC
Updated system information...
Operating System: openSUSE Tumbleweed 20240521
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0
Kernel Version: 6.9.1-1-default (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz
Memory: 62.5 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: Intel(R) Client Systems
Product Name: NUC11PAHi5
System Version: M15533-302

I've also tested with the newer Xe driver using the following kernel parameters...
i915.force_probe=!9a49 xe.force_probe=9a49 

The issue persists.
Comment 14 smishos 2024-05-23 05:08:17 UTC
A few recent occurrences dropped the resolution all the way to 640x480 and the list of supported resolutions no longer contained resolutions above 1024x768. A normal list of resolutions was available again after a reboot.
Other potentially relevant information...
- both monitors are the same make/model (ASUS VG289)
- the problematic display is the one which is connected via HDMI and is in landscape orientation
- the display which is connected via DisplayPort and is in portrait orientation never has any issues.
- it doesn't matter which display is marked as primary, the issue is always with the HDMI-connected monitor.
Comment 15 Ed Tomlinson 2024-05-23 13:37:49 UTC
This has just started happening here.  Wayland, primary display is DP-1, no converters/switches involved (DP to DP cable).  Gathering info.

When the problem happens and your cursor is on the 640x480 screen, its not possible to move in onto the other screen.  If you select configure display settings, you can select the correct mode but cannot move the primary display since the window just too small.  You cannot select apply since the two displays are not touching...  Only way I have found to fix it is to unplug the primary display to force the cursor onto the secondary, open the dialog on the secondary, reconnect the primary then fix the settings.  It can be a real pita.  I'd really like to understand what changed on here on May 21 to start triggering this bug.   I have a 1440  @165 with hdr and 1080 @60 display. Here is a kscreen-doctor -o and wayland-info for my system.   https://zigbin.io/dfc78e

This problem is NOT limited to HDMI, here it happen on the Primary display and does not matter if the display is connected via HDM or DP nor is it limited to displays attached thru a switch (direct connection here).
Comment 16 Ed Tomlinson 2024-05-23 13:40:05 UTC
The problem is intermittent here.  Next time it happens I will gather info before fixing it.
Comment 17 Ed Tomlinson 2024-05-24 12:48:12 UTC
Here is the output of kscreen-doctor -o and wayland-info when the primary display is using 640x480...  All looks consistant.  I was able to restore my display using kscreen-doctor output.2.mode-1 .  It would be VERY nice to see this fixed.  What other info will help?
Comment 18 Ed Tomlinson 2024-05-24 12:50:33 UTC
Help if I include the link: https://zigbin.io/652359
Comment 19 Ed Tomlinson 2024-05-24 12:54:14 UTC
BTW I am on an up to date arch install.  So this is happening with kwin 6.0.4 on kernels 6.9.1 and 6.8.10
Comment 20 Kalzi 2024-05-24 14:56:06 UTC
I still get this issue. I did report it, too, and my report was marked as duplicate of this one. One thing that gets me out of it is the command that was provided by Zamunda 

kscreen-doctor output.1.mode.0

This issue only happens on the display that is connected with DP
Comment 21 Ed Tomlinson 2024-05-27 16:31:48 UTC
Created attachment 169879 [details]
logs of failing wakeup and working wakeup

Here are logs from both a failing (system & --user) and system from a working wakeup.  If I had to guess I'd say, in the failing case, the display had not finished sending it's DPMS data when kwin/powerdevil/plasma sent a resize request and the drm driver rejected the request ended up at 640x480.  When it worked, the DPMS info had be completely sent...
Comment 22 Ed Tomlinson 2024-05-27 16:34:52 UTC
This was on kernel 6.8.10, plasma 6.1-beta (KDE-unstable), mesa 24.1 (from Arch unstable) the rest of the system is up to date arch from stable repos (eg. just mesa 24.1 is cherry picked from unstable).
Comment 23 smishos 2024-06-03 21:28:18 UTC
I was optimistic after my system updated today, it resumed twice from sleep without issue (screen configurations are retained, as were window positions), but the third time was not the charm -- screen layout was broken once again.

Operating System: openSUSE Tumbleweed 20240531
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1
Kernel Version: 6.9.3-1-default (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz
Memory: 62.5 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: Intel(R) Client Systems
Product Name: NUC11PAHi5
System Version: M15533-302

sudo zypper info kwin6
Information for package kwin6:
------------------------------
Repository     : Main Repository (OSS)
Name           : kwin6
Version        : 6.0.5-1.1
Arch           : x86_64
Vendor         : openSUSE
Installed Size : 10.6 MiB
Installed      : Yes (automatically)
Status         : up-to-date
Source package : kwin6-6.0.5-1.1.src
Upstream URL   : https://www.kde.org
Summary        : KDE Window Manager
Description    : 
    KWin is Plasma window manager.
Comment 24 Zamundaaa 2024-06-04 14:06:55 UTC
Git commit 8c257840700e55ad3dfb2521ad572eeae4096d9b by Xaver Hugl.
Committed on 04/06/2024 at 13:52.
Pushed by zamundaaa into branch 'master'.

outputconfigurationstore: split user configured and automatically set modes

If the mode the user has previously set through KScreen isn't available, this falls
back to a different mode without overwriting the user preference. If on the next
hotplug, the desired mode is available again, it then gets chosen instead of the
fallback

M  +2    -0    src/backends/drm/drm_output.cpp
M  +12   -0    src/core/output.cpp
M  +4    -0    src/core/output.h
M  +2    -0    src/core/outputconfiguration.h
M  +29   -10   src/outputconfigurationstore.cpp
M  +9    -1    src/wayland/outputmanagement_v2.cpp

https://invent.kde.org/plasma/kwin/-/commit/8c257840700e55ad3dfb2521ad572eeae4096d9b
Comment 25 Zamundaaa 2024-06-04 14:23:22 UTC
Git commit 80895dc465b4f03a824da3f955a675e205e8eefe by Xaver Hugl.
Committed on 04/06/2024 at 14:07.
Pushed by zamundaaa into branch 'Plasma/6.1'.

outputconfigurationstore: split user configured and automatically set modes

If the mode the user has previously set through KScreen isn't available, this falls
back to a different mode without overwriting the user preference. If on the next
hotplug, the desired mode is available again, it then gets chosen instead of the
fallback


(cherry picked from commit 8c257840700e55ad3dfb2521ad572eeae4096d9b)

Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com>

M  +2    -0    src/backends/drm/drm_output.cpp
M  +12   -0    src/core/output.cpp
M  +4    -0    src/core/output.h
M  +2    -0    src/core/outputconfiguration.h
M  +29   -10   src/outputconfigurationstore.cpp
M  +9    -1    src/wayland/outputmanagement_v2.cpp

https://invent.kde.org/plasma/kwin/-/commit/80895dc465b4f03a824da3f955a675e205e8eefe
Comment 26 Ed Tomlinson 2024-06-05 12:45:08 UTC
How does this solve the issue?  From the description of the commit it seems that it is still going to set 640x480 but if I unplug and replug it will revert to 2560x1440 which I selected manually previously.  If this is correct, I will still need to run kscreen-doctor to set the correct reolution...
Comment 27 Zamundaaa 2024-06-05 13:16:31 UTC
The hotplugs mentioned in the commit message aren't physical connector changes but udev change events KWin gets notified about, which are caused by many more things than physically removing the connector - for example by a change in the supported modes.
Comment 28 Nate Graham 2024-06-10 19:14:03 UTC
*** Bug 488201 has been marked as a duplicate of this bug. ***
Comment 29 Ed Tomlinson 2024-06-19 16:46:45 UTC
Upgraded to 6.1 on Arch.  Just had a my primary DP screen fail to unblank.  Its _worst_ than being stuck with the wrong resolution now.   What  happened here is I got a back screen with two cursors showing (neither would move).  Doing ALT+f2 displayed nothing.  Typing in kscreen-doctor output.DP-1.mode.1 blind and executing restored the display.  What traces will help get this fixed?
Comment 30 Zamundaaa 2024-06-19 18:33:51 UTC
If the screen is black, that'll be a different problem. Please make a new bug report for that
Comment 31 Zamundaaa 2024-07-21 17:25:22 UTC
*** Bug 490462 has been marked as a duplicate of this bug. ***