[Xquartz-changes] xserver: Branch 'master' - 8 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Sun Nov 21 09:59:37 PST 2010


 Xext/panoramiXprocs.c          |    2 
 fb/Makefile.am                 |    2 
 fb/fb.h                        |    2 
 fb/fbcmap.c                    |  586 -----------------------------------------
 hw/xfree86/common/xf86Config.c |    2 
 hw/xfree86/parser/Monitor.c    |    7 
 hw/xfree86/parser/xf86Parser.h |    1 
 hw/xfree86/parser/xf86tokens.h |    1 
 hw/xwin/winmouse.c             |    1 
 9 files changed, 5 insertions(+), 599 deletions(-)

New commits:
commit 38c46ccf796462d068d95acb9022de2acfc3a1f7
Merge: 3051dd5... c8998af...
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Nov 15 09:06:33 2010 +0800

    Merge remote branch 'whot/for-keith'

commit 3051dd5135962283fc6c7de377a7c819d8a04e7f
Merge: ed547a9... c597572...
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Nov 15 08:58:02 2010 +0800

    Merge remote branch 'jeremyhu/master'

commit ed547a9fc8a4f5cd95ef882b656a376c163eda6d
Merge: 78f94f1... 84e8de1...
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Nov 15 08:51:27 2010 +0800

    Merge remote branch 'adkins/master'

commit 78f94f19aab66a1e5331df0ce29f36e310b4195d
Author: Linus Arver <linusarver at gmail.com>
Date:   Sun Oct 17 12:26:01 2010 -0700

    Xext: panoramiXprocs: fix typo
    
    This fixes a typo introduced in commit
    80b5d3a3264d2c5167e5ac85a3b04af0f89cece1. The pointer pDst was changed
    unintentionally to pWin from a copy/paste error. This resulted in all
    QT-based apps and some tcl/tk ones (like fontforge) to crash X 1.9 on
    starting up, when Xinerama was enabled.
    
    Bug report: https://bbs.archlinux.org/viewtopic.php?id=106125
    
    Signed-off-by: Elie Bleton <drozofil at gmail.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Tested-by: Linus Arver <linusarver at gmail.com>

diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 67b4030..d843168 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -634,7 +634,7 @@ int PanoramiXTranslateCoords(ClientPtr client)
     rep.dstX = x - pDst->drawable.x;
     rep.dstY = y - pDst->drawable.y;
     if((pDst == screenInfo.screens[0]->root) ||
-       (pWin->drawable.id == screenInfo.screens[0]->screensaver.wid))
+       (pDst->drawable.id == screenInfo.screens[0]->screensaver.wid))
     {
 	rep.dstX += screenInfo.screens[0]->x;
 	rep.dstY += screenInfo.screens[0]->y;
commit c8998af3eba49a542625912d512087e4eaaf5ede
Author: Cyril Brulebois <kibi at debian.org>
Date:   Sat Nov 13 02:05:16 2010 +0100

    xfree86: Initialize Pointer and Keyboard.
    
    That helps us get rid of:
    |   CC     xf86Config.lo
    | xf86Config.c: In function ‘T.174’:
    | xf86Config.c:1228: warning: ‘Pointer$module’ may be used uninitialized in this function
    | xf86Config.c:1097: note: ‘Pointer$module’ was declared here
    | xf86Config.c:1228: warning: ‘Pointer$drv’ may be used uninitialized in this function
    | xf86Config.c:1097: note: ‘Pointer$drv’ was declared here
    | xf86Config.c:1228: warning: ‘Pointer$type_name’ may be used uninitialized in this function
    | xf86Config.c:1097: note: ‘Pointer$type_name’ was declared here
    | xf86Config.c:1228: warning: ‘Pointer$private’ may be used uninitialized in this function
    | xf86Config.c:1097: note: ‘Pointer$private’ was declared here
    | xf86Config.c:1228: warning: ‘Pointer$dev’ may be used uninitialized in this function
    | xf86Config.c:1097: note: ‘Pointer$dev’ was declared here
    | xf86Config.c:1228: warning: ‘Pointer$fd’ may be used uninitialized in this function
    | xf86Config.c:1097: note: ‘Pointer$fd’ was declared here
    | xf86Config.c:1228: warning: ‘Pointer$set_device_valuators’ may be used uninitialized in this function
    | xf86Config.c:1097: note: ‘Pointer$set_device_valuators’ was declared here
    | xf86Config.c:1228: warning: ‘Pointer$switch_mode’ may be used uninitialized in this function
    | xf86Config.c:1097: note: ‘Pointer$switch_mode’ was declared here
    | xf86Config.c:1228: warning: ‘Pointer$control_proc’ may be used uninitialized in this function
    | xf86Config.c:1097: note: ‘Pointer$control_proc’ was declared here
    | xf86Config.c:1228: warning: ‘Pointer$read_input’ may be used uninitialized in this function
    | xf86Config.c:1097: note: ‘Pointer$read_input’ was declared here
    | xf86Config.c:1228: warning: ‘Pointer$device_control’ may be used uninitialized in this function
    | xf86Config.c:1097: note: ‘Pointer$device_control’ was declared here
    | xf86Config.c:1228: warning: ‘Pointer$flags’ may be used uninitialized in this function
    | xf86Config.c:1097: note: ‘Pointer$flags’ was declared here
    | xf86Config.c:1228: warning: ‘Pointer$next’ may be used uninitialized in this function
    | xf86Config.c:1097: note: ‘Pointer$next’ was declared here
    
    Signed-off-by: Cyril Brulebois <kibi at debian.org>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index a9e827e..5800700 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1094,7 +1094,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     const char *pointerMsg = NULL, *keyboardMsg = NULL;
     InputInfoPtr *devs, /* iterator */
             indp;
-    InputInfoRec Pointer, Keyboard;
+    InputInfoRec Pointer = {}, Keyboard = {};
     XF86ConfInputPtr confInput;
     XF86ConfInputRec defPtr, defKbd;
     int count = 0;
commit 98abac809a024ac3ed9dd0514ca96367f668c05d
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Nov 11 23:06:13 2010 +0000

    Fix compilation after input API change
    
    Fix compilation after commit 675f4a8525d29ebad783351e17be785b2f32b2e8
    converts winmouse.c to the new ValuatorMask input API, but doesn't
    include the required header inpututil.h
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c
index da1d5a9..ee93d8f 100644
--- a/hw/xwin/winmouse.c
+++ b/hw/xwin/winmouse.c
@@ -39,6 +39,7 @@
 #include "inputstr.h"
 #include "exevents.h" /* for button/axes labels */
 #include "xserver-properties.h"
+#include "inpututils.h"
 
 /* Peek the internal button mapping */
 static CARD8 const *g_winMouseButtonMap = NULL;
commit 84e8de1271bb11b5b4b9747ae4647f47333a8ab7
Author: Jesse Adkins <jesserayadkins at gmail.com>
Date:   Wed Nov 10 21:37:24 2010 -0800

    fb: Remove fbcmap.c (bug 5436)
    
    This is obsolete since a240c039c47c0be22ea5e100692307b26d938747.
    Updated fb.h to mention that the functions come from fbcmap_mi.c now.
    Dropped fbcmap.c from the makefile.
    
    Signed-off-by: Jesse Adkins <jesserayadkins at gmail.com>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/fb/Makefile.am b/fb/Makefile.am
index 2f3073d..f9f34c4 100644
--- a/fb/Makefile.am
+++ b/fb/Makefile.am
@@ -55,4 +55,4 @@ libfb_la_SOURCES = 	\
 
 libwfb_la_SOURCES = $(libfb_la_SOURCES)
 
-EXTRA_DIST = fbcmap.c fbcmap_mi.c
+EXTRA_DIST = fbcmap_mi.c
diff --git a/fb/fb.h b/fb/fb.h
index c290ebf..021a940 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -1262,7 +1262,7 @@ fbBltPlane (FbBits	    *src,
 	    Pixel	    planeMask);
 
 /*
- * fbcmap.c
+ * fbcmap_mi.c
  */
 extern _X_EXPORT int
 fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps);
