Bug 109246 - HDMI connected monitors fail to sleep and instead turn back on when amdgpu.dc=1
Summary: HDMI connected monitors fail to sleep and instead turn back on when amdgpu.dc=1
Status: RESOLVED MOVED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/AMDgpu (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-08 05:09 UTC by tme
Modified: 2019-11-19 09:10 UTC (History)
8 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg log (75.92 KB, text/plain)
2019-01-08 17:13 UTC, tme
no flags Details
dmesg output (86.92 KB, text/plain)
2019-01-08 17:15 UTC, tme
no flags Details

Description tme 2019-01-08 05:09:31 UTC
Original launchpad thread: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1790861

  Overview:
When my computer tries to suspend my monitors after a period of idleness, they'll suspend for a few seconds before waking back up.

  Steps to Reproduce:
1) Have a monitor attached over HDMI.
2) Set screen energy saving (in Plasma 5) to 1 minute.
3) After 1 minute has passed, the monitor will try to enter sleep mode. It will fail and turn back on.
4) The monitor will continue to attempt to enter sleep mode every minute until interrupted by the user.

  Actual Results:
The monitors turn back on a few seconds after entering sleep mode.

  Expected Results:
The monitors stay in sleep mode.

  Additional Information:
While I have two monitors, this issue is only triggered when one is connected using HDMI. Connecting only one monitor using HDMI will trigger the problem. Connecting either one using DVI does not trigger the problem. 
I am unable to test if DisplayPort triggers the problem, as I have no compatible monitors.
Setting the kernel parameter amdgpu.dc=0 does not cause the problem to trigger.

I haven't confirmed if the other affected users in the launchpad thread are using HDMI, so I'm only reporting my experience.
Comment 1 tme 2019-01-08 05:23:20 UTC
Forgot to mention that I have tested and reproduced this bug on kernel versions 4.18, 4.20, and 5.0-rc1.
Comment 2 fin4478 2019-01-08 08:02:32 UTC
I am tired to automatic monitor sleep problems and made a launcher to manually sleep the monitor.

#! /bin/bash

sleep 5s
xset dpms force standby
Comment 3 Michel Dänzer 2019-01-08 09:11:04 UTC
Please attach the output of dmesg and the Xorg log file, captured after reproducing the problem.
Comment 4 fin4478 2019-01-08 12:58:34 UTC Comment hidden (spam)
Comment 5 Alex Deucher 2019-01-08 14:29:32 UTC
Do you have an option in your monitor's menu to poll inputs?  If so can you disable it?  Some monitors poll inputs which sometimes causes the hpd pin to fire which looks like a hotplug event to the driver.
Comment 6 tme 2019-01-08 17:13:17 UTC
Created attachment 143014 [details]
Xorg log

I reproduced the problem at about 210 in the log.

Unfortunately I don't see an option to poll inputs in my monitor.
Comment 7 tme 2019-01-08 17:15:21 UTC
Created attachment 143015 [details]
dmesg output
Comment 8 Michel Dänzer 2019-01-08 18:07:49 UTC
From the Xorg log file:

[   212.439] (II) AMDGPU(0): Allocate new frame buffer 1440x900
[   212.439] (II) AMDGPU(0):  => pitch 6144 bytes
[   212.639] (II) AMDGPU(0): Allocate new frame buffer 3360x1080
[   212.639] (II) AMDGPU(0):  => pitch 14336 bytes

This does look like there are hotplug events, and the HDMI output is considered disconnected for a moment.

