Page MenuHomePhabricator

When resume is done with a different number of screens than suspend, screen configs are not refreshed
Open, Pending on user inputPublic

Description

Since a couple of weeks, when I suspend my laptop *without* an external screen connected, and then resume it after having connected one, the external screen is not detected. The situation is corrected by hitting ctrl+alt+end (E restart).

It may be related to https://phab.enlightenment.org/T5978, at least it seems to have started around the same time.

Current versions:
% pacman -Q | grep enli
enlightenment-git 0.21.99.23030.gb304e77f6-1

% pacman -Q | grep efl
efl-git 1.20.99.55239.gb656e82b09-1

fanf42 created this task.Sep 12 2017, 1:01 AM

Also (so that I don't always tell bad things here :), since I have that behaviour, I also have a *much* better experience when connecting/disconnecting screens: all my windows positions on screens are restored, it is really nice :)

ProhtMeyhet triaged this task as Pending on user input priority.Sep 12 2017, 9:03 PM
ProhtMeyhet added a subscriber: ProhtMeyhet.

from the other tasks i gather you are using X, not wayland.

when this happens, can you check if X detected the screen? e depends there on X. try xrandr first, but that may solve the problem because xrandr grabs and resets X. anyways, please check, because it might be an X or driver issue.

fanf42 added a comment.EditedSep 13 2017, 1:57 AM

from the other tasks i gather you are using X, not wayland.

Ah sorry, yes I'm using X with intel driver. Did you need some more infor on that?

when this happens, can you check if X detected the screen? e depends there on X. try xrandr first, but that may solve the problem because xrandr grabs and resets X. anyways, please check, because it might be an X or driver issue.

Hum, you may be right. I'm experiencing that:

1/ both that issue and https://phab.enlightenment.org/T5978 happens only if there was a E restart (ctrl+alt+end) between the suspend/resume, i.e:

Case 1:

  • laptop undocked, no external monitor
  • E restart
  • close lid (suspend)
  • dock (with external screen)
  • open lid (resume)

-> screen detection incorrect

Case 2:

  • laptop undocked, no external monitor
  • NO E restart since undocking
  • close lid (suspend)
  • dock (with external screen)
  • open lid (resume)

-> screen detection correct

2/ when it happens, xrandr correctly detects the second screen (i.e: xrandr displays two screens).

3/ when it happens, "xrandr --auto" correct the problem

4/ here is my config of screens (not sure if it helps, but still: https://photos.app.goo.gl/atXm3uqDaaNq4B3F3)

5/ in my xorl log, I'm seeing (for an undock with the external screen not "removed")

[109398.242] (II) AIGLX: Suspending AIGLX clients for VT switch
[109428.346] (II) Open ACPI successful (/var/run/acpid.socket)
[109428.347] (II) AIGLX: Resuming AIGLX clients after VT switch
[109428.347] (II) intel(0): switch to mode 1600x900@60.0 on LVDS1 using pipe 0, position (1920, 0), rotation normal, reflection none
[109428.391] (II) intel(0): switch to mode 1920x1080@60.0 on VGA1 using pipe 1, position (0, 0), rotation normal, reflection none
[109428.479] (II) event3  - (II) Power Button: (II) is tagged by udev as: Keyboard
...

So it doesn't seem to actually have understood the VGA screen isn't here anymore. With xrandr --auto, I get these additionnals logs:

[109532.889] (II) intel(0): resizing framebuffer to 3520x900
[109532.938] (II) intel(0): switch to mode 1600x900@60.0 on LVDS1 using pipe 0, position (0, 0), rotation normal, reflection none
[109532.988] (II) intel(0): switch to mode 1600x900@60.0 on LVDS1 using pipe 0, position (1920, 0), rotation normal, reflection none

(not sure why the framebutter is resize to 3520x900 and not 1600x900. When I connect the second screen the resizing is done to "3520x1080" as expected.

ProhtMeyhet raised the priority of this task from Pending on user input to Normal.Sep 13 2017, 3:19 AM
In T6007#98047, @fanf42 wrote:

when this happens, can you check if X detected the screen? e depends there on X. try xrandr first, but that may solve the problem because xrandr grabs and resets X. anyways, please check, because it might be an X or driver issue.

Hum, you may be right. I'm experiencing that:

1/ both that issue and https://phab.enlightenment.org/T5978 happens only if there was a E restart (ctrl+alt+end) between the suspend/resume, i.e:

i'm sorry, but this is very probably a driver bug and/or X bug. you'll have to report this to Arch and freedesktop.org and the intel driver guys, because only then someone may actually look into this.

when you connect a screen, the driver is supposed to notice and report to the display server (X). the display server then is supposed to notice the window manager (enlightenment). something there went wrong. when you restart enlightenment, enlightenment will query the display server about all screens. enlightenment doesn't do that periodically, because it takes (the hardware) a couple of seconds (!!) to respond, in which the display server will not render (which results in fixed images/frames) so this is not an option for enlightenment.

i hope i wrote that clear enough :-)

Very clear. It was what I thought given the log etc. Something is broken somewhere between udev, intel driver, or something else. I'm very good now at building an xorg stack with debug info turns on, so as soon as I have the motivation to do it, I will report.

Well, in fact I suspect it's something with udev or power management, because I just noticed that now, when I resume my laptop, the dvd-rom (yes, it is an OLD laptop) is doing a SEEK noise, which it wasn't doing before. So the things may be linked. Joy and pleasure in debuging to come :)

Thanks for the help.

zmike lowered the priority of this task from Normal to Pending on user input.Sep 13 2017, 9:10 AM

If your driver/system is not recognizing the hotplug state of your monitors then there is nothing that can be done on my end...

@zmike: it is recognizing if the laptop is but not if the plug was done during suspend. I will try to find the root cause of the problem, it used to works... But as you said, you can't do much if the problem is at that level :)