diff --git a/fb/fbcmap.c b/fb/fbcmap.c
deleted file mode 100644
index 3251a4c..0000000
--- a/fb/fbcmap.c
+++ /dev/null
@@ -1,586 +0,0 @@
-/*
- * Copyright © 1987 Sun Microsystems, Inc.  All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "scrnintstr.h"
-#include "colormapst.h"
-#include "resource.h"
-#include "fb.h"
-
-#ifdef XFree86Server
-#error "You should be compiling fbcmap_mi.c instead of fbcmap.c!"
-#endif
-
-static DevPrivateKeyRec cmapScrPrivateKeyRec;
-#define cmapScrPrivateKey (&cmapScrPrivateKeyRec)
-
-#define GetInstalledColormap(s) ((ColormapPtr) dixLookupPrivate(&(s)->devPrivates, cmapScrPrivateKey))
-#define SetInstalledColormap(s,c) (dixSetPrivate(&(s)->devPrivates, cmapScrPrivateKey, c))
-
-int
-fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
-{
-    /* By the time we are processing requests, we can guarantee that there
-     * is always a colormap installed */
-    *pmaps = GetInstalledColormap(pScreen)->mid;
-    return 1;
-}
-
-
-void
-fbInstallColormap(ColormapPtr pmap)
-{
-    ColormapPtr oldpmap = GetInstalledColormap(pmap->pScreen);
-
-    if(pmap != oldpmap)
-    {
-	/* Uninstall pInstalledMap. No hardware changes required, just
-	 * notify all interested parties. */
-	if(oldpmap != (ColormapPtr)None)
-	    WalkTree(pmap->pScreen, TellLostMap, (char *)&oldpmap->mid);
-	/* Install pmap */
-	SetInstalledColormap(pmap->pScreen, pmap);
-	WalkTree(pmap->pScreen, TellGainedMap, (char *)&pmap->mid);
-    }
-}
-
-void
-fbUninstallColormap(ColormapPtr pmap)
-{
-    ColormapPtr curpmap = GetInstalledColormap(pmap->pScreen);
-
-    if(pmap == curpmap)
-    {
-	if (pmap->mid != pmap->pScreen->defColormap)
-	{
-	    dixLookupResourceByType((pointer *)&curpmap,
-				    pmap->pScreen->defColormap,
-				    RT_COLORMAP,
-				    serverClient, DixInstallAccess);
-	    (*pmap->pScreen->InstallColormap)(curpmap);
-	}
-    }
-}
-
-void
-fbResolveColor(unsigned short	*pred, 
-	       unsigned short	*pgreen, 
-	       unsigned short	*pblue,
-	       VisualPtr	pVisual)
-{
-    int shift = 16 - pVisual->bitsPerRGBValue;
-    unsigned lim = (1 << pVisual->bitsPerRGBValue) - 1;
-
-    if ((pVisual->class | DynamicClass) == GrayScale)
-    {
-	/* rescale to gray then rgb bits */
-	*pred = (30L * *pred + 59L * *pgreen + 11L * *pblue) / 100;
-	*pblue = *pgreen = *pred = ((*pred >> shift) * 65535) / lim;
-    }
-    else
-    {
-	/* rescale to rgb bits */
-	*pred = ((*pred >> shift) * 65535) / lim;
-	*pgreen = ((*pgreen >> shift) * 65535) / lim;
-	*pblue = ((*pblue >> shift) * 65535) / lim;
-    }
-}
-
-Bool
-fbInitializeColormap(ColormapPtr pmap)
-{
-    register unsigned i;
-    register VisualPtr pVisual;
-    unsigned lim, maxent, shift;
-
-    pVisual = pmap->pVisual;
-    lim = (1 << pVisual->bitsPerRGBValue) - 1;
-    shift = 16 - pVisual->bitsPerRGBValue;
-    maxent = pVisual->ColormapEntries - 1;
-    if (pVisual->class == TrueColor)
-    {
-	unsigned limr, limg, limb;
-
-	limr = pVisual->redMask >> pVisual->offsetRed;
-	limg = pVisual->greenMask >> pVisual->offsetGreen;
-	limb = pVisual->blueMask >> pVisual->offsetBlue;
-	for(i = 0; i <= maxent; i++)
-	{
-	    /* rescale to [0..65535] then rgb bits */
-	    pmap->red[i].co.local.red =
-		((((i * 65535) / limr) >> shift) * 65535) / lim;
-	    pmap->green[i].co.local.green =
-		((((i * 65535) / limg) >> shift) * 65535) / lim;
-	    pmap->blue[i].co.local.blue =
-		((((i * 65535) / limb) >> shift) * 65535) / lim;
-	}
-    }
-    else if (pVisual->class == StaticColor)
-    {
-	unsigned	n;
-	unsigned	r, g, b;
-	unsigned	red, green, blue;
-
-	for (n = 0; n*n*n < pVisual->ColormapEntries; n++)
-	    ;
-	n--;
-	i = 0;
-	for (r = 0; r < n; r++)
-	{
-	    red = (((r * 65535 / (n - 1)) >> shift) * 65535) / lim;
-	    for (g = 0; g < n; g++)
-	    {
-		green = (((g * 65535 / (n - 1)) >> shift) * 65535) / lim;
-		for (b = 0; b < n; b++)
-		{
-		    blue = (((b * 65535 / (n - 1)) >> shift) * 65535) / lim;
-		    pmap->red[i].co.local.red = red;
-		    pmap->red[i].co.local.green = green;
-		    pmap->red[i].co.local.blue = blue;
-		    i++;
-		}
-	    }
-	}
-	n = pVisual->ColormapEntries - i;
-	for (r = 0; r < n; r++)
-	{
-	    red = (((r * 65535 / (n - 1)) >> shift) * 65535) / lim;
-	    pmap->red[i].co.local.red = red;
-	    pmap->red[i].co.local.green = red;
-	    pmap->red[i].co.local.blue = red;
-	    i++;
-	}
-    }
-    else if (pVisual->class == StaticGray)
-    {
-	for(i = 0; i <= maxent; i++)
-	{
-	    /* rescale to [0..65535] then rgb bits */
-	    pmap->red[i].co.local.red = ((((i * 65535) / maxent) >> shift)
-					 * 65535) / lim;
-	    pmap->red[i].co.local.green = pmap->red[i].co.local.red;
-	    pmap->red[i].co.local.blue = pmap->red[i].co.local.red;
-	}
-    }
-    return TRUE;
-}
-
-/* When simulating DirectColor on PseudoColor hardware, multiple
-   entries of the colormap must be updated
- */
-
-#define AddElement(mask) { \
-    pixel = red | green | blue; \
-    for (i = 0; i < nresult; i++) \
-  	if (outdefs[i].pixel == pixel) \
-    	    break; \
-    if (i == nresult) \
-    { \
-   	nresult++; \
-	outdefs[i].pixel = pixel; \
-	outdefs[i].flags = 0; \
-    } \
-    outdefs[i].flags |= (mask); \
-    outdefs[i].red = pmap->red[red >> pVisual->offsetRed].co.local.red; \
-    outdefs[i].green = pmap->green[green >> pVisual->offsetGreen].co.local.green; \
-    outdefs[i].blue = pmap->blue[blue >> pVisual->offsetBlue].co.local.blue; \
-}
-
-int
-fbExpandDirectColors (ColormapPtr   pmap, 
-		      int	    ndef,
-		      xColorItem    *indefs,
-		      xColorItem    *outdefs)
-{
-    register int    red, green, blue;
-    int		    maxred, maxgreen, maxblue;
-    int		    stepred, stepgreen, stepblue;
-    VisualPtr	    pVisual;
-    register int    pixel;
-    register int    nresult;
-    register int    i;
-
-    pVisual = pmap->pVisual;
-
-    stepred = 1 << pVisual->offsetRed;
-    stepgreen = 1 << pVisual->offsetGreen;
-    stepblue = 1 << pVisual->offsetBlue;
-    maxred = pVisual->redMask;
-    maxgreen = pVisual->greenMask;
-    maxblue = pVisual->blueMask;
-    nresult = 0;
-    for (;ndef--; indefs++)
-    {
-	if (indefs->flags & DoRed)
-	{
-	    red = indefs->pixel & pVisual->redMask;
-    	    for (green = 0; green <= maxgreen; green += stepgreen)
-    	    {
-	    	for (blue = 0; blue <= maxblue; blue += stepblue)
-	    	{
-		    AddElement (DoRed)
-	    	}
-    	    }
-	}
-	if (indefs->flags & DoGreen)
-	{
-	    green = indefs->pixel & pVisual->greenMask;
-    	    for (red = 0; red <= maxred; red += stepred)
-    	    {
-	    	for (blue = 0; blue <= maxblue; blue += stepblue)
-	    	{
-		    AddElement (DoGreen)
-	    	}
-    	    }
-	}
-	if (indefs->flags & DoBlue)
-	{
-	    blue = indefs->pixel & pVisual->blueMask;
-    	    for (red = 0; red <= maxred; red += stepred)
-    	    {
-	    	for (green = 0; green <= maxgreen; green += stepgreen)
-	    	{
-		    AddElement (DoBlue)
-	    	}
-    	    }
-	}
-    }
-    return nresult;
-}
-
-Bool
-fbCreateDefColormap(ScreenPtr pScreen)
-{
-    unsigned short	zero = 0, ones = 0xFFFF;
-    VisualPtr	pVisual;
-    ColormapPtr	cmap;
-    Pixel wp, bp;
-    
-    for (pVisual = pScreen->visuals;
-	 pVisual->vid != pScreen->rootVisual;
-	 pVisual++)
-	;
-
-    if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &cmap,
-		       (pVisual->class & DynamicClass) ? AllocNone : AllocAll,
-		       0)
-	!= Success)
-	return FALSE;
-    wp = pScreen->whitePixel;
-    bp = pScreen->blackPixel;
-    if ((AllocColor(cmap, &ones, &ones, &ones, &wp, 0) !=
-       	   Success) ||
-    	(AllocColor(cmap, &zero, &zero, &zero, &bp, 0) !=
-       	   Success))
-    	return FALSE;
-    pScreen->whitePixel = wp;
-    pScreen->blackPixel = bp;
-    (*pScreen->InstallColormap)(cmap);
-    return TRUE;
-}
-
-extern int defaultColorVisualClass;
-
-#define _RZ(d) ((d + 2) / 3)
-#define _RS(d) 0
-#define _RM(d) ((1 << _RZ(d)) - 1)
-#define _GZ(d) ((d - _RZ(d) + 1) / 2)
-#define _GS(d) _RZ(d)
-#define _GM(d) (((1 << _GZ(d)) - 1) << _GS(d))
-#define _BZ(d) (d - _RZ(d) - _GZ(d))
-#define _BS(d) (_RZ(d) + _GZ(d))
-#define _BM(d) (((1 << _BZ(d)) - 1) << _BS(d))
-#define _CE(d) (1 << _RZ(d))
-
-#define MAX_PSEUDO_DEPTH    10	    /* largest DAC size I know */
-
-#define StaticGrayMask	(1 << StaticGray)
-#define GrayScaleMask	(1 << GrayScale)
-#define StaticColorMask	(1 << StaticColor)
-#define PseudoColorMask	(1 << PseudoColor)
-#define TrueColorMask	(1 << TrueColor)
-#define DirectColorMask (1 << DirectColor)
-
-#define ALL_VISUALS	(StaticGrayMask|\
-			 GrayScaleMask|\
-			 StaticColorMask|\
-			 PseudoColorMask|\
-			 TrueColorMask|\
-			 DirectColorMask)
-
-#define LARGE_VISUALS	(TrueColorMask|\
-			 DirectColorMask)
-
-typedef struct _fbVisuals {
-    struct _fbVisuals	*next;
-    int			depth;
-    int			bitsPerRGB;
-    int			visuals;
-    int			count;
-    Pixel		redMask, greenMask, blueMask;
-} fbVisualsRec, *fbVisualsPtr;
-
-static const int  fbVisualPriority[] = {
-    PseudoColor, DirectColor, GrayScale, StaticColor, TrueColor, StaticGray
-};
-
-#define NUM_PRIORITY	6
-
-static fbVisualsPtr	fbVisuals;
-
-static int
-popCount (int i)
-{
-    int	count;
-    
-    count = (i >> 1) & 033333333333;
-    count = i - count - ((count >> 1) & 033333333333);
-    count = (((count + (count >> 3)) & 030707070707) % 077);	/* HAKMEM 169 */
-    return count;
-}
-
-/*
- * Distance to least significant one bit
- */
-static int
-maskShift (Pixel p)
-{
-    int	s;
-
-    if (!p) return 0;
-    s = 0;
-    while (!(p & 1))
-    {
-	s++;
-	p >>= 1;
-    }
-    return s;
-}
-
-Bool
-fbSetVisualTypesAndMasks (int depth, int visuals, int bitsPerRGB,
-			  Pixel redMask, Pixel greenMask, Pixel blueMask)
-{
-    fbVisualsPtr   new, *prev, v;
-
-    new = (fbVisualsPtr) malloc(sizeof *new);
-    if (!new)
-	return FALSE;
-    if (!redMask || !greenMask || !blueMask)
-    {
-	redMask = _RM(depth);
-	greenMask = _GM(depth);
-	blueMask = _BM(depth);
-    }
-    new->next = 0;
-    new->depth = depth;
-    new->visuals = visuals;
-    new->bitsPerRGB = bitsPerRGB;
-    new->redMask = redMask;
-    new->greenMask = greenMask;
-    new->blueMask = blueMask;
-    new->count = popCount (visuals);
-    for (prev = &fbVisuals; (v = *prev); prev = &v->next);
-    *prev = new;
-    return TRUE;
-}
-
-Bool
-fbHasVisualTypes (int depth)
-{
-    fbVisualsPtr    v;
-
-    for (v = fbVisuals; v; v = v->next)
-	if (v->depth == depth)
-	    return TRUE;
-    return FALSE;
-}
-
-Bool
-fbSetVisualTypes (int depth, int visuals, int bitsPerRGB)
-{
-    return fbSetVisualTypesAndMasks (depth, visuals, bitsPerRGB,
-				     _RM(depth), _GM(depth), _BM(depth));
-}
-
-/*
- * Given a list of formats for a screen, create a list
- * of visuals and depths for the screen which coorespond to
- * the set which can be used with this version of fb.
- */
-
-Bool
-fbInitVisuals (VisualPtr    *visualp, 
-	       DepthPtr	    *depthp,
-	       int	    *nvisualp,
-	       int	    *ndepthp,
-	       int	    *rootDepthp,
-	       VisualID	    *defaultVisp,
-	       unsigned long	sizes,
-	       int	    bitsPerRGB)
-{
-    int		i, j = 0, k;
-    VisualPtr	visual;
-    DepthPtr	depth;
-    VisualID	*vid;
-    int		d, b;
-    int		f;
-    int		ndepth, nvisual;
-    int		nvtype;
-    int		vtype;
-    fbVisualsPtr   visuals, nextVisuals;
-
-    /* none specified, we'll guess from pixmap formats */
-    if (!fbVisuals) 
-    {
-    	for (f = 0; f < screenInfo.numPixmapFormats; f++) 
-    	{
-	    d = screenInfo.formats[f].depth;
-	    b = screenInfo.formats[f].bitsPerPixel;
-	    if (sizes & (1 << (b - 1)))
-	    {
-	    	if (d > MAX_PSEUDO_DEPTH)
-		    vtype = LARGE_VISUALS;
-	    	else if (d == 1)
-		    vtype = StaticGrayMask;
-		else
-		    vtype = ALL_VISUALS;
-	    }
-	    else
-		vtype = 0;
-	    if (!fbSetVisualTypes (d, vtype, bitsPerRGB))
-		return FALSE;
-    	}
-    }
-    nvisual = 0;
-    ndepth = 0;
-    for (visuals = fbVisuals; visuals; visuals = nextVisuals) 
-    {
-	nextVisuals = visuals->next;
-	ndepth++;
-	nvisual += visuals->count;
-    }
-    depth = (DepthPtr) malloc(ndepth * sizeof (DepthRec));
-    visual = (VisualPtr) malloc(nvisual * sizeof (VisualRec));
-    if (!depth || !visual)
-    {
-	free(depth);
-	free(visual);
-	return FALSE;
-    }
-    *depthp = depth;
-    *visualp = visual;
-    *ndepthp = ndepth;
-    *nvisualp = nvisual;
-    for (visuals = fbVisuals; visuals; visuals = nextVisuals) 
-    {
-	nextVisuals = visuals->next;
-	d = visuals->depth;
-	vtype = visuals->visuals;
-	nvtype = visuals->count;
-	vid = NULL;
-	if (nvtype)
-	{
-	    vid = (VisualID *) malloc(nvtype * sizeof (VisualID));
-	    if (!vid)
-		return FALSE;
-	}
-	depth->depth = d;
-	depth->numVids = nvtype;
-	depth->vids = vid;
-	depth++;
-	for (i = 0; i < NUM_PRIORITY; i++) {
-	    if (! (vtype & (1 << fbVisualPriority[i])))
-		continue;
-	    visual->class = fbVisualPriority[i];
-	    visual->bitsPerRGBValue = visuals->bitsPerRGB;
-	    visual->ColormapEntries = 1 << d;
-	    visual->nplanes = d;
-	    visual->vid = *vid = FakeClientID (0);
-	    switch (visual->class) {
-	    case PseudoColor:
-	    case GrayScale:
-	    case StaticGray:
-	    case StaticColor:
-		visual->redMask = 0;
-		visual->greenMask =  0;
-		visual->blueMask =  0;
-		visual->offsetRed  =  0;
-		visual->offsetGreen = 0;
-		visual->offsetBlue =  0;
-		break;
-	    case DirectColor:
-	    case TrueColor:
-		visual->ColormapEntries = _CE(d);
-		visual->redMask =  visuals->redMask;
-		visual->greenMask =  visuals->greenMask;
-		visual->blueMask =  visuals->blueMask;
-		visual->offsetRed  =  maskShift (visuals->redMask);
-		visual->offsetGreen = maskShift (visuals->greenMask);
-		visual->offsetBlue =  maskShift (visuals->blueMask);
-	    }
-	    vid++;
-	    visual++;
-	}
-	free(visuals);
-    }
-    fbVisuals = NULL;
-    visual = *visualp;
-    depth = *depthp;
-    for (i = 0; i < ndepth; i++)
-    {
-	if (*rootDepthp && *rootDepthp != depth[i].depth)
-	    continue;
-	for (j = 0; j < depth[i].numVids; j++)
-	{
-	    for (k = 0; k < nvisual; k++)
-		if (visual[k].vid == depth[i].vids[j])
-		    break;
-	    if (k == nvisual)
-		continue;
-	    if (defaultColorVisualClass < 0 ||
-		visual[k].class == defaultColorVisualClass)
-		break;
-	}
-	if (j != depth[i].numVids)
-	    break;
-    }
-    if (i == ndepth) {
-	for (i = 0; i < ndepth; i++)
-	{
-	    if (depth[i].numVids)
-		break;
-	}
-	if (i == ndepth)
-	    return FALSE;
-	j = 0;
-    }
-    *rootDepthp = depth[i].depth;
-    *defaultVisp = depth[i].vids[j];
-    return TRUE;
-}
commit 23e329b5641ef044c34ac712c9193171eaf47198
Author: Jesse Adkins <jesserayadkins at gmail.com>
Date:   Wed Nov 10 21:35:58 2010 -0800

    xfree86: parser: Remove 'CUSTOM' flag option in Monitor section.
    
    Not used in the initial import, and also not documented.
    
    Signed-off-by: Jesse Adkins <jesserayadkins at gmail.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/parser/Monitor.c b/hw/xfree86/parser/Monitor.c
