[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'upstream-experimental'



 .gitignore                              |    3 
 GL/glx/Makefile.am                      |    2 
 GL/glx/glxcmds.c                        |   58 ++--
 GL/glx/glxcontext.h                     |    6 
 GL/glx/glxdrawable.h                    |    2 
 GL/glx/glxdri.c                         |  259 +++++++++----------
 GL/glx/glxdri2.c                        |  423 +++++++++++++++++++++-----------
 GL/glx/glxglcore.c                      |   55 ++--
 GL/glx/glxscreens.c                     |   66 +++-
 GL/glx/glxscreens.h                     |   88 ++++++
 GL/glx/glxutil.c                        |   63 ++--
 GL/glx/glxutil.h                        |    2 
 GL/symlink-mesa.sh                      |    2 
 Makefile.am                             |    6 
 Xext/dpms.c                             |    7 
 Xext/panoramiX.c                        |   33 +-
 Xext/panoramiXsrv.h                     |   10 
 Xext/xevie.c                            |  122 +++++----
 Xext/xres.c                             |    2 
 Xext/xselinux.c                         |   64 ++++
 Xext/xselinux.h                         |    1 
 composite/compwindow.c                  |    4 
 config/hal.c                            |    8 
 configure.ac                            |   47 ++-
 dix/devices.c                           |    4 
 dix/getevents.c                         |    2 
 exa/exa.c                               |   53 ++--
 exa/exa.h                               |    2 
 exa/exa_offscreen.c                     |  132 +++++----
 exa/exa_priv.h                          |    1 
 exa/exa_render.c                        |   13 
 fb/fb.h                                 |    2 
 hw/kdrive/ephyr/Makefile.am             |    1 
 hw/kdrive/ephyr/XF86dri.c               |   37 ++
 hw/kdrive/ephyr/ephyr.c                 |   34 ++
 hw/kdrive/ephyr/ephyr.h                 |    1 
 hw/kdrive/ephyr/ephyrinit.c             |   19 +
 hw/kdrive/ephyr/hostx.c                 |   31 ++
 hw/kdrive/ephyr/hostx.h                 |    4 
 hw/kdrive/src/kdrive.c                  |    6 
 hw/xfree86/common/compiler.h            |    2 
 hw/xfree86/common/xf86.h                |    1 
 hw/xfree86/common/xf86AutoConfig.c      |   13 
 hw/xfree86/common/xf86Config.c          |   40 ++-
 hw/xfree86/common/xf86Privstr.h         |    3 
 hw/xfree86/common/xf86Xinput.c          |   12 
 hw/xfree86/dixmods/Makefile.am          |    6 
 hw/xfree86/dixmods/extmod/modinit.c     |   23 +
 hw/xfree86/dri/Makefile.am              |    2 
 hw/xfree86/dri2/Makefile.am             |    5 
 hw/xfree86/dri2/dri2.c                  |  107 +++++---
 hw/xfree86/dri2/dri2.h                  |   16 -
 hw/xfree86/dri2/dri2ext.c               |  361 +++++++++++++++++++++++++++
 hw/xfree86/exa/examodule.c              |   13 
 hw/xfree86/fbdevhw/fbdevhw.c            |    4 
 hw/xfree86/int10/helper_exec.c          |    2 
 hw/xfree86/loader/dixsym.c              |    3 
 hw/xfree86/loader/loader.c              |    2 
 hw/xfree86/loader/xf86sym.c             |    2 
 hw/xfree86/modes/xf86Crtc.c             |  276 +++++++++++++++-----
 hw/xfree86/modes/xf86Cursors.c          |    3 
 hw/xfree86/modes/xf86EdidModes.c        |   25 +
 hw/xfree86/modes/xf86Modes.c            |   22 +
 hw/xfree86/modes/xf86Modes.h            |    3 
 hw/xfree86/modes/xf86RandR12.c          |    7 
 hw/xfree86/os-support/bsd/bsdResource.c |    2 
 hw/xfree86/os-support/bsd/i386_video.c  |   10 
 hw/xfree86/os-support/bus/Pci.h         |    2 
 hw/xfree86/utils/xorgcfg/loadmod.c      |    4 
 hw/xfree86/x86emu/prim_ops.c            |    2 
 hw/xfree86/x86emu/x86emu/prim_x86_gcc.h |    2 
 hw/xfree86/x86emu/x86emu/types.h        |    2 
 hw/xfree86/xaa/xaaInit.c                |    4 
 hw/xfree86/xaa/xaaInitAccel.c           |   57 ++--
 hw/xfree86/xaa/xaaPict.c                |  144 ----------
 hw/xprint/ps/psout.h                    |    2 
 include/globals.h                       |   10 
 include/servermd.h                      |    2 
 include/xkbsrv.h                        |   16 -
 include/xorg-config.h.in                |    3 
 mi/micoord.h                            |    2 
 mi/miinitext.c                          |    8 
 mi/mivaltree.c                          |    4 
 os/WaitFor.c                            |    6 
 os/utils.c                              |    7 
 xkb/ddxLoad.c                           |   54 ++--
 xkb/xkbActions.c                        |    9 
 xkb/xkbUtils.c                          |    8 
 88 files changed, 2030 insertions(+), 958 deletions(-)

New commits:
commit 9211a10b981008fb96f09d6933345e41a0872f2a
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed May 21 17:52:23 2008 -0400

    xserver 1.4.99.902

diff --git a/configure.ac b/configure.ac
index 4d841f6..07df3db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.4.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+AC_INIT([xorg-server], 1.4.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE

commit b69c74d14b7a777ae02aee0a8ff81efbff8cca6e
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Tue May 20 12:39:28 2008 -0700

    Short-circuit PanoramiXTranslateVisualID after verifying that the visual actually exists first.
    
    This allows using PanoramiXTranslateVisualID to test whether a given visual made
    it through PanoramiXVisualConsolidate.
    (cherry picked from commit 8b3d26f5b6caff1766669deb0e2100d2dee3f185)

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index eb70689..2792dc7 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -850,10 +850,6 @@ PanoramiXTranslateVisualID(int screen, VisualID orig)
     VisualPtr pVisual = NULL;
     int i;
 
-    /* if screen is 0, orig is already the correct visual ID */
-    if (screen == 0)
-	return orig;
-
     for (i = 0; i < PanoramiXNumVisuals; i++) {
 	if (orig == PanoramiXVisuals[i].vid) {
 	    pVisual = &PanoramiXVisuals[i];
@@ -864,6 +860,10 @@ PanoramiXTranslateVisualID(int screen, VisualID orig)
     if (!pVisual)
 	return 0;
 
+    /* if screen is 0, orig is already the correct visual ID */
+    if (screen == 0)
+	return orig;
+
     /* found the original, now translate it relative to the backend screen */
     for (i = 0; i < pOtherScreen->numVisuals; i++) {
 	VisualPtr pOtherVisual = &pOtherScreen->visuals[i];

commit 5efe36f7afde8b5bf4e853dd1dde2a6a027d613b
Author: Adam Jackson <ajax@redhat.com>
Date:   Mon May 19 11:22:19 2008 -0400

    Fix reduced-blanking mode filtering in RANDR 1.2.
    
    If the monitor isn't reduced-blanking (either through EDID logic, or
    config file setting), then remove RB modes from the default pool.  Any
    RB modes from the driver and config file pools will stick around though;
    you asked for them, you got them.
    (cherry picked from commit 0178b6a4abed0df3e90ba393709ed566105e7c2c)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index e857b07..855d646 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1475,7 +1475,14 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
 	}
 	default_modes = xf86GetDefaultModes (output->interlaceAllowed,
 					     output->doubleScanAllowed);
-	
+
+	/*
+	 * If this is not an RB monitor, remove RB modes from the default
+	 * pool.  RB modes from the config or the monitor itself are fine.
+	 */
+	if (!mon_rec.reducedblanking)
+	    xf86ValidateModesReducedBlanking (scrn, default_modes);
+
 	if (sync_source == sync_config)
 	{
 	    /* 
diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c
index a07eba9..ea398ad 100644
--- a/hw/xfree86/modes/xf86Modes.c
+++ b/hw/xfree86/modes/xf86Modes.c
@@ -514,6 +514,28 @@ xf86ValidateModesBandwidth(ScrnInfoPtr pScrn, DisplayModePtr modeList,
 }
 
 /**
+ * Marks as bad any reduced-blanking modes.
+ *
+ * \param modeList doubly-linked list of modes.
+ */
+_X_EXPORT void
+xf86ValidateModesReducedBlanking(ScrnInfoPtr pScrn, DisplayModePtr modeList)
+{
+    Bool mode_is_reduced = FALSE;
+    DisplayModePtr mode;
+
+    for (mode = modeList; mode != NULL; mode = mode->next) {
+	/* gratuitous duplication from pre-randr validation code */
+	if ((((mode->HDisplay * 5 / 4) & ~0x07) > mode->HTotal) &&
+	    ((mode->HTotal - mode->HDisplay) == 160) &&
+	    ((mode->HSyncEnd - mode->HDisplay) == 80) &&
+	    ((mode->HSyncEnd - mode->HSyncStart) == 32) &&
+	    ((mode->VSyncStart - mode->VDisplay) == 3))
+	    mode->status = MODE_NO_REDUCED;
+    }
+}
+
+/**
  * Frees any modes from the list with a status other than MODE_OK.
  *
  * \param modeList pointer to a doubly-linked or circular list of modes.
diff --git a/hw/xfree86/modes/xf86Modes.h b/hw/xfree86/modes/xf86Modes.h
index 5d49c93..acdea65 100644
--- a/hw/xfree86/modes/xf86Modes.h
+++ b/hw/xfree86/modes/xf86Modes.h
@@ -85,6 +85,9 @@ xf86ValidateModesBandwidth(ScrnInfoPtr pScrn, DisplayModePtr modeList,
 			   unsigned int bandwidth, int depth);
 
 void
+xf86ValidateModesReducedBlanking(ScrnInfoPtr pScrn, DisplayModePtr modeList);
+
+void
 xf86PruneInvalidModes(ScrnInfoPtr pScrn, DisplayModePtr *modeList,
 		      Bool verbose);
 

commit e644d2e73f72e7a3e1a9525bdde0de2012efec59
Author: James Cloos <cloos@jhcloos.com>
Date:   Mon May 12 03:03:13 2008 -0400

    Prevent the -wm command line option from causing a SEGV
    
    The -wm (when mapped) option for the BackingStore support has been
    causing the server to dereference a NULL pointer.
    
    This has probably been the case since backing store has been
    implemented on top of Composite.
    
    It looks like (some of?) Composite didn’t expect its WIndowPtr
    argument to be the root window.
    
    In Composite’s compCheckRedirect() function we now avoid calling
    compAllocPixmap() and compFreePixmap() when the pWin pointer’s
    parent member is NULL, as is it the case with a server’s root window.
    
    This addresses:
    
    https://bugs.freedesktop.org/show_bug.cgi?id=15878
    
    (cherry picked from commit 04211c3532ca078420e3745a5eac3d9de120bc32)

diff --git a/composite/compwindow.c b/composite/compwindow.c
index c022027..05dc055 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -146,8 +146,8 @@ compCheckRedirect (WindowPtr pWin)
     Bool	    should;
 
     should = pWin->realized && (pWin->drawable.class != InputOnly) &&
-	     (cw != NULL);
-    
+	     (cw != NULL) && (pWin->parent != NULL);
+
     /* Never redirect the overlay window */
     if (cs->pOverlayWin != NULL) {
 	if (pWin == cs->pOverlayWin) {

commit 0230f39fa3b3076b7694b6443a7a3ad8f63f7b55
Author: Adam Jackson <ajax@redhat.com>
Date:   Fri May 16 10:52:41 2008 -0400

    RANDR 1.1 compat: remove senseless comparison against the virtual size.
    (cherry picked from commit aad1c37b0951eae216ac323c5d8bfc6fbcf096bd)

diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 14c2d41..6f8ccdf 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -119,9 +119,7 @@ xf86RandR12GetInfo (ScreenPtr pScreen, Rotation *rotations)
 	    return FALSE;
 	RRRegisterRate (pScreen, pSize, refresh);
 
-	if (xf86ModesEqual(mode, scrp->currentMode) &&
-	    mode->HDisplay == scrp->virtualX &&
-	    mode->VDisplay == scrp->virtualY)
+	if (xf86ModesEqual(mode, scrp->currentMode))
 	{
 	    RRSetCurrentConfig (pScreen, randrp->rotation, refresh, pSize);
 	}

commit 95985256efa7e86cefe4b1541780eda12c0c8f89
Author: Adam Jackson <ajax@redhat.com>
Date:   Fri May 16 10:51:32 2008 -0400

    xf86SetDesiredModes(): Skip disabled CRTCs first thing.
    (cherry picked from commit 14726b776d6cebb7d864b6ffa7554e1ce5637d5c)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 57fc2c7..e857b07 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -2188,6 +2188,10 @@ xf86SetDesiredModes (ScrnInfoPtr scrn)
 	xf86OutputPtr	output = NULL;
 	int		o;
 
+	/* Skip disabled CRTCs */
+	if (!crtc->enabled)
+	    continue;
+
 	if (config->output[config->compat_output]->crtc == crtc)
 	    output = config->output[config->compat_output];
 	else
@@ -2199,9 +2203,7 @@ xf86SetDesiredModes (ScrnInfoPtr scrn)
 		    break;
 		}
 	}
-	/*
-	 * Skip disabled crtcs
-	 */
+	/* paranoia */
 	if (!output)
 	    continue;
 

commit bedcf985580e7d6684ee9079fe955b6a7e49ad48
Author: Adam Jackson <ajax@redhat.com>
Date:   Fri May 16 10:48:00 2008 -0400

    Fix initial mode selection even harder.
    
    The first guess used to be "is the preferred mode for one output the
    preferred mode on all outputs".  Instead, do "find the largest mode that's
    preferred for at least one output and available on all outputs".
    (cherry picked from commit 459f34b089aca4f4eee9752600c3a9e4f4e343ab)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index e6dd2de..57fc2c7 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1751,46 +1751,65 @@ nextEnabledOutput(xf86CrtcConfigPtr config, Bool *enabled, int *index)
 }
 
 static Bool
-xf86TargetExact(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
-		DisplayModePtr *modes, Bool *enabled,
-		int width, int height)
+xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
+		    DisplayModePtr *modes, Bool *enabled,
+		    int width, int height)
 {
-    int o;
-    int pref_width = 0, pref_height = 0;
-    DisplayModePtr *preferred;
+    int o, p;
+    int max_pref_width = 0, max_pref_height = 0;
+    DisplayModePtr *preferred, *preferred_match;
     Bool ret = FALSE;
 
     preferred = xnfcalloc(config->num_output, sizeof(DisplayModePtr));
+    preferred_match = xnfcalloc(config->num_output, sizeof(DisplayModePtr));
+
+    /* Check if the preferred mode is available on all outputs */
+    for (p = -1; nextEnabledOutput(config, enabled, &p); ) {
+	Rotation r = config->output[p]->initial_rotation;
+	DisplayModePtr mode;
+	if ((preferred[p] = xf86OutputHasPreferredMode(config->output[p],
+			width, height))) {
+	    int pref_width = xf86ModeWidth(preferred[p], r);
+	    int pref_height = xf86ModeHeight(preferred[p], r);
+	    Bool all_match = TRUE;
+
+	    for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+		Bool match = FALSE;
+		xf86OutputPtr output = config->output[o];
+		if (o == p)
+		    continue;
 
-    /* Find all the preferred modes; fail if any outputs lack them */
-    for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
-	preferred[o] =
-	    xf86OutputHasPreferredMode(config->output[o], width, height);
+		for (mode = output->probed_modes; mode; mode = mode->next) {
+		    Rotation r = output->initial_rotation;
+		    if (xf86ModeWidth(mode, r) == pref_width &&
+			    xf86ModeHeight(mode, r) == pref_height) {
+			preferred[o] = mode;
+			match = TRUE;
+		    }
+		}
 
-	if (!preferred[o])
-	    goto out;
-    }
+		all_match &= match;
+	    }
 
-    /* check that they're all the same size */
-    for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
-	Rotation r = config->output[o]->initial_rotation;
-	if (!pref_width) {
-	    pref_width = xf86ModeWidth(preferred[o], r);
-	    pref_height = xf86ModeHeight(preferred[o], r);
-	} else {
-	    if (pref_width != xf86ModeWidth(preferred[o], r))
-		goto out;
-	    if (pref_height != xf86ModeHeight(preferred[o], r))
-		goto out;
+	    if (all_match &&
+		    (pref_width*pref_height > max_pref_width*max_pref_height)) {
+		for (o = -1; nextEnabledOutput(config, enabled, &o); )
+		    preferred_match[o] = preferred[o];
+		max_pref_width = pref_width;
+		max_pref_height = pref_height;
+		ret = TRUE;
+	    }
 	}
     }
 
-    /* oh good, they match.  stash the selected modes and return. */
-    memcpy(modes, preferred, config->num_output * sizeof(DisplayModePtr));
-    ret = TRUE;
+    if (ret) {
+	/* oh good, there is a match.  stash the selected modes and return. */
+	memcpy(modes, preferred_match,
+		config->num_output * sizeof(DisplayModePtr));
+    }
 
-out:
     xfree(preferred);
+    xfree(preferred_match);
     return ret;
 }
 
@@ -2016,7 +2035,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
 
     if (xf86TargetUserpref(scrn, config, modes, enabled, width, height))
 	xf86DrvMsg(i, X_INFO, "Using user preference for initial modes\n");
-    else if (xf86TargetExact(scrn, config, modes, enabled, width, height))
+    else if (xf86TargetPreferred(scrn, config, modes, enabled, width, height))
 	xf86DrvMsg(i, X_INFO, "Using exact sizes for initial modes\n");
     else if (xf86TargetAspect(scrn, config, modes, enabled, width, height))
 	xf86DrvMsg(i, X_INFO, "Using fuzzy aspect match for initial modes\n");
@@ -2088,6 +2107,8 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
 	    crtc->x = output->initial_x;
 	    crtc->y = output->initial_y;
 	    output->crtc = crtc;
+	} else {
+	    output->crtc = NULL;
 	}
     }
     

