Bug 371447 - laptop screen disabled after resume from suspend to RAM
Summary: laptop screen disabled after resume from suspend to RAM
Status: RESOLVED FIXED
Alias: None
Product: KScreen
Classification: Plasma
Component: common (show other bugs)
Version: 5.8.2
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: Sebastian Kügler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-21 15:57 UTC by Martin Steigerwald
Modified: 2019-10-18 16:44 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.17.1


Attachments
kscreen.log (577.39 KB, text/plain)
2016-10-21 15:59 UTC, Martin Steigerwald
Details
kscreen-doctor -i --json after resume (25.25 KB, text/plain)
2016-10-21 16:03 UTC, Martin Steigerwald
Details
kscreen-console bug directly after resume (22.44 KB, text/plain)
2016-10-21 16:06 UTC, Martin Steigerwald
Details
kscreen-console bug after enabling laptop display (22.58 KB, text/plain)
2016-10-21 16:11 UTC, Martin Steigerwald
Details
kscreen.log after enabling laptop display again (599.38 KB, text/x-log)
2016-10-21 16:12 UTC, Martin Steigerwald
Details
kscreen kcm after resuming (78.88 KB, image/png)
2016-10-23 13:46 UTC, Martin Steigerwald
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Steigerwald 2016-10-21 15:57:39 UTC
With newest KScreen 5.8.2-1 (as packaged in Debian Sid) laptop screen is disabled after resume from suspend to RAM (probably also suspend/hibernation to disk). This didn´t happen with previous version 5.8.0 and I think also not 5.8.1 (not completely sure on that one)


Reproducible: Always

Steps to Reproduce:
1. Have laptop + external display.
2. Suspend to RAM by closing lid.
3. Resume

Actual Results:  
Laptop display is switched off.

Expected Results:  
Laptop display is switched on as it was before suspending.

ThinkPad T520 with Full HD internal and Full HD external display connected through docking station. I will add further debug output as attachments.

> phoronix-test-suite system-info

Phoronix Test Suite v5.2.1
System Information

Hardware:
Processor: Intel Core i5-2520M @ 3.20GHz (4 Cores), Motherboard: LENOVO 42433WG, Chipset: Intel 2nd Generation Core Family DRAM, Memory: 16384MB, Disk: 300GB INTEL SSDSA2CW30 + 480GB Crucial_CT480M50, Graphics: Intel 2nd Generation Core Family IGP, Audio: Conexant CX20590, Monitor: P24T-7 LED, Network: Intel 82579LM Gigabit Connection + Intel Centrino Advanced-N 6205

Software:
OS: Debian unstable, Kernel: 4.8.0-tp520-btrfstrim+ (x86_64), Desktop: KDE Frameworks 5, Display Server: X Server 1.18.4, Display Driver: modesetting 1.18.4, OpenGL: 3.3 Mesa 12.0.3, Compiler: GCC 6.2.0 20161019, File-System: btrfs, Screen Resolution: 3840x1080
Comment 1 Martin Steigerwald 2016-10-21 15:59:37 UTC
Created attachment 101687 [details]
kscreen.log

It appears to me that for whatever reason kscreen does not activate the second output:

21.10.2016 17:35:39.548 ; kded ;  : KScreen::Output( 72   "DP-3" connected enabled QPoint(0,0) QSize(1920, 1080) "112" )
21.10.2016 17:35:39.631 ; kscreen ;  : Requesting missing EDID for outputs (65, 72)
21.10.2016 17:44:54.258 ; kcm ;  : LOAD
21.10.2016 17:44:54.409 ; kcm ;  : Activate output 66
Comment 2 Martin Steigerwald 2016-10-21 16:03:37 UTC
Created attachment 101688 [details]
kscreen-doctor -i --json after resume

internal laptop display LVDS-1 (65) is disabled.

However according to kscreen log it tries to activate output 66 (VGA) which does not make any sense:

21.10.2016 17:35:39.548 ; kded ;  : KScreen::Output( 65   "LVDS-1" connected disabled QPoint(0,0) QSize(1920, 1080) "" )
21.10.2016 17:35:39.548 ; kded ;  : KScreen::Output( 72   "DP-3" connected enabled QPoint(0,0) QSize(1920, 1080) "112" )
21.10.2016 17:35:39.631 ; kscreen ;  : Requesting missing EDID for outputs (65, 72)
21.10.2016 17:44:54.258 ; kcm ;  : LOAD
21.10.2016 17:44:54.409 ; kcm ;  : Activate output 66

I, of course want output 65 and 72 enabled. 72 (the external display) is, but 65 isn´t.