index 76c35ae..970406d 100644
--- a/hw/xfree86/parser/Monitor.c
+++ b/hw/xfree86/parser/Monitor.c
@@ -105,7 +105,6 @@ static xf86ConfigSymTabRec TimingTab[] =
 	{TT_HSKEW, "hskew"},
 	{TT_BCAST, "bcast"},
 	{TT_VSCAN, "vscan"},
-	{TT_CUSTOM, "CUSTOM"},
 	{-1, ""},
 };
 
@@ -247,9 +246,6 @@ xf86parseModeLine (void)
 			ptr->ml_vscan = val.num;
 			ptr->ml_flags |= XF86CONF_VSCAN;
 			break;
-		case TT_CUSTOM:
-			ptr->ml_flags |= XF86CONF_CUSTOM;
-			break;
 		case EOF_TOKEN:
 			Error (UNEXPECTED_EOF_MSG, NULL);
 			break;
@@ -370,9 +366,6 @@ xf86parseVerboseMode (void)
 				case TT_DBLSCAN:
 					ptr->ml_flags |= XF86CONF_DBLSCAN;
 					break;
-				case TT_CUSTOM:
-					ptr->ml_flags |= XF86CONF_CUSTOM;
-					break;
 				case EOF_TOKEN:
 					Error (UNEXPECTED_EOF_MSG, NULL);
 					break;
diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h
index 9f0a602..4f279f1 100644
--- a/hw/xfree86/parser/xf86Parser.h
+++ b/hw/xfree86/parser/xf86Parser.h
@@ -119,7 +119,6 @@ XF86ConfModuleRec, *XF86ConfModulePtr;
 #define XF86CONF_NCSYNC    0x0100
 #define XF86CONF_HSKEW     0x0200	/* hskew provided */
 #define XF86CONF_BCAST     0x0400
-#define XF86CONF_CUSTOM    0x0800	/* timing numbers customized by editor */
 #define XF86CONF_VSCAN     0x1000
 
 typedef struct
diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h
index ec04e4c..468a2ff 100644
--- a/hw/xfree86/parser/xf86tokens.h
+++ b/hw/xfree86/parser/xf86tokens.h
@@ -165,7 +165,6 @@ typedef enum {
     TT_HSKEW,
     TT_BCAST,
     TT_VSCAN,
-    TT_CUSTOM,
 
     /* Module tokens */
     LOAD,


More information about the Xquartz-changes mailing list