commit bd50c41f6f479822ec595e02b3ae7a2f6060ba06
Author: Adam Jackson <ajax@redhat.com>
Date:   Fri May 16 10:31:58 2008 -0400

    Redo RANDR compatibility output selection.
    
    Old logic was just the first one that happened to have an associated
    CRTC.  The new logic tries to find one that's definitely connected, has
    probed modes, and has the largest candidate mode.
    (cherry picked from commit 96111c154713600dd534dd82104ac18b91466202)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 0e6dd63..e6dd2de 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1584,7 +1584,98 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
 _X_EXPORT void
 xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr scrn, int *x, int *y);
 
-_X_EXPORT void
+static DisplayModePtr
+biggestMode(DisplayModePtr a, DisplayModePtr b)
+{
+    int A, B;
+
+    if (!a)
+	return b;
+    if (!b)
+	return a;
+
+    A = a->HDisplay * a->VDisplay;
+    B = b->HDisplay * b->VDisplay;
+
+    if (A > B)
+	return a;
+
+    return b;
+}
+
+static xf86OutputPtr
+SetCompatOutput(xf86CrtcConfigPtr config)
+{
+    xf86OutputPtr output = NULL, test = NULL;
+    DisplayModePtr maxmode = NULL, testmode, mode;
+    int o, compat = -1, count, mincount = 0;
+
+    /* Look for one that's definitely connected */
+    for (o = 0; o < config->num_output; o++)
+    {
+	test = config->output[o];
+	if (!test->crtc)
+	    continue;
+	if (test->status != XF86OutputStatusConnected)
+	    continue;
+	if (!test->probed_modes)
+	    continue;
+
+	testmode = mode = test->probed_modes;
+	for (count = 0; mode; mode = mode->next, count++)
+	    testmode = biggestMode(testmode, mode);
+
+	if (!output) {
+	    output = test;
+	    compat = o;
+	    maxmode = testmode;
+	    mincount = count;
+	} else if (maxmode == biggestMode(maxmode, testmode)) {
+	    output = test;
+	    compat = o;
+	    maxmode = testmode;
+	    mincount = count;
+	} else if ((maxmode->HDisplay == testmode->HDisplay) && 
+		(maxmode->VDisplay == testmode->VDisplay) &&
+		count <= mincount) {
+	    output = test;
+	    compat = o;
+	    maxmode = testmode;
+	    mincount = count;
+	}
+    }
+
+    /* If we didn't find one, take anything we can get */
+    if (!output)
+    {
+	for (o = 0; o < config->num_output; o++)
+	{
+	    test = config->output[o];
+	    if (!test->crtc)
+		continue;
+	    if (!test->probed_modes)
+		continue;
+
+	    if (!output) {
+		output = test;
+		compat = o;
+	    } else if (test->probed_modes->HDisplay < output->probed_modes->HDisplay) {
+		output = test;
+		compat = o;
+	    }
+	}
+    }
+
+    if (compat >= 0) {
+	config->compat_output = compat;
+    } else {
+	/* Don't change the compat output when no valid outputs found */
+	output = config->output[config->compat_output];
+    }
+
+    return output;
+}
+
 xf86SetScrnInfoModes (ScrnInfoPtr scrn)
 {
     xf86CrtcConfigPtr	config = XF86_CRTC_CONFIG_PTR(scrn);
@@ -1592,23 +1683,11 @@ xf86SetScrnInfoModes (ScrnInfoPtr scrn)
     xf86CrtcPtr		crtc;
     DisplayModePtr	last, mode;
 
-    output = config->output[config->compat_output];
-    if (!output->crtc)
-    {
-	int o;
+    output = SetCompatOutput(config);
+
+    if (!output)
+	return; /* punt */
 
-	output = NULL;
-	for (o = 0; o < config->num_output; o++)
-	    if (config->output[o]->crtc)
-	    {
-		config->compat_output = o;
-		output = config->output[o];
-		break;
-	    }
-	/* no outputs are active, punt and leave things as they are */
-	if (!output)
-	    return;
-    }
     crtc = output->crtc;
 
     /* Clear any existing modes from scrn->modes */
@@ -1773,25 +1852,6 @@ bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect)
     return match;
 }
 
