Bug#827984: assertion failure with multiple GPUs and Xinerama enabled

2016-06-26 Thread Michel Dänzer
On 24.06.2016 23:16, Christopher Cramer wrote:
> On Fri, Jun 24, 2016 at 11:15:05AM +0900, Michel Dänzer wrote:
>> Does the attached patch fix this?
> 
> Well, it doesn't die with an assertion failure anymore.

Thanks for testing the fix, submitting it for upstream inclusion.


> But the behavior is not what I would expect - the screens are all
> mirrored. Maybe that is a separate issue, though.

That's expected with the Section "ServerLayout" in the
/etc/X11/xorg.conf file included in the bug report. See the xorg.conf
manpage chapter about the ServerLayout section for how to position screens.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer



Bug#827984: assertion failure with multiple GPUs and Xinerama enabled

2016-06-24 Thread Christopher Cramer
On Fri, Jun 24, 2016 at 11:15:05AM +0900, Michel Dänzer wrote:
> Does the attached patch fix this?

Well, it doesn't die with an assertion failure anymore.

But the behavior is not what I would expect - the screens are all
mirrored. Maybe that is a separate issue, though.



Bug#827984: assertion failure with multiple GPUs and Xinerama enabled

2016-06-23 Thread Michel Dänzer
On 23.06.2016 22:32, Christopher Cramer wrote:
> Package: xserver-xorg-video-radeon
> Version: 1:7.7.0-1
> Severity: normal
> 
> I have a FirePro 2450, which is a single card that has two GPUs and shows up
> as two separate PCI devices, with two DVI outputs per GPU.
> 
> Xinerama seems to be unofficially deprecated these days, but anyway the X
> server dies on assertion failure when Xinerama is enabled with multiple
> GPUs.

[...]

> Program terminated with signal SIGABRT, Aborted.
> #0  0x7fa75f914458 in __GI_raise (sig=sig@entry=6) at 
> ../sysdeps/unix/sysv/linux/raise.c:55
> [Current thread is 1 (Thread 0x7fa761b7fa00 (LWP 4230))]
> #0  0x7fa75f914458 in __GI_raise (sig=sig@entry=6) at 
> ../sysdeps/unix/sysv/linux/raise.c:55
> #1  0x7fa75f9158da in __GI_abort () at abort.c:89
> #2  0x7fa75f90d387 in __assert_fail_base (fmt=, 
> assertion=assertion@entry=0x7fa75b3ec350 "key->initialized", 
> file=file@entry=0x7fa75b3ec324 "/usr/include/xorg/privates.h", 
> line=line@entry=122, 
> function=function@entry=0x7fa75b3edf40 <__PRETTY_FUNCTION__.10025> 
> "dixGetPrivateAddr") at assert.c:92
> #3  0x7fa75f90d432 in __GI___assert_fail 
> (assertion=assertion@entry=0x7fa75b3ec350 "key->initialized", 
> file=file@entry=0x7fa75b3ec324 "/usr/include/xorg/privates.h", 
> line=line@entry=122, 
> function=function@entry=0x7fa75b3edf40 <__PRETTY_FUNCTION__.10025> 
> "dixGetPrivateAddr") at assert.c:101
> #4  0x7fa75b39c74d in dixGetPrivateAddr (key=, 
> key=, privates=0x563fb3b312c8) at 
> /usr/include/xorg/privates.h:122
> #5  0x7fa75b3d7435 in dixGetPrivateAddr (key=, 
> key=, privates=) at ../../src/radeon_kms.c:295
> #6  dixLookupPrivate (key=, privates=) at 
> /usr/include/xorg/privates.h:165
> #7  RADEONCreateScreenResources_KMS (pScreen=0x563fb3b30ef0) at 
> ../../src/radeon_kms.c:244
> #8  0x563fb2ce473e in xf86CrtcCreateScreenResources 
> (screen=0x563fb3b30ef0) at ../../../../hw/xfree86/modes/xf86Crtc.c:716
> #9  0x563fb2c75abe in dix_main (argc=7, argv=0x7ffd5dd6af98, 
> envp=) at ../../dix/main.c:225
> #10 0x7fa75f9015f0 in __libc_start_main (main=0x563fb2c5ff60 , 
> argc=7, argv=0x7ffd5dd6af98, init=, fini=, 
> rtld_fini=, stack_end=0x7ffd5dd6af88) at libc-start.c:291
> #11 0x563fb2c5ff99 in _start ()

