xserver: Branch 'xorg-server-1.5-apple' - 13 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Fri Apr 18 20:06:23 PDT 2008


 GL/glx/glxglcore.c                      |    3 +
 GL/glx/glxscreens.c                     |    2 -
 Xext/xres.c                             |    2 -
 configure.ac                            |   10 ++++--
 dix/devices.c                           |    4 +-
 exa/exa.c                               |   53 +++++++++++++++++++-------------
 exa/exa_render.c                        |    3 +
 fb/fb.h                                 |    2 -
 hw/xfree86/common/compiler.h            |    2 -
 hw/xfree86/common/xf86.h                |    1 
 hw/xfree86/common/xf86AutoConfig.c      |    2 -
 hw/xfree86/common/xf86Config.c          |   37 ++++++++++++++++------
 hw/xfree86/common/xf86Privstr.h         |    3 +
 hw/xfree86/common/xf86Xinput.c          |   12 ++++++-
 hw/xfree86/loader/loader.c              |    2 -
 hw/xfree86/modes/xf86EdidModes.c        |    6 +++
 hw/xfree86/os-support/bsd/bsdResource.c |    2 -
 hw/xfree86/os-support/bsd/i386_video.c  |    8 ++--
 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/xprint/ps/psout.h                    |    2 -
 hw/xquartz/X11Application.m             |   11 +-----
 hw/xquartz/X11Controller.m              |   16 ++++-----
 hw/xquartz/applewm.c                    |    2 +
 hw/xquartz/darwinEvents.c               |    2 -
 hw/xquartz/quartz.c                     |    2 +
 hw/xquartz/quartzAudio.c                |    2 +
 hw/xquartz/quartzCocoa.m                |    6 +--
 hw/xquartz/quartzCommon.h               |   12 -------
 hw/xquartz/quartzKeyboard.c             |   11 +-----
 hw/xquartz/quartzStartup.c              |    2 +
 hw/xquartz/sanitizedCarbon.h            |   32 +++++++++++++++++++
 hw/xquartz/sanitizedCocoa.h             |   27 ++++++++++++++++
 hw/xquartz/xpr/xprCursor.c              |    2 +
 hw/xquartz/xpr/xprScreen.c              |    2 +
 include/servermd.h                      |    2 -
 include/window.h                        |    2 -
 mi/micoord.h                            |    2 -
 41 files changed, 202 insertions(+), 101 deletions(-)

New commits:
commit 8cb23d672177da919257c885804cecd18cf9af88
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Apr 18 20:06:17 2008 -0700

    XQuartz: Handled sanitization of namespace better

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 6691a25..fe9bb25 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -26,22 +26,17 @@
  copyright holders shall not be used in advertising or otherwise to
  promote the sale, use or other dealings in this Software without
  prior written authorization. */
-#include <Carbon/Carbon.h>
-#include "quartzCommon.h"
+
+#include "sanitizedCarbon.h"
 
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
 #endif
-#define BOOL X_BOOL
-//#undef GetWindowAttributes
-//#undef ChangeWindowAttributes
-#undef BOOL
 
 #include "quartzForeground.h"
+#include "quartzCommon.h"
 #import "X11Application.h"
 
-/* ouch! */
-#define BOOL X_BOOL
 # include "darwin.h"
 # include "darwinEvents.h"
 # include "quartz.h"
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index 2fd9886..1f23569 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -27,6 +27,8 @@
    promote the sale, use or other dealings in this Software without
    prior written authorization. */
 
+#include "sanitizedCarbon.h"
+
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
 #endif
@@ -37,17 +39,13 @@
 
 #import "X11Controller.h"
 #import "X11Application.h"
-#import <Carbon/Carbon.h>
 
-/* ouch! */
-#define BOOL X_BOOL
 #include "opaque.h"
-# include "darwin.h"
-# include "quartz.h"
-# define _APPLEWM_SERVER_
-# include "X11/extensions/applewm.h"
-# include "applewmExt.h"
-#undef BOOL
+#include "darwin.h"
+#include "quartz.h"
+#define _APPLEWM_SERVER_
+#include "X11/extensions/applewm.h"
+#include "applewmExt.h"
 
 #include <stdio.h>
 #include <unistd.h>
diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c
index 072e57f..ba86f10 100644
--- a/hw/xquartz/applewm.c
+++ b/hw/xquartz/applewm.c
@@ -25,6 +25,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 **************************************************************************/
 
+#include "sanitizedCarbon.h"
+
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
 #endif
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index d69e6b7..afa292f 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -284,7 +284,7 @@ static void DarwinEventHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, in
                 break;
                 
             case kXquartzSetRootClip:
-                QuartzSetRootClip((BOOL)xe[i].u.clientMessage.u.l.longs0);
+                QuartzSetRootClip((Bool)xe[i].u.clientMessage.u.l.longs0);
                 break;
                 
             case kXquartzQuit:
diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index fb9f13c..4d03d02 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -28,6 +28,8 @@
  * use or other dealings in this Software without prior written authorization.
  */
 
+#include "sanitizedCarbon.h"
+
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
 #endif
diff --git a/hw/xquartz/quartzAudio.c b/hw/xquartz/quartzAudio.c
index 5dee32f..d3698d7 100644
--- a/hw/xquartz/quartzAudio.c
+++ b/hw/xquartz/quartzAudio.c
@@ -36,6 +36,8 @@
  * use or other dealings in this Software without prior written authorization.
  */
 
+#include "sanitizedCarbon.h"
+
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
 #endif
diff --git a/hw/xquartz/quartzCocoa.m b/hw/xquartz/quartzCocoa.m
index d8f9c69..aa4b9fb 100644
--- a/hw/xquartz/quartzCocoa.m
+++ b/hw/xquartz/quartzCocoa.m
@@ -32,6 +32,8 @@
  * use or other dealings in this Software without prior written authorization.
  */
 
+#include "sanitizedCocoa.h"
+
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
 #endif
@@ -40,12 +42,8 @@
 #include "inputstr.h"
 #include "quartzPasteboard.h"
 
-#define BOOL xBOOL
 #include "darwin.h"
 
-#include <Cocoa/Cocoa.h>
-#undef BOOL
-
 #include "pseudoramiX.h"
 
 extern void FatalError(const char *, ...);
diff --git a/hw/xquartz/quartzCommon.h b/hw/xquartz/quartzCommon.h
index 40675bc..e63c2b7 100644
--- a/hw/xquartz/quartzCommon.h
+++ b/hw/xquartz/quartzCommon.h
@@ -35,18 +35,6 @@
 #ifndef _QUARTZCOMMON_H
 #define _QUARTZCOMMON_H
 
-// QuickDraw in ApplicationServices has the following conflicts with
-// the basic X server headers. Use QD_<name> to use the QuickDraw
-// definition of any of these symbols, or the normal name for the
-// X11 definition.
-#define Cursor       QD_Cursor
-#define WindowPtr    QD_WindowPtr
-#define Picture      QD_Picture
-#include <ApplicationServices/ApplicationServices.h>
-#include <Carbon/Carbon.h>
-#undef Cursor
-#undef WindowPtr
-#undef Picture
 #include <X11/Xdefs.h>
 #include "privates.h"
 
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index fd0c3cc..698f39a 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -34,6 +34,8 @@
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+#include "sanitizedCarbon.h"
+
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
 #endif
@@ -51,15 +53,6 @@
 #include <sys/stat.h>
 
 #include "quartzCommon.h"
-
-#undef GetWindowAttributes
-#undef ChangeWindowAttributes
-
-#include <CoreServices/CoreServices.h>
-#include <Carbon/Carbon.h>
-#include <IOKit/hidsystem/event_status_driver.h>
-#include <IOKit/hidsystem/ev_keymap.h>
-#include <architecture/byte_order.h>  // For the NXSwap*
 #include "darwin.h"
 
 #include "quartzKeyboard.h"
diff --git a/hw/xquartz/quartzStartup.c b/hw/xquartz/quartzStartup.c
index e25e155..18d0bfa 100644
--- a/hw/xquartz/quartzStartup.c
+++ b/hw/xquartz/quartzStartup.c
@@ -27,6 +27,8 @@
  * use or other dealings in this Software without prior written authorization.
  */
 
+#include "sanitizedCarbon.h"
+
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
 #endif
diff --git a/hw/xquartz/sanitizedCarbon.h b/hw/xquartz/sanitizedCarbon.h
new file mode 100644
index 0000000..cc6ef19
--- /dev/null
+++ b/hw/xquartz/sanitizedCarbon.h
@@ -0,0 +1,32 @@
+/*
+ * Don't #include any of the AppKit, etc stuff directly since it will
+ * pollute the X11 namespace.
+ */
+
+#ifndef _XQ_SANITIZED_CARBON_H_
+#define _XQ_SANITIZED_CARBON_H_
+
+// QuickDraw in ApplicationServices has the following conflicts with
+// the basic X server headers. Use QD_<name> to use the QuickDraw
+// definition of any of these symbols, or the normal name for the
+// X11 definition.
+#define Cursor       QD_Cursor
+#define WindowPtr    QD_WindowPtr
+#define Picture      QD_Picture
+#define BOOL         OSX_BOOL
+#define EventType    HIT_EventType
+
+#include <ApplicationServices/ApplicationServices.h>
+#include <CoreServices/CoreServices.h>
+#include <Carbon/Carbon.h>
+#include <IOKit/hidsystem/event_status_driver.h>
+#include <IOKit/hidsystem/ev_keymap.h>
+#include <architecture/byte_order.h>  // For the NXSwap*
+
+#undef Cursor
+#undef WindowPtr
+#undef Picture
+#undef BOOL
+#undef EventType
+
+#endif  /* _XQ_SANITIZED_CARBON_H_ */
diff --git a/hw/xquartz/sanitizedCocoa.h b/hw/xquartz/sanitizedCocoa.h
new file mode 100644
index 0000000..58de64c
--- /dev/null
+++ b/hw/xquartz/sanitizedCocoa.h
@@ -0,0 +1,27 @@
+/*
+ * Don't #include any of the AppKit, etc stuff directly since it will
+ * pollute the X11 namespace.
+ */
+
+#ifndef _XQ_SANITIZED_COCOA_H_
+#define _XQ_SANITIZED_COCOA_H_
+
+// QuickDraw in ApplicationServices has the following conflicts with
+// the basic X server headers. Use QD_<name> to use the QuickDraw
+// definition of any of these symbols, or the normal name for the
+// X11 definition.
+#define Cursor       QD_Cursor
+#define WindowPtr    QD_WindowPtr
+#define Picture      QD_Picture
+#define BOOL         OSX_BOOL
+#define EventType    HIT_EventType
+
+#include <Cocoa/Cocoa.h>
+
+#undef Cursor
+#undef WindowPtr
+#undef Picture
+#undef BOOL
+#undef EventType
+
+#endif  /* _XQ_SANITIZED_COCOA_H_ */
diff --git a/hw/xquartz/xpr/xprCursor.c b/hw/xquartz/xpr/xprCursor.c
index a42c30c..76ab75c 100644
--- a/hw/xquartz/xpr/xprCursor.c
+++ b/hw/xquartz/xpr/xprCursor.c
@@ -29,6 +29,8 @@
  * use or other dealings in this Software without prior written authorization.
  */
 
+#include "sanitizedCarbon.h"
+
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
 #endif
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 8219046..f685d4a 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -27,6 +27,8 @@
  * use or other dealings in this Software without prior written authorization.
  */
 
+#include "sanitizedCarbon.h"
+
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
 #endif
diff --git a/include/window.h b/include/window.h
index ca2e57e..52b3982 100644
--- a/include/window.h
+++ b/include/window.h
@@ -134,7 +134,7 @@ extern int ChangeWindowAttributes(
 /* Quartz support on Mac OS X uses the HIToolbox
    framework whose GetWindowAttributes function conflicts here. */
 #ifdef __APPLE__
-#define GetWindowAttributes(w,c) Darwin_X_GetWindowAttributes(w,c)
+#define GetWindowAttributes(w,c,x) Darwin_X_GetWindowAttributes(w,c,x)
 extern void Darwin_X_GetWindowAttributes(
 #else
 extern void GetWindowAttributes(
commit 5cef157d9d3f0d1aaadd9ec760f6962ab24ca56c
Merge: 7fb9b2d... 5a2b538...
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Apr 18 17:23:23 2008 -0700

    Merge branch 'server-1.5-branch' into xorg-server-1.5-apple

commit 5a2b538c1bc020af5bc33027ba0d9698338dca46
Author: Kristian Høgsberg <krh at redhat.com>
Date:   Fri Apr 11 11:09:13 2008 -0400

    Make DRI2 a serverlayout/serverflags option.
    
    Add xf86DRI2Enabled() to export the value of the setting.
    (cherry picked from commit 35982bc109d424c464551ab22ec90af69908c884)

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 4b3e104..065102f 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -71,6 +71,7 @@ extern Bool sbusSlotClaimed;
 #endif
 extern confDRIRec xf86ConfigDRI;
 extern Bool xf86inSuspend;
+extern Bool xf86DRI2Enabled(void);
 
 #define XF86SCRNINFO(p) ((ScrnInfoPtr)dixLookupPrivate(&(p)->devPrivates, \
 						       xf86ScreenKey))
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 3cc04f0..8e412b5 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -766,6 +766,7 @@ typedef enum {
     FLAG_AUTO_ADD_DEVICES,
     FLAG_AUTO_ENABLE_DEVICES,
     FLAG_GLX_VISUALS,
+    FLAG_DRI2,
 } FlagValues;
    
 static OptionInfoRec FlagOptions[] = {
@@ -837,16 +838,18 @@ static OptionInfoRec FlagOptions[] = {
 	{0}, FALSE },
   { FLAG_ALLOW_EMPTY_INPUT,     "AllowEmptyInput",              OPTV_BOOLEAN,
         {0}, FALSE },
-  { FLAG_IGNORE_ABI,			"IgnoreABI",			OPTV_BOOLEAN,
+  { FLAG_IGNORE_ABI,		"IgnoreABI",			OPTV_BOOLEAN,
 	{0}, FALSE },
-  { FLAG_USE_DEFAULT_FONT_PATH,  "UseDefaultFontPath",			OPTV_BOOLEAN,
+  { FLAG_USE_DEFAULT_FONT_PATH,  "UseDefaultFontPath",		OPTV_BOOLEAN,
 	{0}, FALSE },
-  { FLAG_AUTO_ADD_DEVICES,       "AutoAddDevices",                      OPTV_BOOLEAN,
+  { FLAG_AUTO_ADD_DEVICES,       "AutoAddDevices",		OPTV_BOOLEAN,
         {0}, TRUE },
-  { FLAG_AUTO_ENABLE_DEVICES,    "AutoEnableDevices",                   OPTV_BOOLEAN,
+  { FLAG_AUTO_ENABLE_DEVICES,    "AutoEnableDevices",		OPTV_BOOLEAN,
         {0}, TRUE },
   { FLAG_GLX_VISUALS,		"GlxVisuals",			OPTV_STRING,
         {0}, FALSE },
+  { FLAG_DRI2,			"DRI2",				OPTV_BOOLEAN,
+	{0}, FALSE },
   { -1,				NULL,				OPTV_NONE,
 	{0}, FALSE },
 };
@@ -1179,9 +1182,23 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
       xf86Msg(from, "Xinerama: enabled\n");
 #endif
 
+#ifdef DRI2
+    xf86Info.dri2 = FALSE;
+    xf86Info.dri2From = X_DEFAULT;
+    if (xf86GetOptValBool(FlagOptions, FLAG_DRI2, &value)) {
+	xf86Info.dri2 = value;
+	xf86Info.dri2From = X_CONFIG;
+    }
+#endif
+
     return TRUE;
 }
 
+Bool xf86DRI2Enabled(void)
+{
+    return xf86Info.dri2;
+}
+
 /*
  * Locate the core input devices.  These can be specified/located in
  * the following ways, in order of priority:
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
index d97ca44..8cab56e 100644
--- a/hw/xfree86/common/xf86Privstr.h
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -149,6 +149,9 @@ typedef struct {
     Bool        autoAddDevices; /* Whether to succeed NIDR, or ignore. */
     Bool        autoEnableDevices; /* Whether to enable, or let the client
                                     * control. */
+
+    Bool		dri2;
+    MessageType		dri2From;
 } xf86InfoRec, *xf86InfoPtr;
 
 #ifdef DPMSExtension
commit 46b74e84508b614b125e71fd0f3e0cc4fc3fe5b5
Author: Tilman Sauerbeck <tilman at code-monkey.de>
Date:   Mon Apr 14 11:43:51 2008 +0200

    EXA: Update pixmaps' accel_blocked field in ModifyPixmapHeader.
    (cherry picked from commit f133d85778462134f366389bde7673bff7845fa8)

diff --git a/exa/exa.c b/exa/exa.c
index cbe66e8..81dc3e2 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -224,6 +224,30 @@ exaLog2(int val)
     return bits - 1;
 }
 
+static void
+exaSetAccelBlock(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap,
+                 int w, int h, int bpp)
+{
+    pExaPixmap->accel_blocked = 0;
+
+    if (pExaScr->info->maxPitchPixels) {
+        int max_pitch = pExaScr->info->maxPitchPixels * (bpp + 7) / 8;
+
+        if (pExaPixmap->fb_pitch > max_pitch)
+            pExaPixmap->accel_blocked |= EXA_RANGE_PITCH;
+    }
+
+    if (pExaScr->info->maxPitchBytes &&
+        pExaPixmap->fb_pitch > pExaScr->info->maxPitchBytes)
+        pExaPixmap->accel_blocked |= EXA_RANGE_PITCH;
+
+    if (w > pExaScr->info->maxX)
+        pExaPixmap->accel_blocked |= EXA_RANGE_WIDTH;
+
+    if (h > pExaScr->info->maxY)
+        pExaPixmap->accel_blocked |= EXA_RANGE_HEIGHT;
+}
+
 /**
  * exaCreatePixmap() creates a new pixmap.
  *
@@ -339,25 +363,8 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
     REGION_NULL(pScreen, &pExaPixmap->validSys);
     REGION_NULL(pScreen, &pExaPixmap->validFB);
 
-    /* Check whether this pixmap can be used for acceleration. */
-    pExaPixmap->accel_blocked = 0;
-
-    if (pExaScr->info->maxPitchPixels) {
-        int max_pitch = pExaScr->info->maxPitchPixels * (bpp + 7) / 8;
-
-        if (pExaPixmap->fb_pitch > max_pitch)
-            pExaPixmap->accel_blocked |= EXA_RANGE_PITCH;
-    }
-
-    if (pExaScr->info->maxPitchBytes &&
-        pExaPixmap->fb_pitch > pExaScr->info->maxPitchBytes)
-        pExaPixmap->accel_blocked |= EXA_RANGE_PITCH;
-
-    if (w > pExaScr->info->maxX)
-        pExaPixmap->accel_blocked |= EXA_RANGE_WIDTH;
-
-    if (h > pExaScr->info->maxY)
-        pExaPixmap->accel_blocked |= EXA_RANGE_HEIGHT;
+    exaSetAccelBlock(pExaScr, pExaPixmap,
+                     w, h, bpp);
 
     return pPixmap;
 }
@@ -373,12 +380,16 @@ exaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
     if (!pPixmap)
         return FALSE;
 
+    pExaScr = ExaGetScreenPriv(pPixmap->drawable.pScreen);
     pExaPixmap = ExaGetPixmapPriv(pPixmap);
 
-    if (pExaPixmap)
+    if (pExaPixmap) {
 	pExaPixmap->sys_ptr = pPixData;
 
-    pExaScr = ExaGetScreenPriv(pPixmap->drawable.pScreen);
+        exaSetAccelBlock(pExaScr, pExaPixmap,
+                         width, height, bitsPerPixel);
+    }
+
 
     if (pExaScr->info->ModifyPixmapHeader) {
 	ret = pExaScr->info->ModifyPixmapHeader(pPixmap, width, height, depth,
commit 4161c9781be6afea9647307152f85cf8f1b20a3a
Author: Tilman Sauerbeck <tilman at code-monkey.de>
Date:   Mon Apr 14 09:58:49 2008 +0200

    EXA: Teach exaCompositeFallbackPictDesc() about x8r8g8b8.
    (cherry picked from commit bb8868540f017b121d698da45e552ffb55a57cea)

diff --git a/exa/exa_render.c b/exa/exa_render.c
index da81401..1d7b897 100644
--- a/exa/exa_render.c
+++ b/exa/exa_render.c
@@ -51,6 +51,9 @@ static void exaCompositeFallbackPictDesc(PicturePtr pict, char *string, int n)
     case PICT_a8r8g8b8:
 	snprintf(format, 20, "ARGB8888");
 	break;
+    case PICT_x8r8g8b8:
+	snprintf(format, 20, "XRGB8888");
+	break;
     case PICT_r5g6b5:
 	snprintf(format, 20, "RGB565  ");
 	break;
commit 32604d0f1397c5b5b944a78a47caf1db324312f7
Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Apr 14 11:45:12 2008 +1000

    glx: silly nitpick...
    
    even though i and j are the same, we use i to derefence visuals everywhere else
    (cherry picked from commit 3e12c5bb67f3049156475d5cbf4e899aaded76bb)

diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c
index b49a775..41ee029 100644
--- a/GL/glx/glxscreens.c
+++ b/GL/glx/glxscreens.c
@@ -488,7 +488,7 @@ addMinimalSet(__GLXscreen *pGlxScreen)
 	    continue;
 
 	pGlxScreen->visuals[j] = config;
-	config->visualID = visuals[j].vid;
+	config->visualID = visuals[i].vid;
 	j++;
     }
 
commit 738aea7a94bf07a986c7b7d83346b86337d65d1e
Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Apr 14 11:40:38 2008 +1000

    glcore: make visualRating GLX_NONE - note GLX_NONE is not == 0
    
    Finally glxinfo returns the set of 3 visuals and glxgears works again for me on
    sw rendering
    (cherry picked from commit 97565c0f394f16d042c614695c8b7b4ac354f2a3)

diff --git a/GL/glx/glxglcore.c b/GL/glx/glxglcore.c
index 16064a9..1eac0eb 100644
--- a/GL/glx/glxglcore.c
+++ b/GL/glx/glxglcore.c
@@ -320,6 +320,7 @@ createFBConfigsForVisual(__GLXscreen *screen, ScreenPtr pScreen,
 		config->next = xcalloc(sizeof(*config), 1);
 		config = config->next;
 
+		config->visualRating = GLX_NONE;
 		config->visualType = glx_visual_types[visual->class];
 		config->xRenderable = GL_TRUE;
 		config->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT;
commit d6916b149d2fac9812d7d43a8a40df0b0836550f
Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Apr 14 10:47:28 2008 +1000

    glcore: zero fbconfigs before filling them in.
    
    I'm not sure this the complete proper solution, perhaps it should explicitly fill
    in ever field.
    
    This at least makes glxinfo on glcore return sensible information, it doesn't make
    gears work yet though.
    (cherry picked from commit c61087c82784633e522bd9392172b43656bdf45e)

diff --git a/GL/glx/glxglcore.c b/GL/glx/glxglcore.c
index 972ab88..16064a9 100644
--- a/GL/glx/glxglcore.c
+++ b/GL/glx/glxglcore.c
@@ -317,7 +317,7 @@ createFBConfigsForVisual(__GLXscreen *screen, ScreenPtr pScreen,
     for (back = numBack - 1; back >= 0; back--)
 	for (depth = 0; depth < numDepth; depth++)
 	    for (stencil = 0; stencil < numStencil; stencil++) {
-		config->next = xalloc(sizeof *config);
+		config->next = xcalloc(sizeof(*config), 1);
 		config = config->next;
 
 		config->visualType = glx_visual_types[visual->class];
commit db00d4a4dc3af66ff8a0613576a3e05cfd5245be
Author: Matt Turner <mattst88 at gmail.com>
Date:   Sat Apr 12 20:39:18 2008 +0200

    Check for __x86_64__ when we check for __amd64__
    
    It seems Intel C Compiler neglects to define __amd64__, __amd64, or
    amd64, but *does* define __x86_64__.
    (cherry picked from commit 1fa4de80fcfc697b5e5879cc351fb3e9dbf6acbe)

diff --git a/fb/fb.h b/fb/fb.h
index 01000d7..1cd9473 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -141,7 +141,7 @@ typedef unsigned __int64    FbBits;
       defined(ia64) || defined(__ia64__) || \
       defined(__sparc64__) || defined(_LP64) || \
       defined(__s390x__) || \
-      defined(amd64) || defined (__amd64__) || \
+      defined(amd64) || defined (__amd64__) || defined(__x86_64__) || \
       defined (__powerpc64__) || \
       (defined(sgi) && (_MIPS_SZLONG == 64))
 typedef unsigned long	    FbBits;
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index 73ca3d0..7b65da8 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -498,7 +498,7 @@ extern unsigned int inb(unsigned long port);
 extern unsigned int inw(unsigned long port);
 extern unsigned int inl(unsigned long port);
  
-#   elif defined(linux) && defined(__amd64__) 
+#   elif defined(linux) && (defined(__amd64__) || defined(__x86_64__))
  
 #    include <inttypes.h>
 
diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
index 3210e44..92b204b 100644
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -449,7 +449,7 @@ chooseVideoDriver(void)
 	if (info != NULL)
 	    chosen_driver = videoPtrToDriverName(info);
 	if (chosen_driver == NULL) {
-#if defined  __i386__ || defined __amd64__ || defined __hurd__
+#if defined  __i386__ || defined __amd64__ || defined __x86_64__ || defined __hurd__
 	    chosen_driver = "vesa";
 #elif defined __sparc__
 	    chosen_driver = "sunffb";
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index 774a4c4..a00269b 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -63,7 +63,7 @@
 #include <string.h>
 #if defined(linux) && \
     (defined(__alpha__) || defined(__powerpc__) || defined(__ia64__) \
-    || defined(__amd64__))
+    || defined(__amd64__) || defined(__x86_64__))
 #include <malloc.h>
 #endif
 #include <stdarg.h>
diff --git a/hw/xfree86/os-support/bsd/bsdResource.c b/hw/xfree86/os-support/bsd/bsdResource.c
index fe166c8..d1ee787 100644
--- a/hw/xfree86/os-support/bsd/bsdResource.c
+++ b/hw/xfree86/os-support/bsd/bsdResource.c
@@ -19,7 +19,7 @@
 
 #ifdef INCLUDE_XF86_NO_DOMAIN
 
-#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__)
+#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) || defined(__x86_64__)
 
 resPtr
 xf86AccResFromOS(resPtr ret)
diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c
index 1ebac67..e2f6420 100644
--- a/hw/xfree86/os-support/bsd/i386_video.c
+++ b/hw/xfree86/os-support/bsd/i386_video.c
@@ -55,7 +55,7 @@
 #endif
 #endif
 
-#if defined(__OpenBSD__) && defined(__amd64__)
+#if defined(__OpenBSD__) && (defined(__amd64__) || defined(__x86_64__))
 #include <machine/mtrr.h>
 #include <machine/sysarch.h>
 #endif
@@ -108,7 +108,7 @@ static pointer NetBSDsetWC(int, unsigned long, unsigned long, Bool,
 			   MessageType);
 static void NetBSDundoWC(int, pointer);
 #endif
-#if defined(__amd64__) && defined(__OpenBSD__)
+#if (defined(__amd64__) || defined(__x86_64__)) && defined(__OpenBSD__)
 static pointer amd64setWC(int, unsigned long, unsigned long, Bool, 
     MessageType);
 static void amd64undoWC(int, pointer);
@@ -229,7 +229,7 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
 	pVidMem->setWC = NetBSDsetWC;
 	pVidMem->undoWC = NetBSDundoWC;
 #endif
-#if defined(__amd64__) && defined(__OpenBSD__)
+#if (defined(__amd64__) || defined(__x86_64__))  && defined(__OpenBSD__)
 	pVidMem->setWC = amd64setWC;
 	pVidMem->undoWC = amd64undoWC;
 #endif
@@ -953,7 +953,7 @@ NetBSDundoWC(int screenNum, pointer list)
 }
 #endif
 
-#if defined(__OpenBSD__) && defined(__amd64__)
+#if defined(__OpenBSD__) && (defined(__amd64__) || defined(__x86_64__))
 static pointer
 amd64setWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
 	    MessageType from)
diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h
index ebac090..b78d307 100644
--- a/hw/xfree86/os-support/bus/Pci.h
+++ b/hw/xfree86/os-support/bus/Pci.h
@@ -246,7 +246,7 @@
 # if !defined(__FreeBSD__) && !defined(linux)
 #  define ARCH_PCI_PCI_BRIDGE sparcPciPciBridge
 # endif
-#elif defined(__amd64__) || defined(__amd64)
+#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__)
 # if defined(linux)
 #  define ARCH_PCI_INIT linuxPciInit
 # else
diff --git a/hw/xfree86/utils/xorgcfg/loadmod.c b/hw/xfree86/utils/xorgcfg/loadmod.c
index 1207820..629dfe1 100644
--- a/hw/xfree86/utils/xorgcfg/loadmod.c
+++ b/hw/xfree86/utils/xorgcfg/loadmod.c
@@ -179,7 +179,9 @@ LOOKUP xfree86LookupTab[] = {
    SYMFUNC(xf86memchr)
    SYMFUNC(xf86memcmp)
    SYMFUNC(xf86memcpy)
-#if (defined(__powerpc__) && (defined(Lynx) || defined(linux))) || defined(__sparc__) || defined(__sparc) || defined(__ia64__) || defined (__amd64__)
+#if (defined(__powerpc__) && (defined(Lynx) || defined(linux))) || \
+    defined(__sparc__) || defined(__sparc) || defined(__ia64__) || \
+    defined (__amd64__) || defined(__x86_64__)
    /*
     * Some PPC, SPARC, and IA64 compilers generate calls to memcpy to handle
     * structure copies.  This causes a problem both here and in shared
diff --git a/hw/xfree86/x86emu/prim_ops.c b/hw/xfree86/x86emu/prim_ops.c
index b42cdc0..41968e1 100644
--- a/hw/xfree86/x86emu/prim_ops.c
+++ b/hw/xfree86/x86emu/prim_ops.c
@@ -103,7 +103,7 @@
 #include "x86emu/x86emui.h"
 
 #if defined(__GNUC__)
-# if defined (__i386__) || defined(__i386) || defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__)
+# if defined (__i386__) || defined(__i386) || defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__) || defined(__x86_64__)
 #  include "x86emu/prim_x86_gcc.h"
 # endif
 #endif
diff --git a/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h b/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h
index af61e20..5a443cd 100644
--- a/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h
+++ b/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h
@@ -42,7 +42,7 @@
 
 #include "x86emu/types.h"
 
-#if !defined(__GNUC__) || !(defined (__i386__) || defined(__i386) || defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__))
+#if !defined(__GNUC__) || !(defined (__i386__) || defined(__i386) || defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__) || defined(__x86_64__))
 #error This file is intended to be used by gcc on i386 or x86-64 system
 #endif
 
diff --git a/hw/xfree86/x86emu/x86emu/types.h b/hw/xfree86/x86emu/x86emu/types.h
index c0c09c1..2d41b0f 100644
--- a/hw/xfree86/x86emu/x86emu/types.h
+++ b/hw/xfree86/x86emu/x86emu/types.h
@@ -75,7 +75,7 @@
     defined(__sparc64__) || \
     defined(__s390x__) || \
     (defined(__hppa__) && defined(__LP64)) || \
-    defined(__amd64__) || defined(amd64) || \
+    defined(__amd64__) || defined(amd64) || defined(__x86_64__) || \
     (defined(__sgi) && (_MIPS_SZLONG == 64))
 #define NUM32 int
 #else
diff --git a/hw/xprint/ps/psout.h b/hw/xprint/ps/psout.h
index 3e19d5a..1138e4a 100644
--- a/hw/xprint/ps/psout.h
+++ b/hw/xprint/ps/psout.h
@@ -169,7 +169,7 @@ typedef signed __int64    PsOutColor;
      defined(ia64) || defined(__ia64__) || \
      defined(__sparc64__) || defined(_LP64) || \
      defined(__s390x__) || \
-     defined(amd64) || defined (__amd64__) || \
+     defined(amd64) || defined (__amd64__) || defined(__x86_64__) || \
      defined (__powerpc64__) || \
      (defined(sgi) && (_MIPS_SZLONG == 64))
 typedef signed long       PsOutColor;
diff --git a/include/servermd.h b/include/servermd.h
index 2f511da..6168410 100644
--- a/include/servermd.h
+++ b/include/servermd.h
@@ -393,7 +393,7 @@ SOFTWARE.
 
 #endif /* ia64 */
 
-#if defined(__amd64__) || defined(amd64) || defined(__amd64)
+#if defined(__amd64__) || defined(amd64) || defined(__amd64) || defined(__x86_64__)
 # define IMAGE_BYTE_ORDER	LSBFirst
 
 # if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
diff --git a/mi/micoord.h b/mi/micoord.h
index 16d0861..876e88c 100644
--- a/mi/micoord.h
+++ b/mi/micoord.h
@@ -48,7 +48,7 @@
     defined(__alpha) || defined(__alpha__) || \
     defined(__i386__) || defined(__i386) || defined(__ia64__) || \
     defined(__s390x__) || defined(__s390__) || \
-    defined(__amd64__) || defined(amd64) || defined(__amd64)
+    defined(__amd64__) || defined(amd64) || defined(__amd64) || defined(__x86_64__)
 #define GetHighWord(x) (((int) (x)) >> 16)
 #else
 #define GetHighWord(x) (((int) (x)) / 65536)
commit d2f44719336a800a3c9e7ba4c772f74615e91530
Author: Tilman Sauerbeck <tilman at code-monkey.de>
Date:   Thu Apr 10 21:36:19 2008 +0200

    Fixed configure.ac for autoconf 2.62.

diff --git a/configure.ac b/configure.ac
index 1e48b07..3d9598e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1555,7 +1555,11 @@ if test "x$XORG" = xyes -o "x$XGL" = xyes; then
 	abi_xinput=`extract_abi XINPUT`
 	abi_extension=`extract_abi EXTENSION`
 	abi_font=`extract_abi FONT`
-	AC_SUBST([abi_ansic abi_videodrv abi_xinput abi_extension abi_font])
+	AC_SUBST([abi_ansic])
+	AC_SUBST([abi_videodrv])
+	AC_SUBST([abi_xinput])
+	AC_SUBST([abi_extension])
+	AC_SUBST([abi_font])
 fi
 AM_CONDITIONAL([XORG], [test "x$XORG" = xyes])
 AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes])
@@ -2094,7 +2098,9 @@ DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"
 
 AC_SUBST([DIX_CFLAGS])
 
-AC_SUBST([libdir exec_prefix prefix])
+AC_SUBST([libdir])
+AC_SUBST([exec_prefix])
+AC_SUBST([prefix])
 
 # Man page sections - used in config utils & generating man pages
 XORG_MANPAGE_SECTIONS
commit 099d1bef220700c5db6e6f01226690a15eab2ea5
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Fri Feb 22 11:01:51 2008 +1030

    dix: Call DeleteInputDeviceRequest from CloseDownDevices (#14418)
    
    The DDX (xfree86 anyway) maintains its own device list in addition to the one
    in the DIX. CloseDevice will only remove it from the DIX, not the DDX. If the
    server then restarts (last client disconnects), the DDX devices are still
    there, will be re-initialised, then the hal devices come in and are added too.
    This repeats until we run out of device ids.
    
    This also requires us to strdup() the default pointer/keyboard in
    checkCoreInputDevices.
    
    X.Org Bug 14418 <http://bugs.freedesktop.org/show_bug.cgi?id=14418>
    (cherry picked from commit 6d22a9615a0e6ab3d00b0bcb22ff001b6ece02ae)

diff --git a/dix/devices.c b/dix/devices.c
index 4b20655..5a726af 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -618,12 +618,12 @@ CloseDownDevices(void)
     for (dev = inputInfo.devices; dev; dev = next)
     {
 	next = dev->next;
-	CloseDevice(dev);
+        DeleteInputDeviceRequest(dev);
     }
     for (dev = inputInfo.off_devices; dev; dev = next)
     {
 	next = dev->next;
-	CloseDevice(dev);
+        DeleteInputDeviceRequest(dev);
     }
     inputInfo.devices = NULL;
     inputInfo.off_devices = NULL;
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 208e23d..3cc04f0 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1338,8 +1338,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     /* 5. Built-in default. */
     if (!foundPointer) {
 	bzero(&defPtr, sizeof(defPtr));
-	defPtr.inp_identifier = "<default pointer>";
-	defPtr.inp_driver = "mouse";
+	defPtr.inp_identifier = strdup("<default pointer>");
+	defPtr.inp_driver = strdup("mouse");
 	confInput = &defPtr;
 	foundPointer = TRUE;
 	from = X_DEFAULT;
@@ -1385,8 +1385,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     if (!found) {
 	xf86Msg(X_INFO, "No default mouse found, adding one\n");
 	bzero(&defPtr, sizeof(defPtr));
-	defPtr.inp_identifier = "<default pointer>";
-	defPtr.inp_driver = "mouse";
+	defPtr.inp_identifier = strdup("<default pointer>");
+	defPtr.inp_driver = strdup("mouse");
 	confInput = &defPtr;
 	foundPointer = configInput(&Pointer, confInput, from);
         if (foundPointer) {
@@ -1474,8 +1474,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     /* 5. Built-in default. */
     if (!foundKeyboard) {
 	bzero(&defKbd, sizeof(defKbd));
-	defKbd.inp_identifier = "<default keyboard>";
-	defKbd.inp_driver = "kbd";
+	defKbd.inp_identifier = strdup("<default keyboard>");
+	defKbd.inp_driver = strdup("kbd");
 	confInput = &defKbd;
 	foundKeyboard = TRUE;
 	keyboardMsg = "default keyboard configuration";
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index eafc0e9..d34238e 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -446,11 +446,19 @@ void
 DeleteInputDeviceRequest(DeviceIntPtr pDev)
 {
     LocalDevicePtr pInfo = (LocalDevicePtr) pDev->public.devicePrivate;
-    InputDriverPtr drv = pInfo->drv;
-    IDevRec *idev = pInfo->conf_idev;
+    InputDriverPtr drv;
+    IDevRec *idev;
 
+    if (pInfo) /* need to get these before RemoveDevice */
+    {
+        drv = pInfo->drv;
+        idev = pInfo->conf_idev;
+    }
     RemoveDevice(pDev);
 
+    if (!pInfo) /* VCP and VCK */
+        return;
+
     if(drv->UnInit)
         drv->UnInit(drv, pInfo, 0);
     else
commit 566037a914742ed3299dc24a18e828920b531293
Author: Dave Airlie <airlied at linux.ie>
Date:   Wed Apr 9 14:27:58 2008 +1000

    quirk: add quirk for ACR 640x350 default mode is wrong
    
    RH #440186
    (cherry picked from commit b19027fbaea4c3a146926e862983e0e3411fff3d)

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index f2814f3..bf0ea3f 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -93,6 +93,12 @@ static Bool quirk_prefer_large_60 (int scrnIndex, xf86MonPtr DDC)
 	DDC->vendor.prod_id == 638)
 	return TRUE;
 
+    /* Acer F51 */
+    if (memcmp (DDC->vendor.name, "API", 4) == 0 &&
+	DDC->vendor.prod_id == 0x7602)
+	return TRUE;
+
+
     return FALSE;
 }
 
commit 032732270851ec2a12fc36e421f7335a2bd6ec34
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Wed Apr 9 13:37:59 2008 +0200

    Fix off-by-one error in ProcXResQueryClients().
    
    Fixes memory corruption reported at
    http://bugs.freedesktop.org/show_bug.cgi?id=14004 .
    (cherry picked from commit 0d1746995d91b55e40f233f0c38b56bafe896d38)

diff --git a/Xext/xres.c b/Xext/xres.c
index 9bd70c6..f444c4e 100644
--- a/Xext/xres.c
+++ b/Xext/xres.c
@@ -64,7 +64,7 @@ ProcXResQueryClients (ClientPtr client)
 
     REQUEST_SIZE_MATCH(xXResQueryClientsReq);
 
-    current_clients = xalloc((currentMaxClients - 1) * sizeof(int));
+    current_clients = xalloc(currentMaxClients * sizeof(int));
 
     num_clients = 0;
     for(i = 0; i < currentMaxClients; i++) {


More information about the xorg-commit mailing list