xserver-multidpi/hw/xfree86
Peter Hutterer faca1bc582 xfree86: belately init RandR12 if xinerama fails. (#24627)
On Fri, Dec 11, 2009 at 10:19:01AM -0800, Keith Packard wrote:
> On Wed, 9 Dec 2009 11:55:14 +1000, Peter Hutterer <peter.hutterer@who-t.net> wrote:
> > On Tue, Dec 08, 2009 at 05:24:06PM -0800, Aaron Plattner wrote:
> > > On Tue, Dec 08, 2009 at 03:52:27PM -0800, Peter Hutterer wrote:
> > > > Xorg +xinerama crashes immediately due to whacky dependency between Xinerama
> > > > and RandR12. The latter doesn't initialize if Xinerama is enabled, but if
> > > > only one screen is found, Xinerama is disabled again and RandR12 tries to
> > > > access data it never initialized.
>
> I'd sure like to have RandR get enabled when xinerama doesn't; is there
> an easy way of making that happen here? Perhaps having the RandR12 code
> disable Xinerama when only one screen is found? Or some other kludge?

you know the dependency better than I do so any hints are apreciated.
afaict, the screenInfo.numScreens (the check used by Xinerama) isn't
necessarily initialized at this point so we can't use the same check.
The following seems to work though:

From 670b3ebdb7312a6433a8f093d0820785db2aea20 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Mon, 14 Dec 2009 11:00:58 +1000
Subject: [PATCH] xfree86: if only one screen was found, disable Xinerama (#24627)

Xorg +xinerama crashes immediately due to whacky dependency between Xinerama
and RandR12. The latter doesn't initialize if Xinerama is enabled, but if
only one screen is found, Xinerama is disabled again and RandR12 tries to
access data it never initialized.

Dependency chain is:
- ProcessCommandLine sets noPanoramiXExtension to FALSE
- xf86RandR12Init() is a noop
- PanoramiXExtensionInit sets noPanoramiXExtension to TRUE
- xf86RandR12CreateScreenResources tries to use the devPrivates key it never
  initialized.

This hack checks if there's only one screen at the time RandR12 is
initialized. If so, we expect Xinerama to fail anyhow so we disable it
ourselves and proceed as planned.

X.Org Bug 24627 <http://bugs.freedesktop.org/show_bug.cgi?id=24627>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-16 21:50:00 -08:00
..
common xfree86: fix -quiet option behaviour 2009-12-16 21:49:31 -08:00
ddc EDID: CEA extension support 2009-10-29 14:04:55 -04:00
dixmods input: define server-supported protocol versions in one single file. 2009-09-21 21:47:35 +10:00
doc Update man-pages for new default font paths 2009-11-25 13:34:36 -08:00
dri Cast small-int values through intptr_t when passed as pointers 2009-10-08 13:38:44 +11:00
dri2 DRI2: Report the correct extension minor version 2009-10-23 10:04:57 +09:00
exa .gitignore: use common defaults with custom section #24239 2009-11-11 21:40:20 -08:00
fbdevhw .gitignore: use common defaults with custom section #24239 2009-11-11 21:40:20 -08:00
i2c Don't cast double to int: use default conversions or explicitly round. 2009-10-28 18:56:42 -07:00
int10 xfree86: removal of some dead code due VGA arbiter's inclusion 2009-08-31 19:25:48 +03:00
loader .gitignore: use common defaults with custom section #24239 2009-11-11 21:40:20 -08:00
modes xfree86: belately init RandR12 if xinerama fails. (#24627) 2009-12-16 21:50:00 -08:00
os-support Use glibc's in/out routines 2009-11-16 20:17:29 -08:00
parser Don't cast double to int: use default conversions or explicitly round. 2009-10-28 18:56:42 -07:00
ramdac .gitignore: use common defaults with custom section #24239 2009-11-11 21:40:20 -08:00
shadowfb s/MIN/min/, s/MAX/max/ (#2968) 2009-06-03 13:45:42 -04:00
utils .gitignore: use common defaults with custom section #24239 2009-11-11 21:40:20 -08:00
vbe Update to xextproto 7.0.99.1. 2009-07-15 17:00:05 +10:00
vgahw Revert "alpha: kill xf86SlowBCopyToBus and xf86SlowBCopyFromBus" 2009-10-06 20:40:20 -04:00
x86emu Make sys.c use unaligned access functions provided in compiler. 2009-11-01 12:33:14 -08:00
xaa .gitignore: use common defaults with custom section #24239 2009-11-11 21:40:20 -08:00
xf8_16bpp Update several of my and/or Red Hat's licenses to standard form. 2009-05-14 07:02:44 -04:00
.gitignore .gitignore: use common defaults with custom section #24239 2009-11-11 21:40:20 -08:00
Makefile.am Use $(MAKE) instead of "make" to build Solaris inline assembly 2009-11-05 13:31:16 -08:00
xorgconf.cpp Update xorg.conf man page & sample for changes in Xorg 1.7 2009-09-14 16:03:18 +10:00