Does the attached patch fix this?


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
From f9cea23e1d06d1cd4c6b72400fd0f5ea5eb76d0a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= 
Date: Fri, 24 Jun 2016 11:12:49 +0900
Subject: [PATCH xf86-video-ati] Only use rrGetScrPriv if RandR is enabled
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/drmmode_display.c |  2 +-
 src/radeon_kms.c  | 21 -
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index b5d3dc9..2555465 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2613,7 +2613,7 @@ restart_destroy:
 			changed = TRUE;
 	}
 
-	if (changed) {
+	if (changed && dixPrivateKeyRegistered(rrPrivKey)) {
 #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,14,99,2,0)
 		RRSetChanged(xf86ScrnToScreen(scrn));
 #else
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 940aad2..41ee597 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -241,7 +241,6 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr pScreen)
 {
 ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 RADEONInfoPtr  info   = RADEONPTR(pScrn);
-rrScrPrivPtr rrScrPriv = rrGetScrPriv(pScreen);
 PixmapPtr pixmap;
 struct radeon_surface *surface;
 
@@ -251,17 +250,21 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr pScreen)
 pScreen->CreateScreenResources = RADEONCreateScreenResources_KMS;
 
 /* Set the RandR primary output if Xorg hasn't */
-if (
+if (dixPrivateKeyRegistered(rrPrivKey)) {
+	rrScrPrivPtr rrScrPriv = rrGetScrPriv(pScreen);
+
+	if (
 #ifdef RADEON_PIXMAP_SHARING
-	!pScreen->isGPU &&
+	!pScreen->isGPU &&
 #endif
-	!rrScrPriv->primaryOutput)
-{
-	xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+	!rrScrPriv->primaryOutput)
+	{
+	xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
 
-	rrScrPriv->primaryOutput = xf86_config->output[0]->randr_output;
-	RROutputChanged(rrScrPriv->primaryOutput, FALSE);
-	rrScrPriv->layoutChanged = TRUE;
+	rrScrPriv->primaryOutput = xf86_config->output[0]->randr_output;
+	RROutputChanged(rrScrPriv->primaryOutput, FALSE);
+	rrScrPriv->layoutChanged = TRUE;
+	}
 }
 
 if (!drmmode_set_desired_modes(pScrn, >drmmode, FALSE))
-- 
2.8.1



Bug#827984: assertion failure with multiple GPUs and Xinerama enabled

2016-06-23 Thread Christopher Cramer
Package: xserver-xorg-video-radeon
Version: 1:7.7.0-1
Severity: normal

I have a FirePro 2450, which is a single card that has two GPUs and shows up
as two separate PCI devices, with two DVI outputs per GPU.

Xinerama seems to be unofficially deprecated these days, but anyway the X
server dies on assertion failure when Xinerama is enabled with multiple
GPUs.

I have Xinerama commented out in xorg.conf below, but the failure only
occurs when that line is uncommented. The second Device section is
commented out because I only actually have three monitors.

I would be very happy to gather any further information, or test anything.

The PCI listing below is missing the second device (as it is not 
"VGA-compatible"):
04:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] RV620 
[FirePro 2450]

This is the output of startx:

X.Org X Server 1.18.3
Release Date: 2016-04-04
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.16.0-4-amd64 x86_64 Debian
Current Operating System: Linux chiba 4.6.0-1-amd64 #1 SMP Debian 4.6.2-1 
(2016-06-15) x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.6.0-1-amd64 
root=UUID=157516c6-17ed-42eb-9339-774d57b22ad3 ro quiet
Build Date: 05 April 2016  07:00:43AM
xorg-server 2:1.18.3-1 (http://www.debian.org/support) 
Current version of pixman: 0.33.6
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/home/tsuyoshi/.local/share/xorg/Xorg.1.log", Time: Wed Jun 22 
17:56:01 2016
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(II) [KMS] Kernel modesetting enabled.
(II) [KMS] Kernel modesetting enabled.
(II) [KMS] Kernel modesetting enabled.
Xorg: /usr/include/xorg/privates.h:122: dixGetPrivateAddr: Assertion 
`key->initialized' failed.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

Here is a backtrace:

Reading symbols from /usr/lib/xorg/Xorg...Reading symbols from 
/usr/lib/debug/.build-id/4c/eb67899a8a459f80a13558c62ec29727d131b5.debug...done.
done.
[New LWP 4230]
[New LWP 4231]
[New LWP 4232]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/lib/xorg/Xorg :0 -core vt1 -keeptty -auth 
/tmp/serverauth.YVMB8aqSkm'.
Program terminated with signal SIGABRT, Aborted.
#0  0x7fa75f914458 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/unix/sysv/linux/raise.c:55
[Current thread is 1 (Thread 0x7fa761b7fa00 (LWP 4230))]
#0  0x7fa75f914458 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/unix/sysv/linux/raise.c:55
#1  0x7fa75f9158da in __GI_abort () at abort.c:89
#2  0x7fa75f90d387 in __assert_fail_base (fmt=, 
assertion=assertion@entry=0x7fa75b3ec350 "key->initialized", 
file=file@entry=0x7fa75b3ec324 "/usr/include/xorg/privates.h", 
line=line@entry=122, 
function=function@entry=0x7fa75b3edf40 <__PRETTY_FUNCTION__.10025> 
"dixGetPrivateAddr") at assert.c:92
#3  0x7fa75f90d432 in __GI___assert_fail 
(assertion=assertion@entry=0x7fa75b3ec350 "key->initialized", 
file=file@entry=0x7fa75b3ec324 "/usr/include/xorg/privates.h", 
line=line@entry=122, 
function=function@entry=0x7fa75b3edf40 <__PRETTY_FUNCTION__.10025> 
"dixGetPrivateAddr") at assert.c:101
#4  0x7fa75b39c74d in dixGetPrivateAddr (key=, 
key=, privates=0x563fb3b312c8) at 
/usr/include/xorg/privates.h:122
#5  0x7fa75b3d7435 in dixGetPrivateAddr (key=, 
key=, privates=) at ../../src/radeon_kms.c:295
#6  dixLookupPrivate (key=, privates=) at 
/usr/include/xorg/privates.h:165
#7  RADEONCreateScreenResources_KMS (pScreen=0x563fb3b30ef0) at 
../../src/radeon_kms.c:244
#8  0x563fb2ce473e in xf86CrtcCreateScreenResources (screen=0x563fb3b30ef0) 
at ../../../../hw/xfree86/modes/xf86Crtc.c:716
#9  0x563fb2c75abe in dix_main (argc=7, argv=0x7ffd5dd6af98, 
envp=) at ../../dix/main.c:225
#10 0x7fa75f9015f0 in __libc_start_main (main=0x563fb2c5ff60 , 
argc=7, argv=0x7ffd5dd6af98, init=, fini=, 
rtld_fini=, stack_end=0x7ffd5dd6af88) at libc-start.c:291
#11 0x563fb2c5ff99 in _start ()

-- Package-specific info:
X server symlink status:

lrwxrwxrwx 1 root root 13 Jun 16 14:03 /etc/X11/X -> /usr/bin/Xorg
-rwxr-xr-x 1 root root 274 Apr  5 03:05 /usr/bin/Xorg

VGA-compatible devices on PCI bus:
--
03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. 
[AMD/ATI] RV620 [FirePro 2450] [1002:95cd]

Xorg X server configuration file status:

-rw-r--r-- 1 root root 829 Jun 22 22:16 /etc/X11/xorg.conf

Contents of /etc/X11/xorg.conf:
---
Section "ServerFlags"
#