-static DisplayModePtr
-biggestMode(DisplayModePtr a, DisplayModePtr b)
-{
-    int A, B;
-
-    if (!a)
-	return b;
-    if (!b)
-	return a;
-
-    A = a->HDisplay * a->VDisplay;
-    B = b->HDisplay * b->VDisplay;
-
-    if (A > B)
-	return a;
-
-    return b;
-}
-
 static Bool
 xf86TargetAspect(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
 		 DisplayModePtr *modes, Bool *enabled,

commit 0b031442fe7a04ac8c935ab5858854436f3f3d3c
Author: Adam Jackson <ajax@redhat.com>
Date:   Fri May 16 10:25:12 2008 -0400

    Re-add sync range inference from legacy setup to RANDR 1.2.
    (cherry picked from commit a4bbe1c8bca08f3df5ff7e50444af6aef7ec8b25)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 2b07421..0e6dd63 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1291,6 +1291,50 @@ preferredMode(ScrnInfoPtr pScrn, xf86OutputPtr output)
     return preferred_mode;
 }
 
+static void
+GuessRangeFromModes(MonPtr mon, DisplayModePtr mode)
+{
+    if (!mon || !mode)
+       return;
+
+    mon->nHsync = 1;
+    mon->hsync[0].lo = 1024.0;
+    mon->hsync[0].hi = 0.0;
+
+    mon->nVrefresh = 1;
+    mon->vrefresh[0].lo = 1024.0;
+    mon->vrefresh[0].hi = 0.0;
+
+    while (mode) {
+	if (!mode->HSync)
+	    mode->HSync = ((float) mode->Clock ) / ((float) mode->HTotal);
+
+	if (!mode->VRefresh)
+	    mode->VRefresh = (1000.0 * ((float) mode->Clock)) / 
+		((float) (mode->HTotal * mode->VTotal));
+
+	if (mode->HSync < mon->hsync[0].lo)
+	    mon->hsync[0].lo = mode->HSync;
+
+	if (mode->HSync > mon->hsync[0].hi)
+	    mon->hsync[0].hi = mode->HSync;
+
+	if (mode->VRefresh < mon->vrefresh[0].lo)
+	    mon->vrefresh[0].lo = mode->VRefresh;
+
+	if (mode->VRefresh > mon->vrefresh[0].hi)
+	    mon->vrefresh[0].hi = mode->VRefresh;
+
+	mode = mode->next;
+    }
+
+    /* stretch out the bottom to fit 640x480@60 */
+    if (mon->hsync[0].lo > 31.0)
+       mon->hsync[0].lo = 31.0;
+    if (mon->vrefresh[0].lo > 58.0)
+       mon->vrefresh[0].lo = 58.0;
+}
+
 _X_EXPORT void
 xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
 {
@@ -1408,6 +1452,10 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
 			       OPTUNITS_KHZ, &clock))
 	    max_clock = (int) clock;
 