(In reply to Alex Deucher from comment #5)
> Some monitors poll inputs which sometimes causes the hpd pin to fire which
> looks like a hotplug event to the driver.

Any idea why this seems to only cause trouble with DC though?

(I was seeing similar symptoms with DC and an HDMI connection with Kaveri, I reported it to the DC developers internally a while ago; it's one reason why I'm currently not using DC on this machine)
Comment 9 tme 2019-01-08 19:12:22 UTC
I've tested some more kernels, all from https://kernel.ubuntu.com/~kernel-ppa/mainline/.

Setting amdgpu.dc=1 on 4.15.18 and 4.16.18 does not reproduce the problem. It does, however, reproduce on 4.17.19.

Also, I now believe my HDMI monitor may have polling, as it cycles through each input once when it no longer detects a signal.

Please let me know if there is anything else I can help with.
Comment 10 Alex Deucher 2019-01-08 20:20:57 UTC
(In reply to Michel Dänzer from comment #8)
> 
> This does look like there are hotplug events, and the HDMI output is
> considered disconnected for a moment.

When the monitor enters dpms, it starts polling inputs so it can light up whatever input gets connected without the user having to manually select the input.  This can cause havoc with drivers sometimes.

> 
> (In reply to Alex Deucher from comment #5)
> > Some monitors poll inputs which sometimes causes the hpd pin to fire which
> > looks like a hotplug event to the driver.
> 
> Any idea why this seems to only cause trouble with DC though?

DC handles both short and long pulses while I think the non-DC code only handles long pulses.  IIRC, the only difference is the length of the pulse and I think the register values used to determine the pulse length are tuned slightly differently in DC to deal with other problematic monitors.  I suspect tuning those settings would fix the issue, but I don't know if it would break other things.
Comment 11 Nathan Patera 2019-01-09 05:12:04 UTC
I have the same exact bug as a secondary confirmation of this bug. I am currently using kernel version 4.15.0-42-generic with an RX 580
Comment 12 Michel Dänzer 2019-01-09 09:32:43 UTC
(In reply to tme from comment #9)
> Setting amdgpu.dc=1 on 4.15.18 and 4.16.18 does not reproduce the problem.
> It does, however, reproduce on 4.17.19.

Can you bisect between 4.16.18 and 4.17.19?

(I see some HPD filtering related changes between them, Nicholas / Harry maybe you can take a look if anything jumps out?)
Comment 13 Nicholas Kazlauskas 2019-01-09 14:39:49 UTC
(In reply to Michel Dänzer from comment #12)
> (In reply to tme from comment #9)
> > Setting amdgpu.dc=1 on 4.15.18 and 4.16.18 does not reproduce the problem.
> > It does, however, reproduce on 4.17.19.
> 
> Can you bisect between 4.16.18 and 4.17.19?
> 
> (I see some HPD filtering related changes between them, Nicholas / Harry
> maybe you can take a look if anything jumps out?)

I haven't had a chance to look into the HPD changes yet, but we haven't seen this bug occur with our DPMS tests so I'm guessing that it's monitor specific. A system environment with Ubuntu/Plasma/xf86-video-amdgpu seems pretty standard at least.

A bisection point on amd-staging-drm-next would certainly help narrow this down.
Comment 14 krutoileshii 2019-01-19 05:52:37 UTC
I am actually experiencing simar issues. Two monitors using displayport to hdmi cable to connect Vega 64 to the monitors. No xorg logs as it's under Wayland but more than happy to test any suggestions. 

https://bbs.archlinux.org/viewtopic.php?id=243452
Comment 15 tme 2019-01-25 18:50:24 UTC
I've been attempting to perform a bisect on an off for a while now with no success. The main problem I'm running into is this error when trying to compile.

  RELOCS  arch/x86/boot/compressed/vmlinux.relocs
Unsupported relocation type: R_X86_64_PLT32 (4)
make[4]: *** [arch/x86/boot/compressed/Makefile:123: arch/x86/boot/compressed/vmlinux.relocs] Error 1
make[3]: *** [arch/x86/boot/Makefile:112: arch/x86/boot/compressed/vmlinux] Error 2
make[2]: *** [arch/x86/Makefile:299: bzImage] Error 2
make[1]: *** [scripts/package/Makefile:96: bindeb-pkg] Error 2
make: *** [Makefile:1386: bindeb-pkg] Error 2

I've tried searching for solutions for this problem, but I haven't found anything. It occurs when I run "make -j4 deb-pkg" and "make bzImage". If anyone can help me solve this, I'd be happy to start bisecting again.
Comment 16 krutoileshii 2019-02-18 01:56:40 UTC
Found a partial solution that seems to address the instant wake up under Wayland.

It seems that by default, the AOS2770SHE starts polling once display disconnects on one of its inputs. This seems to cause the actual system to wake up. However, this was not an issue before and used to function with no problems previously. It seems that something in amgdpu DC code changed that is picking up these polling requests.

To get the monitors to sleep properly, I did the following:

Set "Input Select":  Auto -> HDMI1
Set "DDC/CI": Yes -> No

Now the display sleeps as expected and wakes up with no issues. Still would like to know what changed to cause this to appear. I usually need to have the inputs set to Auto as I have a docking station plugged into the monitors for the work laptop.

Also amdgpu.dc=0 hands the system and it's only becomes accessable through ssh. However no errors are present in any logs. But I'll file a different bug once I nail it down to a specific component.
Comment 17 krutoileshii 2019-02-25 03:36:44 UTC
I think this could be related to this commit b0c4e977522c34e20ad54ff4ca104129a7cfdeca which removed the delay.: Below patchset seems to be the likely cause as it touches the HDMI portion.

https://lists.freedesktop.org/archives/amd-gfx/2018-February/018956.html
Comment 18 krutoileshii 2019-02-25 05:27:33 UTC
The function that sets the delay (dc_link_enable_hpd_filter), doesn't seem to be called anywhere as far as I can see. But I'm a complete noob here so might be missing something. (In reply to krutoileshii from comment #17)
> I think this could be related to this commit
> b0c4e977522c34e20ad54ff4ca104129a7cfdeca which removed the delay.: Below
> patchset seems to be the likely cause as it touches the HDMI portion.
> 
> https://lists.freedesktop.org/archives/amd-gfx/2018-February/018956.html
Comment 19 krutoileshii 2019-03-14 02:44:21 UTC
(In reply to tme from comment #15)
> I've been attempting to perform a bisect on an off for a while now with no
> success. The main problem I'm running into is this error when trying to
> compile.
> 
>   RELOCS  arch/x86/boot/compressed/vmlinux.relocs
> Unsupported relocation type: R_X86_64_PLT32 (4)
> make[4]: *** [arch/x86/boot/compressed/Makefile:123:
> arch/x86/boot/compressed/vmlinux.relocs] Error 1
> make[3]: *** [arch/x86/boot/Makefile:112: arch/x86/boot/compressed/vmlinux]
> Error 2
> make[2]: *** [arch/x86/Makefile:299: bzImage] Error 2
> make[1]: *** [scripts/package/Makefile:96: bindeb-pkg] Error 2
> make: *** [Makefile:1386: bindeb-pkg] Error 2
> 
> I've tried searching for solutions for this problem, but I haven't found
> anything. It occurs when I run "make -j4 deb-pkg" and "make bzImage". If
> anyone can help me solve this, I'd be happy to start bisecting again.

Any luck bisecting?
Comment 20 Utku Helvacı (tuxutku) 2019-03-25 20:38:05 UTC
(In reply to tme from comment #15)
> I've been attempting to perform a bisect on an off for a while now with no
> success. The main problem I'm running into is this error when trying to
> compile.
> 
>   RELOCS  arch/x86/boot/compressed/vmlinux.relocs
> Unsupported relocation type: R_X86_64_PLT32 (4)
> make[4]: *** [arch/x86/boot/compressed/Makefile:123:
> arch/x86/boot/compressed/vmlinux.relocs] Error 1
> make[3]: *** [arch/x86/boot/Makefile:112: arch/x86/boot/compressed/vmlinux]
> Error 2
> make[2]: *** [arch/x86/Makefile:299: bzImage] Error 2
> make[1]: *** [scripts/package/Makefile:96: bindeb-pkg] Error 2
> make: *** [Makefile:1386: bindeb-pkg] Error 2
> 
> I've tried searching for solutions for this problem, but I haven't found
> anything. It occurs when I run "make -j4 deb-pkg" and "make bzImage". If
> anyone can help me solve this, I'd be happy to start bisecting again.

Hey i am bisecting the same commits for another problem and i am getting the same error: https://bugzilla.kernel.org/show_bug.cgi?id=201077#c26
Comment 21 tme 2019-05-15 03:48:13 UTC
I've tried to revert commit b0c4e977522c34e20ad54ff4ca104129a7cfdeca but I haven't been able to successfully compile afterwards, running into the same issue as before. Setting it as the head still causes the bug to replicate when amdgpu.dc=1, however.
Comment 22 valentinesd 2019-07-09 04:14:34 UTC
This is happening to me as well.

RX570 w/ Acer H236HL Dual head, both inputs HDMI

I didn't have this issue with the same monitors and an nvidia card, so it seems specific to the amdgpu driver.

The monitors seem to lose signal (which is normal), then perform an auto input cycle which then wakes the monitors back up.  The backlight will come on and display the mouse cursor on a black screen.

I experience this with both Xorg and Wayland.

Unfortunately I can't disable auto input on my monitors, as the previous workaround suggests.  Just disabling DDC/CI didn't help.

Adding amdgpu.dc=0 to linux cmdline resolves the issue for me, but I'm concerned that may preclude my system from gaining newer features.
Comment 23 Tom reed 2019-08-05 19:00:34 UTC
Confirmed problem. Dual monitors prevent DPMS power off. 
Problem happens when triggered by screen off or manually with xset dpms force off.

GPU is Gigabyte RX580.
Ubuntu 18.04 LTS. Kernel 5.0.
Monitors are 2 Dell S2719dc. 

Problem occurs on xorg and on Wayland.
Problem occurs connected to HDMI and display port, and also with dual display port.

A workaround is to disable auto input switching on the monitors. This solves the problem.

Appears that when one monitor is switching inputs after turning off it wakes up the other monitor. A race condition between the two.
Comment 24 Michel Dänzer 2019-08-06 07:33:01 UTC
(In reply to Tom reed from comment #23)
> Appears that when one monitor is switching inputs after turning off it wakes
> up the other monitor. A race condition between the two.

The problem reported here happens even with only a single monitor connected via HDMI.
Comment 25 jigglywiggly 2019-08-14 08:58:46 UTC
Are any logs needed? I am using a rx570 on a LG 27UD59-B and it keeps waking itself up when it tries to sleep. amdgpu.dc=0 does fix it but then I get mouse lag when I move my mouse quickly for long strokes.

This bug I feel is very important, not having basic sleep functionality is really annoying. This did not happen to me when I used my nvidia 1060 3gb with the proprietary driver.
Comment 26 OlliC 2019-08-25 06:42:58 UTC
Same problem here. Just switched from a Nvidia GTX 1050Ti to Radeon RX 590 on Fedora 30 using standard Gnome Desktop. 

Using one Benq XL2430 via Displayport and one Benq BL2480T via HDMI.

Monitors won't go to sleep even after changing "Auto Input Switch" and "DDC/CI" off.
Comment 27 Michel Dänzer 2019-09-04 08:21:26 UTC
Disabling input probing in the monitor isn't a full workaround for me (with an HP EliteDisplay E242, in case it matters). The monitor stays off, but there's still a hotplug event, which requires me to re-arrange the windows of my GNOME session every time after unlocking it. So this is still kind of a DC showstopper for me.
Comment 28 Jean Delvare 2019-09-09 14:21:28 UTC
Same problem here. Radeon RX 550 with 2 identical Lenovo P27h-10 displays configured in side-by-side mode, one over DisplayPort and one over HDMI, kernel 5.2.11. When the displays go to sleep, the multi-display configuration is lost, displays are in mirror mode when waking up, and I must configure them again. Booting with amdgpu.dc=0 works around the problem (thanks Michel for the hint!)
Comment 29 Arianne Brink 2019-09-21 17:29:27 UTC
My Vega 56 is showing the same problems. However, I noticed that by disabling xfsettingsd in XFCE and kscreen in Plasma it solved the problem. It will suspend my monitors properly using dpms force off.  I3WM and other window managers don't show the same problem either, this seems to be related to desktop environments and the way they manage displays.
Comment 30 Michel Dänzer 2019-09-23 09:30:48 UTC
(In reply to Arianne Brink from comment #29)
> My Vega 56 is showing the same problems. However, I noticed that by
> disabling xfsettingsd in XFCE and kscreen in Plasma it solved the problem.

Disabling those probably just means nothing listens to the spurious hotplug events, thereby avoiding the problem. Just another workaround, not a proper solution.
Comment 31 Martin Peres 2019-11-19 09:10:09 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/drm/amd/issues/662.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.