xserver: Branch 'master' - 8 commits

Keith Packard keithp at kemper.freedesktop.org
Thu Jun 2 16:48:15 PDT 2011


 hw/xquartz/GL/indirect.c            |   20 +++++++++++++-------
 hw/xquartz/X11Application.m         |    2 +-
 hw/xquartz/darwin.c                 |    6 ++++--
 hw/xquartz/darwin.h                 |    6 ++++--
 hw/xquartz/mach-startup/Makefile.am |    3 ++-
 hw/xquartz/pbproxy/app-main.m       |   11 +++++++++++
 hw/xquartz/pbproxy/pbproxy.h        |   15 ++++++++-------
 hw/xquartz/pbproxy/x-selection.m    |   27 +++++++++++++++++++++++++++
 hw/xquartz/xpr/xpr.h                |    5 +++++
 hw/xquartz/xpr/xprCursor.c          |    1 -
 hw/xquartz/xpr/xprEvent.c           |    1 -
 hw/xquartz/xpr/xprScreen.c          |    1 -
 12 files changed, 75 insertions(+), 23 deletions(-)

New commits:
commit 48b4b778f61daaa161483b510ab520f3fcb84925
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Wed Jun 1 21:55:06 2011 -0700

    XQuartz: xpbproxy: Correct NSUInteger format strings
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/pbproxy/x-selection.m b/hw/xquartz/pbproxy/x-selection.m
index 7964f51..b5f4dde 100644
--- a/hw/xquartz/pbproxy/x-selection.m
+++ b/hw/xquartz/pbproxy/x-selection.m
@@ -683,7 +683,11 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato
 	return;
     }
 
+#ifdef __LP64__
+    DebugF ("pbtypes retainCount after containsObject: %lu\n", [pbtypes retainCount]);
+#else
     DebugF ("pbtypes retainCount after containsObject: %u\n", [pbtypes retainCount]);
+#endif
 
     data = [pb stringForType:NSStringPboardType];
 
@@ -704,7 +708,11 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato
 	
 	if (length < 50) {
 	    DebugF ("UTF-8: %s\n", bytes);
+#ifdef __LP64__
+	    DebugF ("UTF-8 length: %lu\n", length); 
+#else
 	    DebugF ("UTF-8 length: %u\n", length); 
+#endif
 	}
     } 
     else 
@@ -1223,8 +1231,13 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato
 	return;
     }
 
+#ifdef __LP64__
+    DebugF ("data retainCount before NSBitmapImageRep initWithData: %lu\n",
+	[data retainCount]);
+#else
     DebugF ("data retainCount before NSBitmapImageRep initWithData: %u\n",
 	[data retainCount]);
+#endif
 
     bmimage = [[NSBitmapImageRep alloc] initWithData:data];
 
@@ -1235,8 +1248,13 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato
 	return;
     }
 
+#ifdef __LP64__
+    DebugF ("data retainCount after NSBitmapImageRep initWithData: %lu\n", 
+	[data retainCount]);
+#else
     DebugF ("data retainCount after NSBitmapImageRep initWithData: %u\n", 
 	[data retainCount]);
+#endif
 
     @try 
     {
@@ -1251,7 +1269,11 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato
 	return;
     }
     
+#ifdef __LP64__
+    DebugF ("bmimage retainCount after TIFFRepresentation %lu\n", [bmimage retainCount]);
+#else
     DebugF ("bmimage retainCount after TIFFRepresentation %u\n", [bmimage retainCount]);
+#endif
 
     pbtypes = [NSArray arrayWithObjects:NSTIFFPboardType, nil];
 
@@ -1270,7 +1292,12 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato
 
     [data autorelease];
 
+#ifdef __LP64__
+    DebugF ("bmimage retainCount before release %lu\n", [bmimage retainCount]);
+#else
     DebugF ("bmimage retainCount before release %u\n", [bmimage retainCount]);
+#endif
+
     [bmimage autorelease];
 }
 