Output: 65 LVDS-1 disabled connected  Panel Modes: 100:700x525@120 101:640x512@120 102:720x450@120 103:640x480@120 104:640x480@60 105:680x384@120 106:680x384@120 107:576x432@120 108:512x384@120 109:400x300@121 110:400x300@113 111:320x240@120 74:1920x1080@60! 75:1920x1080@60 76:1920x1080@50 77:1680x1050@60 78:1680x1050@60 79:1600x1024@60 80:1400x1050@60 81:1280x1024@60 82:1440x900@60 83:1280x960@60 84:1360x768@60 85:1360x768@60 86:1152x864@60 87:1024x768@120 88:1024x768@60 89:960x720@120 90:928x696@120 91:896x672@120 92:960x600@120 93:960x540@120 94:800x600@120 95:800x600@60 96:800x600@56 97:840x525@120 98:840x525@120 99:800x512@120 Geometry: 0,0 0x0
Output: 66 VGA-1 disabled disconnected  VGA Modes: Geometry: 0,0 0x0
Output: 67 HDMI-1 disabled disconnected  HDMI Modes: Geometry: 0,0 0x0
Output: 68 DP-1 disabled disconnected  DisplayPort Modes: Geometry: 0,0 0x0
Output: 69 HDMI-2 disabled disconnected  HDMI Modes: Geometry: 0,0 0x0
Output: 70 HDMI-3 disabled disconnected  HDMI Modes: Geometry: 0,0 0x0
Output: 71 DP-2 disabled disconnected  DisplayPort Modes: Geometry: 0,0 0x0
Output: 72 DP-3 enabled connected  DisplayPort Modes: 104:640x480@60 112:1920x1080@60*! 113:1920x1080@50 114:1920x1080@50 115:1920x1080@60 116:1920x1080@30 117:1920x1080@25 118:1920x1080@30 119:1600x900@60 120:1280x1024@75 121:1280x720@60 122:1280x720@50 123:1280x720@60 124:1024x768@75 125:800x600@75 126:720x576@50 127:720x480@60 128:720x480@60 129:640x480@75 130:640x480@60 131:720x400@70 77:1680x1050@60 81:1280x1024@60 82:1440x900@60 88:1024x768@60 95:800x600@60 Geometry: 0,0 1920x1080
Comment 3 Martin Steigerwald 2016-10-21 16:06:02 UTC
Created attachment 101689 [details]
kscreen-console bug directly after resume

Dunno what it wanted to parse from kscreen.log, but I attached this separately already.
Comment 4 Martin Steigerwald 2016-10-21 16:08:37 UTC
martin@merkaba:~> kscreen-doctor output.LVDS-1.enable
Enabling output 65
kscreen.doctor: setop exec returned

works, but enabled LVDS in clone mode. So it seems that kscreen completely forgot that the laptop screen is left to the external screen. Before fiddling further with kscreen-doctor arguments I fixed this using systemsettings kscreen kcm.
Comment 5 Martin Steigerwald 2016-10-21 16:11:31 UTC
Created attachment 101690 [details]
kscreen-console bug after enabling laptop display

This is the state I desire after resuming.
Comment 6 Martin Steigerwald 2016-10-21 16:12:34 UTC
Created attachment 101691 [details]
kscreen.log after enabling laptop display again

and moving it to the left side (instead of clone mode) as it was before. This is the state I had before suspend and the state I desire to see after suspend.
Comment 7 Martin Steigerwald 2016-10-23 13:46:12 UTC
Created attachment 101723 [details]
kscreen kcm after resuming

It completely lost state. Laptop display is disabled *and* not on the left of the external display anymore.

After more testing I find that it does not happen on every suspend. And I have a theory:

It might be a timing issue. I see that on closing the laptop it switched off the laptop screen and *then* after some delay suspended. Maybe kscreen recorded switching off the laptop display before the suspend started and now restores to exactly this state. I don´t know whether the kscreen.log would reveal such a timing issue.

However as I user I never *ever* want kscreen to disable my laptop screen *at all*. There may be users who close the lid to only use external displays however. And also users who don´t want laptop display switched on when using a beamer. My own expectation is this: Whenever laptop display lid is open display something there. Well actually remember the last configuration, which at some and at work for me means: On the left is laptop display, on the right is external display. Period. No discussions whatsoever asked for.
Comment 8 Martin Steigerwald 2016-10-26 07:44:26 UTC
I did not yet fully confirm it, but I think a timing issue is likely.

In the last days I suspended to RAM by menu, not by closing lid, and I had no disabled, black laptop screen at that time. This morning at work I had a disabled laptop screen again. However I do not remember exactly whether I closed the lid or used the menu. So I will use the menu for some longer time and if it doesn´t happen then, use the lid again.
Comment 9 Raúl 2019-08-24 00:26:01 UTC
For the record. I came into this problem on (Debian) buster. Even I could go to a text console I couldn't switch on the embedded panel on the laptop (eDP).
I tried kscreen-doctor and xrandr... till I read this answer:
https://askubuntu.com/a/1120169

So the trick was chvt into X and then do xrandr in there.
HTH,
Comment 10 Nicolas Fella 2019-10-17 17:30:31 UTC
Git commit e47dc21a7b7824889171f01bdc4b0209c8b1fed6 by Nicolas Fella.
Committed on 17/10/2019 at 17:30.
Pushed by nicolasfella into branch 'Plasma/5.17'.

Fix laptop screen being off when opening the lid

Summary:
filePath() returns the full path to the config file. readFile() then prepends configsDirPath() to the path, leading to a garbled file path and making it impossible to load the right file. We should instead just pass id() + _lidOpen to readFile.

Test Plan:
Connected a monitor to my laptop. Closed and reopened the lid.
Before:
Laptop screen was off. Needed turning on in the KCM.
After:
Laptop screen is on.

Both X11 and Wayland

Reviewers: #plasma, romangg

Reviewed By: #plasma, romangg

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D24719

M  +3    -3    kded/config.cpp

https://commits.kde.org/kscreen/e47dc21a7b7824889171f01bdc4b0209c8b1fed6
Comment 11 Martin Steigerwald 2019-10-18 16:44:24 UTC
Dear Nicolas. Thanks for fixing this long standing bug. For some reason I did not experience it in a long, long time, but knowing that it is fixed is even better. Thank you!