screen cannot be turned back on after being switched off after some time of inactivity

Bug #1577170 reported by Christophe
26
This bug affects 3 people
Affects Status Importance Assigned to Milestone
xserver-xorg-video-ati (Ubuntu)
Expired
Medium
Unassigned

Bug Description

When using my AMD Radeon X1300 card, if the screen turns off due to inactivity, it cannot be woken up by moving the mouse or by hitting a key.

When I kill the Xorg process via ssh with another computer, the screen then comes to life again and I can log back in.

When I remove the AMD Radeon X1300 graphics card from the computer and use the built in graphics card instead, the bug doesn't occur.

There is no problem waking the screen when I type "xset -display :0.0 dpms force off" in a terminal. Moreover typing gnome-screensaver-command -a in a terminal turns my screen off and after typing this line, the screen can be woken up by moving the mouse or by hitting a key.

Upstream fix patch:
https://lists.freedesktop.org/archives/amd-gfx/2016-August/000996.html

---
.tmp.unity_support_test.0:

ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CompizPlugins: No value set for `/apps/compiz-1/general/screen0/options/active_plugins'
CompositorRunning: compiz
CompositorUnredirectDriverBlacklist: '(nouveau|Intel).*Mesa 8.0'
CompositorUnredirectFSW: true
CurrentDesktop: Unity
DistUpgraded: Fresh install
DistroCodename: xenial
DistroRelease: Ubuntu 16.04
DistroVariant: ubuntu
DkmsStatus:
 virtualbox, 5.0.18, 4.4.0-24-generic, x86_64: installed
 virtualbox, 5.0.18, 4.4.0-28-generic, x86_64: installed
ExtraDebuggingInterest: No
GraphicsCard:
 Advanced Micro Devices, Inc. [AMD/ATI] RV516 [Radeon X1300/X1550 Series] [1002:7183] (prog-if 00 [VGA controller])
   Subsystem: Dell RV516 [Radeon X1300/X1550 Series] [1028:0302]
   Subsystem: Dell RV516 [Radeon X1300/X1550 Series] (Secondary) [1028:0303]
InstallationDate: Installed on 2016-04-23 (71 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
MachineType: Dell Inc. Dell DM061
Package: xorg 1:7.7+13ubuntu3
PackageArchitecture: amd64
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.4.0-28-generic root=UUID=d8d495da-2071-481b-8e28-497d8eca9aff ro quiet splash vt.handoff=7
ProcVersionSignature: Ubuntu 4.4.0-28.47-generic 4.4.13
Tags: xenial ubuntu compiz-0.9
Uname: Linux 4.4.0-28-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
_MarkForUpload: True
dmi.bios.date: 05/24/2007
dmi.bios.vendor: Dell Inc.
dmi.bios.version: 2.4.0
dmi.board.name: 0WG864
dmi.board.vendor: Dell Inc.
dmi.chassis.type: 6
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvr2.4.0:bd05/24/2007:svnDellInc.:pnDellDM061:pvr:rvnDellInc.:rn0WG864:rvr:cvnDellInc.:ct6:cvr:
dmi.product.name: Dell DM061
dmi.sys.vendor: Dell Inc.
version.compiz: compiz 1:0.9.12.2+16.04.20160526-0ubuntu1
version.ia32-libs: ia32-libs N/A
version.libdrm2: libdrm2 2.4.67-1ubuntu0.16.04.1
version.libgl1-mesa-dri: libgl1-mesa-dri 11.2.0-1ubuntu2
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 11.2.0-1ubuntu2
version.xserver-xorg-core: xserver-xorg-core 2:1.18.3-1ubuntu2.2
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.10.1-1ubuntu2
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:7.7.0-1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20160325-1ubuntu1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.12-1build2

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1577170/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
tags: added: xenial
affects: ubuntu → xorg (Ubuntu)
Revision history for this message
Christophe (touil1976) wrote :

The problem is not solved with the latest 4.6 kernel.

Revision history for this message
Christophe (touil1976) wrote :
Revision history for this message
Christophe (touil1976) wrote :
Christophe (touil1976)
affects: xorg (Ubuntu) → gnome-screensaver (Ubuntu)
description: updated
Christophe (touil1976)
description: updated
description: updated
description: updated
Revision history for this message
Christophe (touil1976) wrote :

EDIT : I just found that letting the screen be turned off when not logged at all (when I boot the computer and don't log in for example) causes no problem. The screen goes black and can be woken up by moving the mouse or by hitting a key. The problem only appear when logged in, whatever the user.

no longer affects: xserver-xorg-video-ati (Ubuntu)
no longer affects: gnome-screensaver (Ubuntu)
Christophe (touil1976)
affects: unity (Ubuntu) → xserver-xorg-video-ati (Ubuntu)
Christophe (touil1976)
description: updated
Revision history for this message
Nicolai Hähnle (nha) wrote :

Some notes after helping to investigate this via IRC:

The DDX is stuck in drmmode_set_mode_major during its attempt to unblank the display, because it is waiting for a pending page flip that is never delivered (based on the backtrace provided by Christoph, which I'm attaching for future reference).

Revision history for this message
Christophe (touil1976) wrote :

Thanks to the guys in the #radeon channel on irc, I found a way to solve the problem.
You have to apply this patch to the source of the video driver (xfree86-video-ati-7.7.0) : https://paste.debian.net/plain/682956
and compile then install it (using --prefix=/usr for the configure process).

summary: - screen cannot be turned back on after being switched off after some time
- of inactivity
+ [solved] screen cannot be turned back on after being switched off after
+ some time of inactivity
Revision history for this message
C de-Avillez (hggdh2) wrote : Re: [solved] screen cannot be turned back on after being switched off after some time of inactivity

this is the patch in the link above:

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 4c66ca7..a848345 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -288,6 +288,7 @@ static void
 drmmode_do_crtc_dpms(xf86CrtcPtr crtc, int mode)
 {
  drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+ drmmode_ptr drmmode = drmmode_crtc->drmmode;
  ScrnInfoPtr scrn = crtc->scrn;
  RADEONInfoPtr info = RADEONPTR(scrn);
  CARD64 ust;
@@ -296,6 +297,11 @@ drmmode_do_crtc_dpms(xf86CrtcPtr crtc, int mode)
  if (drmmode_crtc->dpms_mode == DPMSModeOn && mode != DPMSModeOn) {
   drmVBlank vbl;

+ /* Wait for any pending flip to finish */
+ do {} while (drmmode_crtc->flip_pending &&
+ drmHandleEvent(drmmode->fd,
+ &drmmode->event_context) > 0);
+
   /*
    * On->Off transition: record the last vblank time,
    * sequence number and frame period.

Revision history for this message
C de-Avillez (hggdh2) wrote :

<sigh/> tabs were lost in translation.

Revision history for this message
Christophe (touil1976) wrote :

Strange, as with the patched driver, the problem reappeared today.

Revision history for this message
Michel Dänzer (michel-daenzer) wrote :

This should be a better fix. Does it fix the problem?

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Wait for pending flips to complete before turning off a CRTC" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Christophe (touil1976) wrote :

Thank you Michel for this new fix. Unfortunately, this one does not work on my computer at all.

With the previous patch, the problem seemed to have been fixed, but wasn't completely fixed as my computer couldn't be woken up when two screens were used on my radeon card (it works so far with only one screen connected).

With the newest patch, even when only one screen is connected to the graphics card, the computer cannot be woken up anymore after the screen goes to sleep.

Are those patches so different ?

Revision history for this message
Christophe (touil1976) wrote :

What I have noticed is that when two screens are plugged in the graphic card, and the desktop appears on both screen, and when I then choose to only use the dvi-connected screen via the "display" menu in ubuntu, the vga-connected screen goes off, and the dvi-connected screen only show the mouse on a black screen. To see the desktop again, I have to switch to tty1 (ctrl alt F1) and then ctrl alt F7.
I don't know if this could be related to the problem.

Revision history for this message
Michel Dänzer (michel-daenzer) wrote :

Can you get new gdb backtraces from when it hangs with the old fix with two monitors and when it hangs with the new fix?

Revision history for this message
Christophe (touil1976) wrote :
Revision history for this message
Christophe (touil1976) wrote :
Revision history for this message
Christophe (touil1976) wrote :

I just attached the two gdb backtraces from when it hangs. I must add that during the "make" process of the newly patched radeon driver, I get this warning :

radeon_drm_queue.c: In function ‘radeon_drm_queue_alloc’:
radeon_drm_queue.c:95:9: warning: return makes integer from pointer without a cast [-Wint-conversion]
  return NULL;

Maybe that explains why the monitor never wakes up after being turned off with the newly patched driver ?

Christophe (touil1976)
summary: - [solved] screen cannot be turned back on after being switched off after
- some time of inactivity
+ screen cannot be turned back on after being switched off after some time
+ of inactivity
Revision history for this message
penalvch (penalvch) wrote :

Christophe, thank you for reporting this and helping make Ubuntu better.

Could you please run the following command once from a terminal by ensuring you have the package xdiagnose installed, and that you click the Yes button for attaching additional debugging information:
apport-collect -p xorg 1577170

When reporting xorg related bugs in the future, please do so via the above method. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

no longer affects: xserver-xorg-video-ati (Ubuntu)
affects: xserver-xorg-driver-ati → xorg (Ubuntu)
Changed in xorg (Ubuntu):
status: New → Incomplete
importance: Undecided → Low
Revision history for this message
Christophe (touil1976) wrote : BootLog.txt

apport information

tags: added: apport-collected compiz-0.9 ubuntu
description: updated
Revision history for this message
Christophe (touil1976) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : Dependencies.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : DpkgLog.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : GconfCompiz.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : JournalErrors.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : Lspci.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : Lsusb.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : MonitorsUser.xml.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : ProcEnviron.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : ProcModules.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : UdevDb.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : UnitySupportTest.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : XorgLog.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : XorgLogOld.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : Xrandr.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : drirc.txt

apport information

Revision history for this message
Christophe (touil1976) wrote : xdpyinfo.txt

apport information

Revision history for this message
penalvch (penalvch) wrote :

Christophe, could you please provide the full computer model as noted on the sticker of the computer itself (not from the Bug Description)?

Revision history for this message
Christophe (touil1976) wrote :

It's a DELL Dimension E520. Is that the full computer model ?

penalvch (penalvch)
tags: added: latest-bios-2.4.0
removed: patch
Revision history for this message
penalvch (penalvch) wrote :

Christophe, the issue you are reporting is an upstream one. Could you please report this problem via https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/Radeon ?

Please provide a direct URL to your bug report once you have made it so that it may be tracked.

Thank you for your help.

affects: xorg (Ubuntu) → xserver-xorg-video-ati (Ubuntu)
Changed in xserver-xorg-video-ati (Ubuntu):
importance: Low → Medium
status: Incomplete → Triaged
Revision history for this message
Michel Dänzer (michel-daenzer) wrote :

Does this patch work better? If not, please provide new gdb backtraces again.

Revision history for this message
Christophe (touil1976) wrote :

Michel, this patch seems to work quite well, but still showing some strange behaviour. To sum up, with the new patch :
- with one or two screens used, when the screens goes off after some time of inactivity, they can be woken up by moving the mouse.
- when two screens are used, from time to time, the screen connected via the VGA port of the graphics card does not goes off. (Its light dims, the screen goes black and then shows the login page again, the dvi-connected screen staying off until I move the mouse). With only one screen used (the dvi one), this behaviour does not appear until now.
- Using the ubuntu screen selector, from time to time, when I change from two screens to one screen, the screen goes black only showing the mouse arrow. I have to go to tty1 then press ctrl alt f7 to see the normal screen again. Once, doing this, even the keyboard and the mouse stopped responding.
- During the make process of the driver (with the patch), I still get the same warning :
radeon_drm_queue.c: In function ‘radeon_drm_queue_alloc’:
radeon_drm_queue.c:95:9: warning: return makes integer from pointer without a cast [-Wint-conversion]
  return NULL;

Revision history for this message
Michel Dänzer (michel-daenzer) wrote :

Does this updated version of the patch work better? If not:

The black screen when changing between one and two monitors never happens without this patch?

Please attach the output of xrandr --verbose when both monitors are enabled.

P.S. Thanks for reporting the compile warning, but it's harmless and not related to my patches or your issues.

Revision history for this message
Christophe (touil1976) wrote :

Same problem with this patch. Well in fact, it's even worse as I got a kernel panic when trying to switch from 2 screens to only one (see picture attached).

I attached the output of xrandr before and after the black screen (but before the complete crash).

The black screen when changing between one and two monitors also appears without the patch.

Revision history for this message
Christophe (touil1976) wrote :
Revision history for this message
Christophe (touil1976) wrote :
Revision history for this message
Christophe (touil1976) wrote :
Revision history for this message
Christophe (touil1976) wrote :

I must add that without the patch, after the black screen and the ctrl-alt-F1 then ctrl-alt-F7, I had a dialog box saying : "Impossible de restaurer la configuration de l'affichage
could not set the configuration for CRTC 80".

Revision history for this message
Michel Dänzer (michel-daenzer) wrote :

So the latest patch doesn't help for the VGA monitor not going off?

Please attach the output of xrandr --verbose when both monitors are enabled. It doesn't matter whether or not any of my patches are enabled when you do that.

The kernel panic is a kernel bug and probably not directly related to my patches or your issues. It may indicate that Xorg crashed though; was there anything interesting in Xorg.0.log.old after it happened?

Revision history for this message
Christophe (touil1976) wrote :

In the next comment, you will findthe output of xrandr --verbose, when both monitors are enabled, with the original (non patched) drivers.
I must say that the patch you posted in comment #47 works perfectly when it comes to wake the monitor after some time of sleep. Only the problem of black screens when switching from one to two screens enabled remains.

Revision history for this message
Christophe (touil1976) wrote :
Revision history for this message
Christophe (touil1976) wrote :

Another thing I just noticed : with or without the patch, the only thing that works with two screen is the extended mode. When I try to go from two screen extended to two screen clone mode, both screens switch off and cannot be switched back on.

Revision history for this message
Michel Dänzer (michel-daenzer) wrote :

It sounds like the latest patch fixes the problem you filed this report for, so I posted it to the amd-gfx mailing list for review.

The problem(s) with switching between one and two monitors should be tracked separately, preferably at https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/Radeon .

Revision history for this message
penalvch (penalvch) wrote :

Christophe, the upstream fix commit would have been included in Ubuntu 16.10 and above as per:
https://launchpad.net/ubuntu/+source/xserver-xorg-video-ati
https://cgit.freedesktop.org/xorg/driver/xf86-video-ati/commit/?id=9090309e057dc703d1a5bffd88e6cae14108cfc3
https://cgit.freedesktop.org/xorg/driver/xf86-video-ati/

Hence, to confirm this resolves your issue could you please test either 16.10 or 17.04 and advise to the results:
16.10: http://releases.ubuntu.com/yakkety/
17.04: http://cdimage.ubuntu.com/daily-live/current/

description: updated
tags: added: cherry-pick
Changed in xserver-xorg-video-ati (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
maenujem (maenujem) wrote :

I'm having the same error on Ubuntu 16.04.1 LTS (4.4.0-59-generic, 64bit) with ATI RV570 [Radeon X1950 PRO]: if logged in or locked, after the screen is turned off due to the inactivity time set in Ubuntu, it can not be turned back on by hitting a key / moving the mouse. It has to be rebooted manually. The error does not occur, if there is no logged-in user.

Revision history for this message
penalvch (penalvch) wrote :

maenujem, it will help immensely if you filed a new report with Ubuntu by ensuring you have the package xdiagnose installed, and that you click the Yes button for attaching additional debugging information running the following from a terminal:
ubuntu-bug xorg

Also, please feel free to subscribe me to it.

For more on why this is helpful, please see https://wiki.ubuntu.com/ReportingBugs.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for xserver-xorg-video-ati (Ubuntu) because there has been no activity for 60 days.]

Changed in xserver-xorg-video-ati (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Hark (cab902) wrote :

This bug is still existing on Ubuntu 16.04.6 LTS. Is there a plan to push the fix to 16.04?

Revision history for this message
penalvch (penalvch) wrote :

Hark (cab902), it will help immensely if you filed a new report with Ubuntu by ensuring you have the package xdiagnose installed, and that you click the Yes button for attaching additional debugging information running the following from a terminal:
ubuntu-bug xorg

Also, please feel free to subscribe me to it.

Revision history for this message
Hark (cab902) wrote :

OK. Created Bug #1821505

To post a comment you must log in.