[PATCH xf86-video-amdgpu] Handle CRTC DPMS from output DPMS hooks

2015-06-15 Thread Michel Dänzer
From: Michel Dänzer 

This fixes at least two issues:

The CRTC DPMS hook isn't called after a modeset, so the vertical blank
interrupt emulation code considered the CRTC disabled after a modeset. As
a side effect, page flipping was no longer used after a modeset.

This change also makes sure the vertical blank interrupt emulation code
runs before the hardware CRTC is disabled and after it's enabled from the
output DPMS hook. The wrong order could cause gnome-shell to hang after
a suspend/resume and/or DPMS off/on cycle.

(imported from commit c4ae0e2cbcc0e2ebf9f13ee92d59b5120254a1dc)

Signed-off-by: Michel Dänzer 
---
 src/drmmode_display.c | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 19f0f19..c418dfd 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -235,7 +235,8 @@ int drmmode_crtc_get_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, 
CARD64 *msc)
return Success;
 }
 
-static void drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)
+static void
+drmmode_do_crtc_dpms(xf86CrtcPtr crtc, int mode)
 {
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
ScrnInfoPtr scrn = crtc->scrn;
@@ -296,6 +297,12 @@ static void drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)
drmmode_crtc->dpms_mode = mode;
 }
 
+static void
+drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)
+{
+   /* Nothing to do. drmmode_do_crtc_dpms() is called as appropriate */
+}
+
 /* TODO: currently this function only clear the front buffer to zero */
 /* Moving forward, we might to look into making the copy with glamor instead */
 void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
@@ -959,9 +966,14 @@ static void drmmode_output_dpms(xf86OutputPtr output, int 
mode)
drmModeConnectorPtr koutput = drmmode_output->mode_output;
drmmode_ptr drmmode = drmmode_output->drmmode;
 
+   if (mode != DPMSModeOn && output->crtc)
+   drmmode_do_crtc_dpms(output->crtc, mode);
+
drmModeConnectorSetProperty(drmmode->fd, koutput->connector_id,
drmmode_output->dpms_enum_id, mode);
-   return;
+
+   if (mode == DPMSModeOn && output->crtc)
+   drmmode_do_crtc_dpms(output->crtc, mode);
 }
 
 static Bool drmmode_property_ignore(drmModePropertyPtr prop)
@@ -1681,6 +1693,7 @@ Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, 
drmmode_ptr drmmode)
 
/* Skip disabled CRTCs */
if (!crtc->enabled) {
+   drmmode_do_crtc_dpms(crtc, DPMSModeOff);
drmModeSetCrtc(drmmode->fd,
   drmmode_crtc->mode_crtc->crtc_id, 0, 0,
   0, NULL, 0, NULL);
-- 
2.1.4

___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


[Bug 90987] xorg black screen after monitor power off, AMD r9 270X, aoc u2868pqu, displayport

2015-06-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=90987

--- Comment #1 from Sanjeev Kumar Sharma  ---
sigh ... don't know how this got fouled up - this sentence 

the only difference with this kernel command option (radeon.dpm=0) is that the
messages do not appear; the symptoms stay - the black xorg TTY, killing X from
another TTY.  



should be attached to this section: 

when this started one thing I tried was changing the kernel command line

GRUB_CMDLINE_LINUX_DEFAULT=" md_mod.start_ro=1 radeon.audio=1 radeon.dpm=0 "

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


[Bug 90987] New: xorg black screen after monitor power off, AMD r9 270X, aoc u2868pqu, displayport

2015-06-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=90987

Bug ID: 90987
   Summary: xorg black screen after monitor power off, AMD r9
270X, aoc u2868pqu, displayport
   Product: xorg
   Version: unspecified
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: Driver/Radeon
  Assignee: xorg-driver-ati@lists.x.org
  Reporter: spm...@hotmail.com
QA Contact: xorg-t...@lists.x.org

xorg black screen after monitor power off, AMD r9 270X, aoc u2868pqu,
displayport


please let me know how I might gather better info

when the monitor goes into power save mode or I power it off manually for a few
minutes xorg goes completely black.

I can switch to other TTYs; can even start a second xorg from there

When I try to switch back to the original TTY that xorg's still black.



these messages show up on the second TTY
[34181.758006] [drm:si_dpm_set_power_state [radeon]] *ERROR*
si_restrict_performance_levels_before_switch failed
[34181.835519] [drm:radeon_dp_link_train [radeon]] *ERROR* displayport link
status failed
[34181.835526] [drm:radeon_dp_link_train [radeon]] *ERROR* clock recovery
failed
[34181.838937] [drm:radeon_dp_link_train [radeon]] *ERROR* displayport link
status failed
[34181.838942] [drm:radeon_dp_link_train [radeon]] *ERROR* clock recovery
failed

nothing looks relevant to that error in
~/.local/share/xorg/*

these messages also show up if I turn off the monitor when positioned on a
console, but the console is still accessible on monitor power up.

none of these show up if I turn off the monitor when positioned on a KMScon,
and the KMScon is still accessible on monitor power up.


here's my kerrel info:

Linux samain 4.0.4-2-ARCH #1 SMP PREEMPT Fri May 22 03:05:23 UTC 2015 x86_64
GNU/Linux


when this started one thing I tried was changing the kernel command line

GRUB_CMDLINE_LINUX_DEFAULT=" md_mod.start_ro=1 radeon.audio=1 radeon.dpm=0 "



[drm:radeon_dp_link_train [radeon]] *ERROR* displayport link status failed
[drm:radeon_dp_link_train [radeon]] *ERROR* clock recovery failed
[drm:si_dpm_set_power_state [radeon]] *ERROR* si_set_sw_state failed


[drm:si_dpm_set_power_state [radeon]] *ERROR* si_set_sw_state failed
[drm:si_dpm_set_power_state [radeon]] *ERROR* si_set_sw_state failed
[drm:si_dpm_set_power_state [radeon]] *ERROR* si_set_sw_state failed
[drm:si_dpm_set_power_state [radeon]] *ERROR*
si_restrict_performance_levels_before_switch failed



the latest time it hapened, in  
~/.local/share/xorg/Xorg.2.log

X.Org X Server 1.17.1
Release Date: 2015-02-10
[ 15315.604] X Protocol Version 11, Revision 0
[ 15315.607] Build Operating System: Linux 3.19.2-1-ARCH x86_64 
[ 15315.610] Current Operating System: Linux samain 4.0.5-1-ARCH #1 SMP PREEMPT
Sat Jun 6 18:37:49 CEST 2015 x86_64
[ 15315.610] Kernel command line: BOOT_IMAGE=/vmlinuz-linux
root=UUID=9f8d87ed-2c99-41ca-aaab-149ce173f148 rw md_mod.start_ro=1
radeon.audio=1
[ 15315.617] Build Date: 14 April 2015  10:34:18AM
[ 15315.620]  
[ 15315.623] Current version of pixman: 0.32.6



...

[ 15264.572] (II) Module ABI versions:
[ 15264.572] X.Org ANSI C Emulation: 0.4
[ 15264.572] X.Org Video Driver: 19.0
[ 15264.572] X.Org XInput driver : 21.0
[ 15264.572] X.Org Server Extension : 9.0
[ 15264.574] (II) systemd-logind: took control of session
/org/freedesktop/login1/session/c3
[ 15264.575] (II) xfree86: Adding drm device (/dev/dri/card0)
[ 15264.575] (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 8 paused 0
[ 15264.578] (--) PCI:*(0:1:0:0) 1002:6810:174b:e271 rev 0, Mem @
0xd000/268435456, 0xfbe0/262144, I/O @ 0xe000/256, BIOS @
0x/131072
[ 15264.578] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or
directory)
[ 15264.578] (II) LoadModule: "glx"
[ 15264.578] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[ 15264.581] (II) Module glx: vendor="X.Org Foundation"
[ 15264.581] compiled for 1.17.1, module version = 1.0.0
[ 15264.581] ABI class: X.Org Server Extension, version 9.0
[ 15264.581] (==) AIGLX enabled
[ 15264.581] (==) Matched ati as autoconfigured driver 0
[ 15264.581] (==) Matched ati as autoconfigured driver 1
[ 15264.581] (==) Matched modesetting as autoconfigured driver 2
[ 15264.581] (==) Matched fbdev as autoconfigured driver 3
[ 15264.581] (==) Matched vesa as autoconfigured driver 4
[ 15264.581] (==) Assigned the driver to the xf86ConfigLayout
[ 15264.581] (II) LoadModule: "ati"
[ 15264.581] (II) Loading /usr/lib/xorg/modules/drivers/ati_drv.so
[ 15264.581] (II) Module ati: vendor="X.Org Foundation"
[ 15264.581] compiled for 1.17.0, module version = 7.5.0
[ 15264.581] Module class: X.Org Video Driver
[ 15264.581] ABI class: X.Org Video Driver, version 19.0
[ 15264.581] (II) LoadModule: "radeon"
[ 15264.581] (II) Loading /usr/lib/xorg/modules/drivers/radeon_drv.so
[ 

[Bug 90099] One pixel high lines appearing all over the place on RS780

2015-06-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=90099

--- Comment #6 from Michel Dänzer  ---
(In reply to Juraj Fiala from comment #5)
> Should I also report this on the kernel bugtracker?

No, we can actually track kernel driver bugs better here as well.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


[Bug 90099] One pixel high lines appearing all over the place on RS780

2015-06-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=90099

--- Comment #5 from Juraj Fiala  ---
Should I also report this on the kernel bugtracker?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati