xserver: Branch 'master' - 4 commits
Jeremy Huddleston
jeremyhu at kemper.freedesktop.org
Sun Jan 11 01:58:08 PST 2009
configure.ac | 2 +
hw/xquartz/bundle/Info.plist.cpp | 4 +-
hw/xquartz/darwin.c | 11 +++++++
hw/xquartz/darwinEvents.c | 3 +-
hw/xquartz/mach-startup/Makefile.am | 1
hw/xquartz/quartzKeyboard.c | 2 -
hw/xquartz/xpr/xprCursor.c | 27 +++---------------
hw/xquartz/xpr/xprScreen.c | 4 ++
mi/mieq.c | 54 ++++++++++++++++++++++++++++++++++++
mi/mipointer.c | 12 ++++++++
10 files changed, 91 insertions(+), 29 deletions(-)
New commits:
commit 5339c22a8ca8bce6cd2b51e97c904292e7c40e74
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Sun Jan 11 01:56:45 2009 -0800
XQuartz: Add locking to make mieq thread safe on OSX
(cherry picked from commit 7a8d2266861e74176b5310b83652a9c10a170494)
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 9a94831..0d864db 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -115,7 +115,8 @@ void darwinEvents_lock(void) {
}
}
-static inline void darwinEvents_unlock(void) {
+void darwinEvents_unlock(void);
+void darwinEvents_unlock(void) {
int err;
if((err = pthread_mutex_unlock(&mieq_lock))) {
ErrorF("%s:%s:%d: Failed to unlock mieq_lock: %d\n",
diff --git a/mi/mieq.c b/mi/mieq.c
index 82bbb2c..d6b722d 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -36,6 +36,11 @@ in this Software without prior written authorization from The Open Group.
#include <dix-config.h>
#endif
+#ifdef XQUARTZ
+#include <pthread.h>
+static pthread_mutex_t miEventQueueMutex = PTHREAD_MUTEX_INITIALIZER;
+#endif
+
# include <X11/X.h>
# include <X11/Xmd.h>
# include <X11/Xproto.h>
@@ -138,6 +143,9 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
int isMotion = 0;
int evlen;
+#ifdef XQUARTZ
+ pthread_mutex_lock(&miEventQueueMutex);
+#endif
/* avoid merging events from different devices */
if (e->u.u.type == MotionNotify)
@@ -156,6 +164,10 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
lastkbp = (deviceKeyButtonPointer *) laste->events->event;
if (laste->nevents > 6) {
+#ifdef XQUARTZ
+ pthread_mutex_unlock(&miEventQueueMutex);
+#endif
+
ErrorF("[mi] mieqEnqueue: more than six valuator events; dropping.\n");
return;
}
@@ -167,11 +179,17 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
lastkbp->type == ProximityOut) ||
((lastkbp->deviceid & DEVICE_BITS) !=
(v->deviceid & DEVICE_BITS))) {
+#ifdef XQUARTZ
+ pthread_mutex_unlock(&miEventQueueMutex);
+#endif
ErrorF("[mi] mieqEnequeue: out-of-order valuator event; dropping.\n");
return;
}
memcpy((laste->events[laste->nevents++].event), e, sizeof(xEvent));
+#ifdef XQUARTZ
+ pthread_mutex_unlock(&miEventQueueMutex);
+#endif
return;
}
@@ -191,6 +209,9 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
xorg_backtrace();
stuck = 1;
}
+#ifdef XQUARTZ
+ pthread_mutex_unlock(&miEventQueueMutex);
+#endif
return;
}
stuck = 0;
@@ -208,6 +229,9 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
if (!evt->event)
{
ErrorF("[mi] Running out of memory. Tossing event.\n");
+#ifdef XQUARTZ
+ pthread_mutex_unlock(&miEventQueueMutex);
+#endif
return;
}
}
@@ -228,24 +252,39 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
miEventQueue.lastMotion = isMotion;
miEventQueue.tail = (oldtail + 1) % QUEUE_SIZE;
+#ifdef XQUARTZ
+ pthread_mutex_unlock(&miEventQueueMutex);
+#endif
}
void
mieqSwitchScreen(DeviceIntPtr pDev, ScreenPtr pScreen, Bool fromDIX)
{
+#ifdef XQUARTZ
+ pthread_mutex_lock(&miEventQueueMutex);
+#endif
EnqueueScreen(pDev) = pScreen;
if (fromDIX)
DequeueScreen(pDev) = pScreen;
+#ifdef XQUARTZ
+ pthread_mutex_unlock(&miEventQueueMutex);
+#endif
}
void
mieqSetHandler(int event, mieqHandler handler)
{
+#ifdef XQUARTZ
+ pthread_mutex_lock(&miEventQueueMutex);
+#endif
if (handler && miEventQueue.handlers[event])
ErrorF("[mi] mieq: warning: overriding existing handler %p with %p for "
"event %d\n", miEventQueue.handlers[event], handler, event);
miEventQueue.handlers[event] = handler;
+#ifdef XQUARTZ
+ pthread_mutex_unlock(&miEventQueueMutex);
+#endif
}
/**
@@ -317,6 +356,10 @@ mieqProcessInputEvents(void)
DeviceIntPtr dev = NULL,
master = NULL;
+#ifdef XQUARTZ
+ pthread_mutex_lock(&miEventQueueMutex);
+#endif
+
while (miEventQueue.head != miEventQueue.tail) {
e = &miEventQueue.events[miEventQueue.head];
@@ -340,6 +383,10 @@ mieqProcessInputEvents(void)
miEventQueue.head = (miEventQueue.head + 1) % QUEUE_SIZE;
+#ifdef XQUARTZ
+ pthread_mutex_unlock(&miEventQueueMutex);
+#endif
+
type = event->u.u.type;
master = (!dev->isMaster && dev->u.master) ? dev->u.master : NULL;
@@ -389,6 +436,13 @@ mieqProcessInputEvents(void)
/* Update the sprite now. Next event may be from different device. */
if (type == DeviceMotionNotify && (master || dev->isMaster))
miPointerUpdateSprite(dev);
+
+#ifdef XQUARTZ
+ pthread_mutex_lock(&miEventQueueMutex);
+#endif
}
+#ifdef XQUARTZ
+ pthread_mutex_unlock(&miEventQueueMutex);
+#endif
}
diff --git a/mi/mipointer.c b/mi/mipointer.c
index 4358759..83a355e 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -547,6 +547,12 @@ miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y)
*y = MIPOINTER(pDev)->y;
}
+#ifdef XQUARTZ
+#include <pthread.h>
+void darwinEvents_lock(void);
+void darwinEvents_unlock(void);
+#endif
+
void
miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
@@ -573,7 +579,13 @@ miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
nevents = GetPointerEvents(events, pDev, MotionNotify, 0, POINTER_ABSOLUTE, 0, 2, valuators);
OsBlockSignals();
+#ifdef XQUARTZ
+ darwinEvents_lock();
+#endif
for (i = 0; i < nevents; i++)
mieqEnqueue(pDev, events[i].event);
+#ifdef XQUARTZ
+ darwinEvents_unlock();
+#endif
OsReleaseSignals();
}
commit 1beff89810cd193e45d437846929b3938cee6d96
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Sun Jan 11 01:55:26 2009 -0800
XQuartz: misc 1.6 updates (still --disable-glx)
rlAccel is not longer compatable, and it's not worth fixing
Don't override DeviceCursorInitialize with a noop
Don't do a SwitchCoreKeyboard (which wasn't even needed in the first place)
(cherry picked from commit c137f681680e1d04b1513a8be68aeda4d1c56fd5)
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 07b243b..c104589 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -510,6 +510,17 @@ void InitInput( int argc, char **argv )
darwinTabletEraser->name = strdup("eraser");
darwinTabletCurrent = darwinTabletStylus;
+
+ ActivateDevice(darwinKeyboard);
+ ActivateDevice(darwinPointer);
+ ActivateDevice(darwinTabletStylus);
+ ActivateDevice(darwinTabletCursor);
+ ActivateDevice(darwinTabletEraser);
+ EnableDevice(darwinKeyboard);
+ EnableDevice(darwinPointer);
+ EnableDevice(darwinTabletStylus);
+ EnableDevice(darwinTabletCursor);
+ EnableDevice(darwinTabletEraser);
DarwinEQInit();
diff --git a/hw/xquartz/mach-startup/Makefile.am b/hw/xquartz/mach-startup/Makefile.am
index bbad10a..40060d0 100644
--- a/hw/xquartz/mach-startup/Makefile.am
+++ b/hw/xquartz/mach-startup/Makefile.am
@@ -18,7 +18,6 @@ X11_bin_LDADD = \
$(top_builddir)/hw/xquartz/xpr/libXquartzXpr.la \
$(top_builddir)/dix/dixfonts.lo \
$(top_builddir)/miext/rootless/librootless.la \
- $(top_builddir)/miext/rootless/accel/librlAccel.la \
$(top_builddir)/hw/xquartz/pbproxy/libxpbproxy.la \
$(DARWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) -lXplugin
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index f78facb..72f94b4 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -362,8 +362,6 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOn);
}
- // TODO: What do we do now in 1.6?
- //SwitchCoreKeyboard(pDev);
DarwinKeyboardSetDeviceKeyMap(&keySyms);
}
diff --git a/hw/xquartz/xpr/xprCursor.c b/hw/xquartz/xpr/xprCursor.c
index bf1a6e8..4345bee 100644
--- a/hw/xquartz/xpr/xprCursor.c
+++ b/hw/xquartz/xpr/xprCursor.c
@@ -239,7 +239,6 @@ QuartzSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x,
}
}
-
/*
* QuartzMoveCursor
* Move the cursor. This is a noop for us.
@@ -249,25 +248,6 @@ QuartzMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
}
-/* TODO: New for 1.6 ... probably noop */
-static Bool QuartzDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) {
- return TRUE;
-}
-
-/* TODO: New for 1.6 ... probably noop */
-static void QuartzDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) {
-}
-
-static miPointerSpriteFuncRec quartzSpriteFuncsRec = {
- QuartzRealizeCursor,
- QuartzUnrealizeCursor,
- QuartzSetCursor,
- QuartzMoveCursor,
- QuartzDeviceCursorInitialize,
- QuartzDeviceCursorCleanup
-};
-
-
/*
===========================================================================
@@ -387,13 +367,16 @@ QuartzInitCursor(ScreenPtr pScreen)
PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey);
ScreenPriv->spriteFuncs = PointPriv->spriteFuncs;
- PointPriv->spriteFuncs = &quartzSpriteFuncsRec;
+ PointPriv->spriteFuncs->RealizeCursor = QuartzRealizeCursor;
+ PointPriv->spriteFuncs->UnrealizeCursor = QuartzUnrealizeCursor;
+ PointPriv->spriteFuncs->SetCursor = QuartzSetCursor;
+ PointPriv->spriteFuncs->MoveCursor = QuartzMoveCursor;
+
ScreenPriv->cursorVisible = TRUE;
return TRUE;
}
-
/*
* QuartzSuspendXCursor
* X server is hiding. Restore the Aqua cursor.
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 52fb9c9..da262f6 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -364,7 +364,9 @@ xprSetupScreen(int index, ScreenPtr pScreen)
{
// Initialize accelerated rootless drawing
// Note that this must be done before DamageSetup().
- RootlessAccelInit(pScreen);
+
+ // These are crashing ugly... better to be stable and not crash for now.
+ //RootlessAccelInit(pScreen);
#ifdef DAMAGE
// The Damage extension needs to wrap underneath the
commit 2d917cfe56af1e74205f80ddbaddfb5c6ce82f0a
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Sat Jan 10 01:39:08 2009 -0800
Apple: Don't use DRI2
(cherry picked from commit a1d35cee5907a76977ee43c49cb55c8f411c9794)
diff --git a/configure.ac b/configure.ac
index ae455de..54afc39 100644
--- a/configure.ac
+++ b/configure.ac
@@ -636,6 +636,8 @@ AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes])
dnl XQuartz DDX Detection... Yes, it's ugly to have it here... but we need to handle this early on
case $host_os in
darwin*)
+ DRI2=no
+
if test x$XQUARTZ = xauto; then
AC_CACHE_CHECK([whether to build Xquartz],xorg_cv_Carbon_framework,[
save_LDFLAGS=$LDFLAGS
commit 7a8abb9c8554d7967d912dcd427804f65906dc5c
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Tue Jan 6 15:32:44 2009 -0800
XQuartz: Bundle version 2.4.0
(cherry picked from commit 3a3ccf5354e4275abe9d01f41a92602df5d690dc)
diff --git a/hw/xquartz/bundle/Info.plist.cpp b/hw/xquartz/bundle/Info.plist.cpp
index 47018fd..1f9b3ae 100644
--- a/hw/xquartz/bundle/Info.plist.cpp
+++ b/hw/xquartz/bundle/Info.plist.cpp
@@ -19,9 +19,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>2.3.2</string>
+ <string>2.4.0</string>
<key>CFBundleVersion</key>
- <string>2.3.2</string>
+ <string>2.4.0</string>
<key>CFBundleSignature</key>
<string>x11a</string>
<key>CSResourcesFileMapped</key>
More information about the xorg-commit
mailing list