Screen turned off after X server exits

Bug #1501941 reported by Robert Ancell on 2015-10-01
This bug affects 2 people
Affects Status Importance Assigned to Milestone
xserver-xorg-video-intel (Ubuntu)
Robert Ancell

Bug Description

When the X server exits, the screen turns off and doesn't seem to re-enable. The system is still running (i.e. can SSH in).

To reproduce:
1. Log into a session
2. Switch to the greeter (using indicators or running "dm-tool switch-to-greeter" from a terminal")
3. Log back into session

Expected result:
You return to the session

Observed result:
Screen goes black

This appears to be an issue in the Intel drivers, it occurs with the current wily (2:2.99.917+git20150808-0ubuntu2). It does not occur when downgrading to the vivid version (2:2.99.917-1~exp1ubuntu2.2 with some patches to compile in wily).

Robert Ancell (robert-ancell) wrote :

I am bisecting the problem...

Robert Ancell (robert-ancell) wrote :

I first noticed this occuring sometime around the end of August.

Robert Ancell (robert-ancell) wrote :
Download full text (4.1 KiB)

The issue is in git master and bisecting shows it to be this commit:

commit 7d9a74622e5a936e4860fcef8358619bf59adae8
Author: Chris Wilson <email address hidden>
Date: Mon Jun 15 14:16:34 2015 +0100

    sna: Be robust in handling DPMS failures

    If we fail to turn off an output via DPMS, disable the entire CRTC in
    order to blank the output and save the screeen/power.

    Reported-by: Lukas Hejtmanek <email address hidden>
    Signed-off-by: Chris Wilson <email address hidden>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index f58eb8d..efc5fc9 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -213,7 +213,7 @@ struct sna_output {
  int panel_vdisplay;

  uint32_t dpms_id;
- int dpms_mode;
+ uint8_t dpms_mode;
  struct backlight backlight;
  int backlight_active_level;

@@ -251,6 +251,7 @@ enum { /* XXX copied from hw/xfree86/modes/xf86Crtc.c */

+static void __sna_output_dpms(xf86OutputPtr output, int dpms, int fixup);
 static void sna_crtc_disable_cursor(struct sna *sna, struct sna_crtc *crtc);

 static bool is_zaphod(ScrnInfoPtr scrn)
@@ -936,7 +937,7 @@ sna_crtc_force_outputs_on(xf86CrtcPtr crtc)
   if (output->crtc != crtc)

- output->funcs->dpms(output, DPMSModeOn);
+ __sna_output_dpms(output, DPMSModeOn, false);

 #if XF86_CRTC_VERSION >= 3
@@ -966,7 +967,7 @@ sna_crtc_force_outputs_off(xf86CrtcPtr crtc)
   if (output->crtc != crtc)

- output->funcs->dpms(output, DPMSModeOff);
+ __sna_output_dpms(output, DPMSModeOff, false);

@@ -1099,7 +1100,7 @@ sna_crtc_apply(xf86CrtcPtr crtc)
    * and we lose track of the user settings.
   if (output->crtc == NULL)
- output->funcs->dpms(output, DPMSModeOff);
+ __sna_output_dpms(output, DPMSModeOff, false);

   if (output->crtc != crtc)
@@ -3580,7 +3581,7 @@ sna_output_destroy(xf86OutputPtr output)

 static void
-sna_output_dpms(xf86OutputPtr output, int dpms)
+__sna_output_dpms(xf86OutputPtr output, int dpms, int fixup)
  struct sna *sna = to_sna(output->scrn);
  struct sna_output *sna_output = output->driver_private;
@@ -3607,8 +3608,9 @@ sna_output_dpms(xf86OutputPtr output, int dpms)
  if (sna_output->backlight.iface && dpms != DPMSModeOn) {
   if (old_dpms == DPMSModeOn) {
    sna_output->backlight_active_level = sna_output_backlight_get(output);
- DBG(("%s: saving current backlight %d\n",
- __FUNCTION__, sna_output->backlight_active_level));
+ DBG(("%s(%s:%d): saving current backlight %d\n",
+ __FUNCTION__, output->name, sna_output->id,
+ sna_output->backlight_active_level));
   sna_output->dpms_mode = dpms;
@@ -3618,18 +3620,31 @@ sna_output_dpms(xf86OutputPtr output, int dpms)
- dpms))
- dpms = old_dpms;
+ dpms)) {
+ DBG(("%s(%s:%d): failed to set DPMS to %d (fixup? %d)\n",
+ __FUNCTION__, output->name, sna_output->id, dpms, fixup));
+ if (fixup) {
+ sna_crtc_disable(output->cr...


Robert Ancell (robert-ancell) wrote :
Changed in xserver-xorg-video-intel (Ubuntu):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Robert Ancell (robert-ancell)
Robert Ancell (robert-ancell) wrote :

I've put a patched version of the Intel driver in ppa:robert-ancell/xorg [1]. I think the change might cause a DPMS regression as described in the upstream bug so it probably should get some more testing before uploading.


Michał Sawicz (saviq) wrote :

Confirmed, this is the exact problem I'm having here.

Jean-Baptiste Lallement (jibel) wrote :

I tried the patched version from the PPA and it fixes the problem for me. No more black screen after restarting lightdm

Robert Ancell (robert-ancell) wrote :

I've uploaded this change to wily. There is a possibility that there might be a regression for some users with DPMS but I think that is less severe than the effect on those who are left with the screen off. We'll look at doing an update if upstream provides a fix.

Changed in xserver-xorg-video-intel (Ubuntu):
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xserver-xorg-video-intel - 2:2.99.917+git20150808-0ubuntu3

xserver-xorg-video-intel (2:2.99.917+git20150808-0ubuntu3) wily; urgency=medium

  * debian/patches/revert-dpms-fix.patch:
    - Revert a DPMS change that causes the screen to turn off when returning
      from a greeter (LP: #1501941)

 -- Robert Ancell <email address hidden> Tue, 06 Oct 2015 14:25:00 +1300

Changed in xserver-xorg-video-intel (Ubuntu):
status: Fix Committed → Fix Released

On Intel systems when the X server exits the display is turned off and remains off. This is triggered when using LightDM and switching to a greeter (starts a second X server) then authenticating in that greeter and returning to the first X server (the greeter X server is stopped).

The cause seems to be a DPMS change from bug 90179 (revision 7d9a74622e5a936e4860fcef8358619bf59adae8) that causes the driver to turn off the output if DPMS is not working.

Tracked in Launchpad:

We are currently working around this issue in Ubuntu 15.04 by reverting that one commmit.

Changed in xserver-xorg-video-intel:
importance: Unknown → Medium
status: Unknown → Confirmed

(In reply to Robert Ancell from comment #1)
> We are currently working around this issue in Ubuntu 15.04 by reverting that
> one commmit.

That one commit being

commit 7d9a74622e5a936e4860fcef8358619bf59adae8
Author: Chris Wilson <email address hidden>
Date: Mon Jun 15 14:16:34 2015 +0100

    sna: Be robust in handling DPMS failures

i.e. not a kernel commit. Apparently Chris' conclusion was that the kernel returns an error on DPMS.

Please attach dmesg with drm.debug=14 module parameter, all the way from boot to reproducing the problem.

Changed in xserver-xorg-video-intel:
status: Confirmed → Incomplete

I haven't been able to generate a dmesg due to another kernel issue I have where it spams the log. I will generate one when that issue is resolved...

This bug is really old, is this problem still persist? Robert are you able now to share your dmesg?

Changed in xserver-xorg-video-intel:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.