+	/* If we still don't have a sync range, guess wildly */
+	if (!mon_rec.nHsync || !mon_rec.nVrefresh)
+	    GuessRangeFromModes(&mon_rec, output_modes);
+
 	/*
 	 * These limits will end up setting a 1024x768@60Hz mode by default,
 	 * which seems like a fairly good mode to use when nothing else is

commit b053c9768bca21e8df0df37f45465e2e14bc00fc
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Apr 9 13:55:25 2008 -0400

    Default X-SELinux to off.
    
    Applied only to 1.5 branch for purposes of release stability.  Reevaluate
    this when we do 1.6.

diff --git a/os/utils.c b/os/utils.c
index d785d46..f58c763 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -233,7 +233,7 @@ _X_EXPORT Bool noXInputExtension = FALSE;
 _X_EXPORT Bool noXIdleExtension = FALSE;
 #endif
 #ifdef XSELINUX
-_X_EXPORT Bool noSELinuxExtension = FALSE;
+_X_EXPORT Bool noSELinuxExtension = TRUE;
 _X_EXPORT int selinuxEnforcingState = SELINUX_MODE_DEFAULT;
 #endif
 #ifdef XV

commit cfff55a2bb8618867513bd0f3e66d131ed4edaa8
Author: Adam Jackson <ajax@redhat.com>
Date:   Mon May 12 14:53:37 2008 -0400

    Fix fbdevhw initialization for PCI drivers.
    
    graphics/fb%d, not graphics:fb%d.  Thanks sysfs.  Thysfs.
    (cherry picked from commit 86678e7cc2b021851ff508433fa160170f500c51)

diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
index a1f6748..4d51422 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -310,12 +310,12 @@ fbdev_open_pci(struct pci_device * pPci, char **namep)
     /* There are two ways to that we can determine which fb device is
      * associated with this PCI device.  The more modern way is to look in
      * the sysfs directory for the PCI device for a file named
-     * "graphics:fb*"
+     * "graphics/fb*"
      */
 
     for (i = 0; i < 8; i++) {
 	sprintf(filename, 
-		"/sys/bus/pci/devices/%04x:%02x:%02x.%d/graphics:fb%d",
+		"/sys/bus/pci/devices/%04x:%02x:%02x.%d/graphics/fb%d",
 		pPci->domain, pPci->bus, pPci->dev, pPci->func, i);
 
 	fd = open(filename, O_RDONLY, 0);

commit 1bd229d4ac36eaebf921a9b3526acd947ca0bfaf
Author: Adam Jackson <ajax@redhat.com>
Date:   Mon May 5 14:37:07 2008 -0400

    Fix hal shutdown crash.
    
    Removing the device invalidates its ->next pointer.  Copy it aside before
    destroying the device.
    (cherry picked from commit f52f6c5c7efc281f9ac204fbaa4f71383df7463d)

diff --git a/config/hal.c b/config/hal.c
index 1575422..6534408 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -63,7 +63,7 @@ remove_device(DeviceIntPtr dev)
 static void
 device_removed(LibHalContext *ctx, const char *udi)
 {
-    DeviceIntPtr dev;
+    DeviceIntPtr dev, next;
     char *value;
 
     value = xalloc(strlen(udi) + 5); /* "hal:" + NULL */
@@ -71,11 +71,13 @@ device_removed(LibHalContext *ctx, const char *udi)
         return;
     sprintf(value, "hal:%s", udi);
 
-    for (dev = inputInfo.devices; dev; dev = dev->next) {
+    for (dev = inputInfo.devices; dev; dev = next) {
+	next = dev->next;
         if (dev->config_info && strcmp(dev->config_info, value) == 0)
             remove_device(dev);
     }
-    for (dev = inputInfo.off_devices; dev; dev = dev->next) {
+    for (dev = inputInfo.off_devices; dev; dev = next) {
+	next = dev->next;
         if (dev->config_info && strcmp(dev->config_info, value) == 0)
             remove_device(dev);
     }

commit 18a1d643bc82f15ad26059e2a479f5d5dd778343
Author: Hans de Goede <j.w.r.degoede@hhs.nl>
Date:   Wed Apr 23 12:28:30 2008 -0400

    Prefer glxvisuals with stencil buffer for default visuals
    
    The first fbconfig which has a depthbuffer > 0  and doublebuf is choosen
    when associating fbconfigs with the visuals, indepenent of stencil bits.
    This happens to work ok on intel as there all fbconfigs with a
    depthbuffer > 0 also have stencil bits.
    
    This patch fixes this by first trying to get a fbconfig for default X visuals
    with both stencilbuf, depthbuf and doublebuffering, and if that fails fallback
    to trying to get one with only a depthbuf and doublebuffering.
    (cherry picked from commit f6e22d69af6bc8f63c3a46535a09e217696a679f)

diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c
index 41ee029..5859de0 100644
--- a/GL/glx/glxscreens.c
+++ b/GL/glx/glxscreens.c
@@ -437,6 +437,7 @@ initGlxVisual(VisualPtr visual, __GLXconfig *config)
 typedef struct {
     GLboolean doubleBuffer;
     GLboolean depthBuffer;
+    GLboolean stencilBuffer;
 } FBConfigTemplateRec, *FBConfigTemplatePtr;
 
 static __GLXconfig *
@@ -453,6 +454,8 @@ pickFBConfig(__GLXscreen *pGlxScreen, FBConfigTemplatePtr template, int class)
 	    continue;
 	if ((config->depthBits > 0) != template->depthBuffer)
 	    continue;
+	if ((config->stencilBits > 0) != template->stencilBuffer)
+	    continue;
 
 	return config;
     }
@@ -466,8 +469,9 @@ addMinimalSet(__GLXscreen *pGlxScreen)
     __GLXconfig *config;
     VisualPtr visuals;
     int i, j;
-    FBConfigTemplateRec best = { GL_TRUE, GL_TRUE };
-    FBConfigTemplateRec minimal = { GL_FALSE, GL_FALSE };
+    FBConfigTemplateRec best = { GL_TRUE, GL_TRUE, GL_TRUE };
+    FBConfigTemplateRec good = { GL_TRUE, GL_TRUE, GL_FALSE };
+    FBConfigTemplateRec minimal = { GL_FALSE, GL_FALSE, GL_FALSE };
 
     pGlxScreen->visuals = xcalloc(pGlxScreen->pScreen->numVisuals,
 				  sizeof (__GLXconfig *));
@@ -480,8 +484,11 @@ addMinimalSet(__GLXscreen *pGlxScreen)
     for (i = 0, j = 0; i < pGlxScreen->pScreen->numVisuals; i++) {
 	if (visuals[i].nplanes == 32)
 	    config = pickFBConfig(pGlxScreen, &minimal, visuals[i].class);
-	else
+	else {
 	    config = pickFBConfig(pGlxScreen, &best, visuals[i].class);
+	    if (config == NULL)
+		config = pickFBConfig(pGlxScreen, &good, visuals[i].class);
+        }
 	if (config == NULL)
 	    config = pGlxScreen->fbconfigs;
 	if (config == NULL)

commit ce1f6de2e8d5473a8d6995638a7289fdc8f6dc4b
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Tue May 13 16:39:30 2008 -0700

    When XKB fails to open rules file, log the file name, not the NULL file pointer
    (cherry picked from 7cdc19b29d93bf15cecfd6b69e269fab2501bca0 commit)

diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
index 1fb0979..842c146 100644
--- a/xkb/ddxLoad.c
+++ b/xkb/ddxLoad.c
@@ -401,7 +401,7 @@ XkbRF_RulesPtr	rules;
 
     file = fopen(buf, "r");
     if (!file) {
-        LogMessage(X_ERROR, "XKB: Couldn't open rules file %s\n", file);
+        LogMessage(X_ERROR, "XKB: Couldn't open rules file %s\n", buf);
 	return False;
     }
 

commit 8afd1d62f6298d43367ce52f3b5612a197e99ca0
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Sun May 4 13:45:27 2008 -0700

    Bug #14692: Allow drivers to have a say in Xinerama visual consolidation.
    
    Create a new exported global variable, XineramaVisualsEqualPtr.  Use this
    pointer to decide whether two visuals are equal during visual consolidation.
    This pointer can be wrapped, which allows drivers and extensions to control
    which visuals are consolidated.  A wrapper can reject the visuals without
    calling down, but must call down and return that result if it deems the visuals
    equal.  This ensures that all layers agree that the visuals are equal.
    
    Pass the screen of the other visual into the VisualsEqual callchain.
    
    Don't free PanoramiXVisuals since we need it for PanoramiXTranslateVisualID.
    
    Don't skip the first visual on the other screen in PanoramiXMaybeAddVisual.
    
    Skip the loop in PanoramiXTranslateVisualID if screen is 0.
    (cherry picked from commit c50b5d978981b13cdb22a9ad41c1b64f90cebe51)

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index f924147..eb70689 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -87,6 +87,9 @@ _X_EXPORT unsigned long XRT_PIXMAP;
 _X_EXPORT unsigned long XRT_GC;
 _X_EXPORT unsigned long XRT_COLORMAP;
 
+static Bool VisualsEqual(VisualPtr, ScreenPtr, VisualPtr);
+_X_EXPORT XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr = &VisualsEqual;
+
 /*
  *	Function prototypes
  */
@@ -668,10 +671,10 @@ Bool PanoramiXCreateConnectionBlock(void)
 
     connSetupPrefix.length = length >> 2;
 
-    xfree(PanoramiXVisuals);
     for (i = 0; i < PanoramiXNumDepths; i++)
 	xfree(PanoramiXDepths[i].vids);
     xfree(PanoramiXDepths);
+    PanoramiXDepths = NULL;
 
     /*
      *  OK, change some dimensions so it looks as if it were one big screen
@@ -709,7 +712,7 @@ Bool PanoramiXCreateConnectionBlock(void)
  * do their own back-mapping.
  */
 static Bool
-VisualsEqual(VisualPtr a, VisualPtr b)
+VisualsEqual(VisualPtr a, ScreenPtr pScreenB, VisualPtr b)
 {
     return ((a->class == b->class) &&
 	(a->ColormapEntries == b->ColormapEntries) &&
@@ -759,7 +762,6 @@ static void
 PanoramiXMaybeAddVisual(VisualPtr pVisual)
 {
     ScreenPtr pScreen;
-    VisualPtr candidate = NULL;
     int j, k;
     Bool found = FALSE;
 
@@ -767,10 +769,10 @@ PanoramiXMaybeAddVisual(VisualPtr pVisual)
 	pScreen = screenInfo.screens[j];
 	found = FALSE;
 
-	candidate = pScreen->visuals;
 	for (k = 0; k < pScreen->numVisuals; k++) {
-	    candidate++;
-	    if (VisualsEqual(pVisual, candidate)
+	    VisualPtr candidate = &pScreen->visuals[k];
+
+	    if ((*XineramaVisualsEqualPtr)(pVisual, pScreen, candidate)
 #ifdef GLXPROXY
 		&& glxMatchVisual(screenInfo.screens[0], pVisual, pScreen)
 #endif
@@ -844,8 +846,13 @@ PanoramiXConsolidate(void)
 _X_EXPORT VisualID
 PanoramiXTranslateVisualID(int screen, VisualID orig)
 {
+    ScreenPtr pOtherScreen = screenInfo.screens[screen];
     VisualPtr pVisual = NULL;
-    int i, j;
+    int i;
+
+    /* if screen is 0, orig is already the correct visual ID */
+    if (screen == 0)
+	return orig;
 
     for (i = 0; i < PanoramiXNumVisuals; i++) {
 	if (orig == PanoramiXVisuals[i].vid) {
@@ -858,11 +865,13 @@ PanoramiXTranslateVisualID(int screen, VisualID orig)
 	return 0;
 
     /* found the original, now translate it relative to the backend screen */
-    for (i = 0; i < PanoramiXNumScreens; i++)
-	for (j = 0; j < screenInfo.screens[i]->numVisuals; j++)
-	    if (VisualsEqual(pVisual, &screenInfo.screens[i]->visuals[j]))
-		return screenInfo.screens[i]->visuals[j].vid;
-    
+    for (i = 0; i < pOtherScreen->numVisuals; i++) {
+	VisualPtr pOtherVisual = &pOtherScreen->visuals[i];
+
+	if ((*XineramaVisualsEqualPtr)(pVisual, pOtherScreen, pOtherVisual))
+	    return pOtherVisual->vid;
+    }
+
     return 0;
 }
 
diff --git a/Xext/panoramiXsrv.h b/Xext/panoramiXsrv.h
index 6d556e9..d5c3d98 100644
--- a/Xext/panoramiXsrv.h
+++ b/Xext/panoramiXsrv.h
@@ -30,6 +30,16 @@ extern unsigned long XRT_PIXMAP;
 extern unsigned long XRT_GC;
 extern unsigned long XRT_COLORMAP;
 
+/*
+ * Drivers are allowed to wrap this function.  Each wrapper can decide that the
+ * two visuals are unequal, but if they are deemed equal, the wrapper must call
+ * down and return FALSE if the wrapped function does.  This ensures that all
+ * layers agree that the visuals are equal.  The first visual is always from


Reply to: