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

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Wed May 14 01:16:11 PDT 2008


 Xext/panoramiX.c                             |   33 ++++++----
 Xext/panoramiXsrv.h                          |   10 +++
 hw/kdrive/src/kdrive.c                       |    6 -
 hw/xquartz/X11Application.m                  |   21 +++---
 hw/xquartz/bundle/Makefile.am                |    2 
 hw/xquartz/darwin.c                          |    1 
 hw/xquartz/mach-startup/bundle-main.c        |   75 +++++++++++++++++++++--
 hw/xquartz/mach-startup/mach_startup_types.h |    4 -
 hw/xquartz/mach-startup/stub.c               |   85 +++++++++++++++++++++++++--
 xkb/ddxLoad.c                                |    2 
 10 files changed, 197 insertions(+), 42 deletions(-)

New commits:
commit 800db31e165beb130f2eb7ea4c86cbd7dbf3ecf6
Merge: f8929b9... ce1f6de...
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed May 14 01:15:43 2008 -0700

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

commit f8929b9e5b8a58fd1f728082090e38f597ff8eb4
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed May 14 01:13:15 2008 -0700

    XQuartz: More work on the Mach-IPC startup path
    (cherry picked from commit 49cd0b185fd6c99b07357a74734b6a4023faca84)

diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index a66afa8..cd64e42 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -73,7 +73,26 @@ kern_return_t do_start_x11_server(mach_port_t port, string_array_t argv,
                                   mach_msg_type_number_t argvCnt,
                                   string_array_t envp,
                                   mach_msg_type_number_t envpCnt) {
-    if(server_main(argvCnt - 1, argv, envp) == 0)
+    /* And now back to char ** */
+    char **_argv = alloca((argvCnt + 1) * sizeof(char *));
+    char **_envp = alloca((envpCnt + 1) * sizeof(char *));
+    size_t i;
+
+    if(!_argv || !_envp) {
+        return KERN_FAILURE;
+    }
+
+    for(i=0; i < argvCnt; i++) {
+        _argv[i] = argv[i];
+    }
+    _argv[argvCnt] = NULL;
+
+    for(i=0; i < envpCnt; i++) {
+        _envp[i] = envp[i];
+    }
+    _envp[envpCnt] = NULL;
+    
+    if(server_main(argvCnt, _argv, _envp) == 0)
         return KERN_SUCCESS;
     else
         return KERN_FAILURE;
@@ -212,20 +231,38 @@ int main(int argc, char **argv, char **envp) {
 #ifdef NEW_LAUNCH_METHOD
         kern_return_t kr;
         mach_port_t mp;
-        
-        sleep(2);
+        string_array_t newenvp;
+        string_array_t newargv;
 
         /* We need to count envp */
         int envpc;
         for(envpc=0; envp[envpc]; envpc++);
 
+        /* We have fixed-size string lengths due to limitations in IPC,
+         * so we need to copy our argv and envp.
+         */
+        newargv = (string_array_t)alloca(argc * sizeof(string_t));
+        newenvp = (string_array_t)alloca(envpc * sizeof(string_t));
+        
+        if(!newargv || !newenvp) {
+            fprintf(stderr, "Memory allocation failure\n");
+            exit(EXIT_FAILURE);
+        }
+        
+        for(i=0; i < argc; i++) {
+            strlcpy(newargv[i], argv[i], STRING_T_SIZE);
+        }
+        for(i=0; i < envpc; i++) {
+            strlcpy(newenvp[i], envp[i], STRING_T_SIZE);
+        }
+
         kr = bootstrap_look_up(bootstrap_port, SERVER_BOOTSTRAP_NAME, &mp);
         if (kr != KERN_SUCCESS) {
             fprintf(stderr, "bootstrap_look_up(): %s\n", bootstrap_strerror(kr));
             exit(EXIT_FAILURE);
         }
 
-        kr = start_x11_server(mp, argv, argc + 1, envp, envpc + 1);
+        kr = start_x11_server(mp, newargv, argc, newenvp, envpc);
         if (kr != KERN_SUCCESS) {
             fprintf(stderr, "start_x11_server: %s\n", mach_error_string(kr));
             exit(EXIT_FAILURE);
diff --git a/hw/xquartz/mach-startup/mach_startup_types.h b/hw/xquartz/mach-startup/mach_startup_types.h
index 03939af..97ac147 100644
--- a/hw/xquartz/mach-startup/mach_startup_types.h
+++ b/hw/xquartz/mach-startup/mach_startup_types.h
@@ -2,7 +2,9 @@
 #define _MACH_STARTUP_TYPES_H_
 
 #define SERVER_BOOTSTRAP_NAME "org.x.X11"
+#define STRING_T_SIZE 1024
 
-typedef char ** string_array_t;
+typedef char string_t[STRING_T_SIZE];
+typedef string_t * string_array_t;
 
 #endif
diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c
index ed917cf..fae9720 100644
--- a/hw/xquartz/mach-startup/stub.c
+++ b/hw/xquartz/mach-startup/stub.c
@@ -111,9 +111,10 @@ static void set_x11_path() {
 int main(int argc, char **argv, char **envp) {
 #ifdef NEW_LAUNCH_METHOD_2
     int envpc;
-    char *newargv[3];
     kern_return_t kr;
     mach_port_t mp;
+    string_array_t newenvp;
+    string_array_t newargv;
 #endif
 
     if(argc == 2 && !strcmp(argv[1], "-version")) {
@@ -137,10 +138,11 @@ int main(int argc, char **argv, char **envp) {
         }
 
         if(child == 0) {
-            newargv[0] = x11_path;
-            newargv[1] = "--listenonly";
-            newargv[2] = NULL;
-            return execvp(x11_path, newargv);
+            char *_argv[3];
+            _argv[0] = x11_path;
+            _argv[1] = "--listenonly";
+            _argv[2] = NULL;
+            return execvp(x11_path, _argv);
         }
 
         /* Try connecting for 10 seconds */
@@ -160,7 +162,25 @@ int main(int argc, char **argv, char **envp) {
     /* Count envp */
     for(envpc=0; envp[envpc]; envpc++);
     
-    kr = start_x11_server(mp, argv, argc + 1, envp, envpc + 1);
+    /* We have fixed-size string lengths due to limitations in IPC,
+     * so we need to copy our argv and envp.
+     */
+    newargv = (string_array_t)alloca(argc * sizeof(string_t));
+    newenvp = (string_array_t)alloca(envpc * sizeof(string_t));
+    
+    if(!newargv || !newenvp) {
+        fprintf(stderr, "Memory allocation failure\n");
+        exit(EXIT_FAILURE);
+    }
+    
+    for(i=0; i < argc; i++) {
+        strlcpy(newargv[i], argv[i], STRING_T_SIZE);
+    }
+    for(i=0; i < envpc; i++) {
+        strlcpy(newenvp[i], envp[i], STRING_T_SIZE);
+    }
+
+    kr = start_x11_server(mp, newargv, argc, newenvp, envpc);
     if (kr != KERN_SUCCESS) {
         fprintf(stderr, "start_x11_server: %s\n", mach_error_string(kr));
         return EXIT_FAILURE;
commit 4160d13b48ce4c7659d325e7ba9639830fab7a88
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Tue May 13 10:40:20 2008 -0700

    Xquartz: More work on the new Mach startup
    (cherry picked from commit 6237acf75d3310d7d4f262556b677557c2907284)

diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index b0ff9df..a66afa8 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -34,9 +34,12 @@
 #include <string.h>
 #include <stdlib.h>
 #include <pthread.h>
+#include <stdbool.h>
 
 #include <CoreFoundation/CoreFoundation.h>
 
+#include <asl.h>
+
 #include <mach/mach.h>
 #include <mach/mach_error.h>
 #include <servers/bootstrap.h>
@@ -70,7 +73,7 @@ kern_return_t do_start_x11_server(mach_port_t port, string_array_t argv,
                                   mach_msg_type_number_t argvCnt,
                                   string_array_t envp,
                                   mach_msg_type_number_t envpCnt) {
-    if(server_main(argvCnt, argv, envp) == 0)
+    if(server_main(argvCnt - 1, argv, envp) == 0)
         return KERN_SUCCESS;
     else
         return KERN_FAILURE;
@@ -137,7 +140,7 @@ static void startup_trigger_thread(void *arg) {
 }
 
 int main(int argc, char **argv, char **envp) {
-    BOOL listenOnly = FALSE;
+    Bool listen, listenOnly = FALSE;
     int i;
     mach_msg_size_t mxmsgsz = sizeof(union MaxMsgSize) + MAX_TRAILER_SIZE;
     mach_port_t mp;
@@ -151,7 +154,8 @@ int main(int argc, char **argv, char **envp) {
     }
 
     /* TODO: This should be unconditional once we figure out fd passing */
-    if((argc > 1 && argv[1][0] == ':') || listenOnly) {
+    listen = (argc > 1 && argv[1][0] == ':') || listenOnly;
+    if(listen) {
         mp = checkin_or_register(SERVER_BOOTSTRAP_NAME);
     }
 
@@ -160,8 +164,10 @@ int main(int argc, char **argv, char **envp) {
      */
     if(!listenOnly) {
         struct arg *args = (struct arg*)malloc(sizeof(struct arg));
-        if(!args)
-            FatalError("Could not allocate memory.\n");
+        if(!args) {
+            fprintf(stderr, "Memory allocation error.\n");
+            return EXIT_FAILURE;
+        }
 
         args->argc = argc;
         args->argv = argv;
@@ -175,13 +181,13 @@ int main(int argc, char **argv, char **envp) {
      *       file descriptor.  For now, we only listen if we are explicitly
      *       told to.
      */
-    if((argc > 1 && argv[1][0] == ':') || listenOnly) {
+    if(listen) {
         /* Main event loop */
         kr = mach_msg_server(mach_startup_server, mxmsgsz, mp, 0);
         if (kr != KERN_SUCCESS) {
             asl_log(NULL, NULL, ASL_LEVEL_ERR,
                     "org.x.X11(mp): %s\n", mach_error_string(kr));
-            exit(EXIT_FAILURE);
+            return EXIT_FAILURE;
         }
     }
 
@@ -204,11 +210,27 @@ int main(int argc, char **argv, char **envp) {
     /* Take care of the case where we're called like a normal DDX */
     if(argc > 1 && argv[1][0] == ':') {
 #ifdef NEW_LAUNCH_METHOD
+        kern_return_t kr;
+        mach_port_t mp;
+        
+        sleep(2);
+
         /* We need to count envp */
         int envpc;
         for(envpc=0; envp[envpc]; envpc++);
 
-        return start_x11_server(argc, argv, envp, envpc);
+        kr = bootstrap_look_up(bootstrap_port, SERVER_BOOTSTRAP_NAME, &mp);
+        if (kr != KERN_SUCCESS) {
+            fprintf(stderr, "bootstrap_look_up(): %s\n", bootstrap_strerror(kr));
+            exit(EXIT_FAILURE);
+        }
+
+        kr = start_x11_server(mp, argv, argc + 1, envp, envpc + 1);
+        if (kr != KERN_SUCCESS) {
+            fprintf(stderr, "start_x11_server: %s\n", mach_error_string(kr));
+            exit(EXIT_FAILURE);
+        }
+        exit(EXIT_SUCCESS);
 #else
         return server_main(argc, argv, envp);
 #endif
diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c
index 3be5f65..ed917cf 100644
--- a/hw/xquartz/mach-startup/stub.c
+++ b/hw/xquartz/mach-startup/stub.c
@@ -35,10 +35,16 @@
 #include <string.h>
 #include <stdio.h>
 #include <unistd.h>
+#include <errno.h>
 
 #define kX11AppBundleId "org.x.X11"
 #define kX11AppBundlePath "/Contents/MacOS/X11"
 
+#include <mach/mach.h>
+#include <mach/mach_error.h>
+#include <servers/bootstrap.h>
+#include "mach_startup.h"
+
 static char x11_path[PATH_MAX + 1];
 
 static void set_x11_path() {
@@ -102,17 +108,68 @@ static void set_x11_path() {
 #define XSERVER_VERSION "?"
 #endif
 
-int main(int argc, char **argv) {
-    
+int main(int argc, char **argv, char **envp) {
+#ifdef NEW_LAUNCH_METHOD_2
+    int envpc;
+    char *newargv[3];
+    kern_return_t kr;
+    mach_port_t mp;
+#endif
+
     if(argc == 2 && !strcmp(argv[1], "-version")) {
         fprintf(stderr, "X.org Release 7.3\n");
         fprintf(stderr, "X.Org X Server %s\n", XSERVER_VERSION);
         fprintf(stderr, "Build Date: %s\n", BUILD_DATE);
-        return 0;
+        return EXIT_SUCCESS;
     }
+
+#ifdef NEW_LAUNCH_METHOD_2
+    kr = bootstrap_look_up(bootstrap_port, SERVER_BOOTSTRAP_NAME, &mp);
+    if(kr != KERN_SUCCESS) {
+        int i;
+        set_x11_path();
+
+        /* This forking is ugly and will be cleaned up later */
+        pid_t child = fork();
+        if(child == -1) {
+            fprintf(stderr, "Could not fork: %s\n", strerror(errno));
+            return EXIT_FAILURE;
+        }
+
+        if(child == 0) {
+            newargv[0] = x11_path;
+            newargv[1] = "--listenonly";
+            newargv[2] = NULL;
+            return execvp(x11_path, newargv);
+        }
+
+        /* Try connecting for 10 seconds */
+        for(i=0; i < 20; i++) {
+            usleep(500);
+            kr = bootstrap_look_up(bootstrap_port, SERVER_BOOTSTRAP_NAME, &mp);
+            if(kr == KERN_SUCCESS)
+                break;
+        }
+
+        if(kr != KERN_SUCCESS) {
+            fprintf(stderr, "bootstrap_look_up(): %s\n", bootstrap_strerror(kr));
+            return EXIT_FAILURE;
+        }
+    }
+
+    /* Count envp */
+    for(envpc=0; envp[envpc]; envpc++);
     
-    set_x11_path();
+    kr = start_x11_server(mp, argv, argc + 1, envp, envpc + 1);
+    if (kr != KERN_SUCCESS) {
+        fprintf(stderr, "start_x11_server: %s\n", mach_error_string(kr));
+        return EXIT_FAILURE;
+    }
+    return EXIT_SUCCESS;
     
+#else
+    set_x11_path();
     argv[0] = x11_path;
     return execvp(x11_path, argv);
+#endif
 }
commit 02744383d564f62fa7dc12c4a4aae403b381a6f6
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Mon May 12 17:57:07 2008 -0700

    Added missing to EXTRA_DIST
    (cherry picked from commit e39613f4633ed992bc276b70833a703560e528f9)

diff --git a/hw/xquartz/bundle/Makefile.am b/hw/xquartz/bundle/Makefile.am
index a8f45f8..89d04c7 100644
--- a/hw/xquartz/bundle/Makefile.am
+++ b/hw/xquartz/bundle/Makefile.am
@@ -6,6 +6,8 @@ resource_DATA = Xquartz.plist
 
 EXTRA_DIST = \
 	mk_bundke.sh \
+	Info.plist \
+	PkgInfo \
 	$(resource_DATA) \
 	Resources/da.lproj/InfoPlist.strings \
 	Resources/da.lproj/Localizable.strings \
commit 0605c351886cfc0e333bcfb95f9ad5d332c0e4f2
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Mon May 12 13:36:35 2008 -0700

    XQuartz: Cleaned up the about box.
    (cherry picked from commit 0279a5970694937e949ba533330ea48961c4edba)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 691725d..9367c9f 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -143,18 +143,21 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
     NSMutableDictionary *dict;
     NSDictionary *infoDict;
     NSString *tem;
-	
-    dict = [NSMutableDictionary dictionaryWithCapacity:2];
+    
+    dict = [NSMutableDictionary dictionaryWithCapacity:3];
     infoDict = [[NSBundle mainBundle] infoDictionary];
-	
+    
     [dict setObject: NSLocalizedString (@"The X Window System", @"About panel")
-			 forKey:@"ApplicationName"];
-	
+          forKey:@"ApplicationName"];
+    
     tem = [infoDict objectForKey:@"CFBundleShortVersionString"];
-	
-    [dict setObject:[NSString stringWithFormat:@"XQuartz %@ - (xorg-server %s)", tem, XSERVER_VERSION]
-	  forKey:@"ApplicationVersion"];
-	
+    
+    [dict setObject:[NSString stringWithFormat:@"XQuartz %@", tem]
+          forKey:@"ApplicationVersion"];
+
+    [dict setObject:[NSString stringWithFormat:@"xorg-server %s", XSERVER_VERSION]
+          forKey:@"Version"];
+    
     [self orderFrontStandardAboutPanelWithOptions: dict];
 }
 
commit 1c507cb8bf2e0a7dfbb4a79dba0c4db86f3cb3ce
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Mon May 12 11:34:06 2008 -0700

    Don't need the fink-friendly printf in the DDX anymore.
    (cherry picked from commit fe2279440450c795d67ba5a2234b0797d0bfe39c)

diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index f20cce1..4f35533 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -153,7 +153,6 @@ DarwinPrintBanner(void)
 { 
   // this should change depending on which specific server we are building
   ErrorF("Xquartz starting:\n");
-  ErrorF("X.org Release 7.2\n"); // This is here to help fink until they fix their packages.
   ErrorF("X.Org X Server %s\nBuild Date: %s\n", XSERVER_VERSION, BUILD_DATE );
 }
 
commit ce1f6de2e8d5473a8d6995638a7289fdc8f6dc4b
Author: Alan Coopersmith <alan.coopersmith at 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 at 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
+ * screen 0.
+ */
+typedef Bool (*XineramaVisualsEqualProcPtr)(VisualPtr, ScreenPtr, VisualPtr);
+extern XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr;
+
 extern void XineramaGetImageData(
     DrawablePtr *pDrawables,
     int left,
commit f2278a882f26a3176110241b65b3bead9b08110f
Author: Julien Cristau <jcristau at debian.org>
Date:   Sun May 11 23:17:27 2008 +0200

    kdrive: allow disabling Composite
    
    KdInitOutput() used to enable Composite when it was disabled by default,
    but now this hack prevents ``-extension Composite'' from working.
    Remove it, as Composite is enabled by default anyway.
    (cherry picked from commit 9dfb525f6c91acab5d1a65765a046bf9ee2aa082)

diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 50148c4..e2ee4ad 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -1353,12 +1353,6 @@ KdInitOutput (ScreenInfo    *pScreenInfo,
     KdCardInfo	    *card;
     KdScreenInfo    *screen;
 
-#ifdef COMPOSITE
-    /* kind of a hack: we want Composite enabled, but it's disabled per
-     * default. */
-    noCompositeExtension = FALSE;
-#endif
-    
     if (!kdCardInfo)
     {
 	InitCard (0);


More information about the xorg-commit mailing list