commit 971193b2750b98b28597ba194ed388e79b3489b6
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Wed Jun 1 21:18:03 2011 -0700

    XQuartz: ASL: Use xpbproxy subsystem for logging xpbproxy messages
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/pbproxy/app-main.m b/hw/xquartz/pbproxy/app-main.m
index a8c3a60..772c458 100644
--- a/hw/xquartz/pbproxy/app-main.m
+++ b/hw/xquartz/pbproxy/app-main.m
@@ -63,6 +63,17 @@ ErrorF(const char * f, ...)
     va_end(args);
 }
 
+/* TODO: Have this actually log to ASL */
+void xq_asl_log (int level, const char *subsystem, const char *file, const char *function, int line, const char *fmt, ...) {
+#ifdef DEBUG
+    va_list args;
+
+    va_start(args, fmt);
+    vfprintf(stderr, fmt, args);
+    va_end(args);
+#endif
+}
+
 int main (int argc, const char *argv[]) {
     const char *s;
     int i;
diff --git a/hw/xquartz/pbproxy/pbproxy.h b/hw/xquartz/pbproxy/pbproxy.h
index fcbf4c4..c80a660 100644
--- a/hw/xquartz/pbproxy/pbproxy.h
+++ b/hw/xquartz/pbproxy/pbproxy.h
@@ -32,6 +32,8 @@
 
 #import  <Foundation/Foundation.h>
 
+#include <asl.h>
+
 #include <AvailabilityMacros.h>
 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
 #if __LP64__ || NS_BUILD_32_LIKE_64
@@ -80,13 +82,12 @@ extern BOOL xpbproxy_input_register (void);
 /* os/log.c or app-main.m */
 extern void ErrorF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2);
 
-#ifdef DEBUG
-/* BEWARE: this can cause a string memory leak, according to the leaks program. */
-# define DebugF(msg, args...) ErrorF("%s:%s:%d " msg, __FILE__, __FUNCTION__, __LINE__, ##args)
-#else
-# define DebugF(...) /* */
-#endif
+/* from darwin.h */
+_X_ATTRIBUTE_PRINTF(6,7)
+extern void xq_asl_log (int level, const char *subsystem, const char *file, const char *function, int line, const char *fmt, ...);
 
-#define TRACE() DebugF("TRACE\n")
+#define ASL_LOG(level, subsystem, msg, args...) xq_asl_log(level, subsystem, __FILE__, __FUNCTION__, __LINE__, msg, ##args)
+#define DebugF(msg, args...) ASL_LOG(ASL_LEVEL_DEBUG, "xpbproxy", msg, ##args)
+#define TRACE() DebugF("TRACE")
 
 #endif /* PBPROXY_H */
commit 7dfd65705ccd3c6e2458d6892282520fe5ed8a6b
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Wed Jun 1 21:06:53 2011 -0700

    XQuartz: ASL: Use GLXAqua subsystem for logging GLXAqua messages
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index d15b9a3..c41840b 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -155,12 +155,8 @@ typedef long long GLint64EXT;
 
 __GLXprovider * GlxGetDRISWrastProvider (void);
 
-// Write debugging output, or not
-#ifdef GLAQUA_DEBUG
-#define GLAQUA_DEBUG_MSG ErrorF
-#else
-#define GLAQUA_DEBUG_MSG(a, ...)
-#endif
+#include "darwin.h"
+#define GLAQUA_DEBUG_MSG(msg, args...) ASL_LOG(ASL_LEVEL_DEBUG, "GLXAqua", msg, ##args)
 
 static void setup_dispatch_table(void);
 GLuint __glFloorLog2(GLuint val);
commit 19020b23efa15d72349bd833aebddcc64780a615
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Wed Jun 1 21:06:08 2011 -0700

    XQuartz: ASL: Use xpr subsystem for logging xpr messages
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/xpr/xpr.h b/hw/xquartz/xpr/xpr.h
index ebd89de..0b138dd 100644
--- a/hw/xquartz/xpr/xpr.h
+++ b/hw/xquartz/xpr/xpr.h
@@ -33,6 +33,11 @@
 #include "screenint.h"
 #include <Xplugin.h>
 
+#include "darwin.h"
+
+#undef DEBUG_LOG
+#define DEBUG_LOG(msg, args...) ASL_LOG(ASL_LEVEL_DEBUG, "xpr", msg, ##args)
+
 Bool QuartzModeBundleInit(void);
 
 void AppleDRIExtensionInit(void);
diff --git a/hw/xquartz/xpr/xprCursor.c b/hw/xquartz/xpr/xprCursor.c
index 216678e..2b31865 100644
--- a/hw/xquartz/xpr/xprCursor.c
+++ b/hw/xquartz/xpr/xprCursor.c
@@ -37,7 +37,6 @@
 
 #include "quartz.h"
 #include "xpr.h"
-#include "darwin.h"
 #include "darwinEvents.h"
 #include <Xplugin.h>
 
diff --git a/hw/xquartz/xpr/xprEvent.c b/hw/xquartz/xpr/xprEvent.c
index cc86c47..4e7ece6 100644
--- a/hw/xquartz/xpr/xprEvent.c
+++ b/hw/xquartz/xpr/xprEvent.c
@@ -44,7 +44,6 @@
 #include   "scrnintstr.h"
 #include   "mipointer.h"
 
-#include "darwin.h"
 #include "quartz.h"
 #include "quartzKeyboard.h"
 #include "darwinEvents.h"
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 98250e6..002355e 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -40,7 +40,6 @@
 #include "xpr.h"
 #include "xprEvent.h"
 #include "pseudoramiX.h"
-#include "darwin.h"
 #include "darwinEvents.h"
 #include "rootless.h"
 #include "dri.h"
commit a66400f8dba9b7c5b65f9d26996fff677c42d866
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Wed Jun 1 20:45:58 2011 -0700

    XQuartz: ASL: Update logging to support differnet levels and subsystems
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index fa8d4ce..29ab836 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -79,7 +79,7 @@
 
 aslclient aslc;
 
-void debug_asl (const char *file, const char *function, int line, const char *fmt, ...) {
+void xq_asl_log (int level, const char *subsystem, const char *file, const char *function, int line, const char *fmt, ...) {
     va_list args;
     aslmsg msg = asl_new(ASL_TYPE_MSG);
 
@@ -93,10 +93,12 @@ void debug_asl (const char *file, const char *function, int line, const char *fm
             asl_set(msg, "Line", _line);
             free(_line);
         }
+        if(subsystem)
+            asl_set(msg, "Subsystem", subsystem);
     }
 
     va_start(args, fmt);
-    asl_vlog(aslc, msg, ASL_LEVEL_DEBUG, fmt, args);
+    asl_vlog(aslc, msg, level, fmt, args);
     va_end(args);
 
     if(msg)
diff --git a/hw/xquartz/darwin.h b/hw/xquartz/darwin.h
index 659de43..aafc12f 100644
--- a/hw/xquartz/darwin.h
+++ b/hw/xquartz/darwin.h
@@ -76,9 +76,11 @@ extern int              darwinMainScreenY;
 // bundle-main.c
 extern char *bundle_id_prefix;
 
-extern void debug_asl (const char *file, const char *function, int line, const char *fmt, ...) _X_ATTRIBUTE_PRINTF(4,5);
+_X_ATTRIBUTE_PRINTF(6,7)
+extern void xq_asl_log (int level, const char *subsystem, const char *file, const char *function, int line, const char *fmt, ...);
 
-#define DEBUG_LOG(msg, args...) debug_asl(__FILE__, __FUNCTION__, __LINE__, msg, ##args);
+#define ASL_LOG(level, subsystem, msg, args...) xq_asl_log(level, subsystem, __FILE__, __FUNCTION__, __LINE__, msg, ##args)
+#define DEBUG_LOG(msg, args...) ASL_LOG(ASL_LEVEL_DEBUG, "XQuartz", msg, ##args)
 #define TRACE() DEBUG_LOG("TRACE")
 
 #endif  /* _DARWIN_H */
commit c0077b41b4c8bb08129db97a2a01d0af55d13fa4
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Wed Jun 1 20:54:27 2011 -0700

    XQuartz: Add a semicolon after DEBUG_LOG
    
    Don't rely on the macro to provide it
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 7c41cbc..a51ee82 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -188,7 +188,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
 
 - (void) activateX:(OSX_BOOL)state {
     size_t i;
-    DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active)
+    DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active);
     if (state) {
         if(bgMouseLocationUpdated) {
             DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, bgMouseLocation.x, bgMouseLocation.y, 0.0, 0.0, 0.0);
commit fbc8aae8e9b5c7b175073f02e79d7ff1d1363a31
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sun May 29 01:20:44 2011 -0700

    XQuartz: Move -lXplugin to LDFLAGS from LDADD
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/mach-startup/Makefile.am b/hw/xquartz/mach-startup/Makefile.am
index 1ce54ad..4b7b2bc 100644
--- a/hw/xquartz/mach-startup/Makefile.am
+++ b/hw/xquartz/mach-startup/Makefile.am
@@ -22,9 +22,10 @@ X11_bin_LDADD = \
 	$(top_builddir)/dix/dixfonts.lo \
 	$(top_builddir)/miext/rootless/librootless.la \
 	$(top_builddir)/hw/xquartz/pbproxy/libxpbproxy.la \
-	$(DARWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) -lXplugin
+	$(DARWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS)
 
 X11_bin_LDFLAGS =  \
+	$(XSERVER_SYS_LIBS) -lXplugin \
 	-XCClinker -Objc \
 	-Wl,-u,_miDCInitialize \
 	-Wl,-framework,Carbon \
commit 38df706c6b8a339c4267cae7be0881c4362f36da
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Tue May 31 13:01:05 2011 -0700

    XQuartz: GLX: Create a new dispatch table rather than modifying the existing one
    
    Fixes regression introduced by b0c665ac0fe6840dda581e4d0d0b76c703d62a7b
    
    0   X11.bin                       	0x0000000100118293 __glXAquaScreenCreateContext + 684
    1   X11.bin                       	0x00000001001315b0 DoCreateContext + 163
    2   X11.bin                       	0x000000010013509f __glXDispatch + 211
    3   X11.bin                       	0x00000001000c7dad Dispatch + 785
    4   X11.bin                       	0x00000001000b97e5 dix_main + 1022
    5   X11.bin                       	0x00000001000122bc server_thread + 50
    6   libSystem.B.dylib             	0x00007fff836554f6 _pthread_start + 331
    7   libSystem.B.dylib             	0x00007fff836553a9 thread_start + 13
    
    http://lists.apple.com/archives/X11-users/2011/May/msg00045.html
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index 6da27c7..d15b9a3 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -666,7 +666,15 @@ GLuint __glFloorLog2(GLuint val)
 }
 
 static void setup_dispatch_table(void) {
-    struct _glapi_table *disp=_glapi_get_dispatch();
+    static struct _glapi_table *disp = NULL;
+
+    if(disp)  {
+        _glapi_set_dispatch(disp);
+        return;
+    }
+
+    disp=calloc(1,sizeof(struct _glapi_table));
+    assert(disp);
 
     /* to update:
      * for f in $(grep 'define SET_' ../../../glx/dispatch.h  | cut -f2 -d' ' | cut -f1 -d\( | sort -u); do grep -q $f indirect.c || echo $f ; done | grep -v by_offset | sed 's:SET_\(.*\)$:SET_\1(disp, gl\1)\;:' | pbcopy
@@ -1610,4 +1618,6 @@ static void setup_dispatch_table(void) {
     SET_PixelTexGenParameterivSGIS(disp, glPixelTexGenParameterivSGIS);
     SET_PixelTexGenSGIX(disp, glPixelTexGenSGIX);
 #endif
+
+    _glapi_set_dispatch(disp);
 }


More information about the xorg-commit mailing list