xserver: Branch 'master' - 12 commits

Keith Packard keithp at kemper.freedesktop.org
Mon Feb 22 13:39:33 PST 2010


 Xi/exevents.c                            |   13 ++-
 Xi/setmode.c                             |   10 ++
 composite/compwindow.c                   |    2 
 dix/events.c                             |   15 +--
 exa/exa_migration_mixed.c                |   48 +++++++-----
 glx/glthread.c                           |    2 
 hw/dmx/examples/xinput.c                 |    2 
 hw/kdrive/src/kdrive.c                   |    2 
 hw/xfree86/common/xf86Init.c             |    2 
 hw/xfree86/modes/xf86Crtc.c              |    3 
 hw/xfree86/os-support/solaris/sun_bell.c |    5 -
 hw/xfree86/parser/scan.c                 |   16 ++--
 hw/xfree86/x86emu/validate.c             |    2 
 hw/xfree86/x86emu/x86emu/prim_x86_gcc.h  |    6 -
 hw/xquartz/GL/capabilities.c             |    2 
 include/dix.h                            |    6 -
 include/eventconvert.h                   |    6 -
 include/os.h                             |    2 
 miext/damage/damage.c                    |   10 +-
 miext/rootless/rootlessWindow.c          |    2 
 os/log.c                                 |    4 -
 os/utils.c                               |   12 +++
 record/record.c                          |  123 +++++++++++++++++--------------
 23 files changed, 176 insertions(+), 119 deletions(-)

New commits:
commit 93ff1bc5884cdfca1132af7fbc06c48e06f218c8
Author: Simon Farnsworth <simon.farnsworth at onelan.co.uk>
Date:   Mon Feb 15 14:18:00 2010 +0200

    Always enable outputs that have been forced on in the configuration file
    
    If the user has gone to the effort of manually enabling an output in
    the configuration file assume that they know what they're doing.
    
    X.org Bug 14611 <http://bugs.freedesktop.org/show_bug.cgi?id=14611>
    
    Signed-off-by: Simon Farnsworth <simon.farnsworth at onelan.co.uk>
    Reviewed-by: Alex Deucher <alexdeucher at gmail.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 573fe96..9b1ff28 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1573,7 +1573,8 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
 	 */
 	output->status = (*output->funcs->detect)(output);
 
-	if (output->status == XF86OutputStatusDisconnected)
+	if (output->status == XF86OutputStatusDisconnected &&
+		!xf86ReturnOptValBool(output->options, OPTION_ENABLE, FALSE))
 	{
 	    xf86OutputSetEDID (output, NULL);
 	    continue;
commit ca9c2472d74c7107ccc117e2c9c723c168d2eccf
Merge: e40ba57... 02d1116...
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Feb 22 13:26:06 2010 -0800

    Merge remote branch 'whot/for-keith'

commit e40ba5798c367bec584f6437b23d2c5f801fd013
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Feb 18 15:49:09 2010 +1000

    Xi: assume BadMode for non-BadMatch errors returned from SetDeviceMode.
    
    The XI protocol spec only allows for two errors on the SetDeviceMode
    requests: BadMatch or BadMode. BadMode however is a dynamically assigned
    extension error and the driver doesn't have access to the actual error
    number. Hence, if a SetDeviceMode driver returns an error other than
    BadMatch, assume BadMode.
    
    The two exceptions are BadAlloc and BadImplementations, pass these on to the
    client (any request is allowed to return either of those).
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/Xi/setmode.c b/Xi/setmode.c
index 51e5767..ce2ad47 100644
--- a/Xi/setmode.c
+++ b/Xi/setmode.c
@@ -112,7 +112,17 @@ ProcXSetDeviceMode(ClientPtr client)
     if (rep.status == Success)
 	dev->valuator->mode = stuff->mode;
     else if (rep.status != AlreadyGrabbed)
+    {
+	switch(rep.status) {
+	    case BadMatch:
+	    case BadImplementation:
+	    case BadAlloc:
+		break;
+	    default:
+		rep.status = BadMode;
+	}
 	return rep.status;
+    }
 
     WriteReplyToClient(client, sizeof(xSetDeviceModeReply), &rep);
     return Success;
commit 02d1116e7eb84068fa32477f1640d29b0a81b638
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Jan 11 16:35:36 2010 +1000

    Xi: assume BadMode for non-BadMatch errors returned from SetDeviceMode.
    
    The XI protocol spec only allows for two errors on the SetDeviceMode
    requests: BadMatch or BadMode. BadMode however is a dynamically assigned
    extension error and the driver doesn't have access to the actual error
    number. Hence, if a SetDeviceMode driver returns an error other than
    BadMatch, assume BadMode.
    
    The two exceptions are BadAlloc and BadImplementations, pass these on to the
    client (any request is allowed to return either of those).
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>

diff --git a/Xi/setmode.c b/Xi/setmode.c
index 51e5767..ce2ad47 100644
--- a/Xi/setmode.c
+++ b/Xi/setmode.c
@@ -112,7 +112,17 @@ ProcXSetDeviceMode(ClientPtr client)
     if (rep.status == Success)
 	dev->valuator->mode = stuff->mode;
     else if (rep.status != AlreadyGrabbed)
+    {
+	switch(rep.status) {
+	    case BadMatch:
+	    case BadImplementation:
+	    case BadAlloc:
+		break;
+	    default:
+		rep.status = BadMode;
+	}
 	return rep.status;
+    }
 
     WriteReplyToClient(client, sizeof(xSetDeviceModeReply), &rep);
     return Success;
commit 122fc0e7a0712df4ec2bd9ca6773f90bcd2095cf
Author: Chris Dekter <cdekter at gmail.com>
Date:   Thu Feb 11 16:34:09 2010 +1000

    Re-enable RECORD extension.
    
    RECORD was disabled during the switch to internal events. This patch
    modifies the record callback to work with internal events instead of
    xEvents. The InternalEvents are converted to core/Xi events as needed.
    
    Since record is a loadable extension, the EventTo* calls must be externed.
    
    Signed-off-by: Chris Dekter <cdekter at gmail.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index ee32ba8..a63b65b 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1051,16 +1051,19 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
             break;
     }
 
-#if 0
-    /* FIXME: I'm broken. Please fix me. Thanks */
     if (DeviceEventCallback) {
 	DeviceEventInfoRec eventinfo;
+	SpritePtr pSprite = device->spriteInfo->sprite;
 
-	eventinfo.events = (xEventPtr) xE;
-	eventinfo.count = count;
+	/* see comment in EnqueueEvents regarding the next three lines */
+	if (ev->any.type == ET_Motion)
+	    ev->device_event.root = WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id;
+
+	eventinfo.device = device;
+	eventinfo.event = ev;
 	CallCallbacks(&DeviceEventCallback, (pointer) & eventinfo);
     }
-#endif
+
     grab = device->deviceGrab.grab;
 
     switch(event->type)
diff --git a/dix/events.c b/dix/events.c
index 85c8f9a..c085a75 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1131,11 +1131,10 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
         event->type == ET_KeyRelease)
 	AccessXCancelRepeatKey(device->key->xkbInfo, event->detail.key);
 
-#if 0
-        /* FIXME: I'm broken now. Please fix me. */
     if (DeviceEventCallback)
     {
 	DeviceEventInfoRec eventinfo;
+
 	/*  The RECORD spec says that the root window field of motion events
 	 *  must be valid.  At this point, it hasn't been filled in yet, so
 	 *  we do it here.  The long expression below is necessary to get
@@ -1145,14 +1144,14 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
 	 *  the data that GetCurrentRootWindow relies on hasn't been
 	 *  updated yet.
 	 */
-	if (xE->u.u.type == DeviceMotionNotify)
-	    XE_KBPTR.root =
-		WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id;
-	eventinfo.events = xE;
-	eventinfo.count = nevents;
+	if (ev->any.type == ET_Motion)
+	    ev->device_event.root = WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id;
+
+	eventinfo.event = ev;
+	eventinfo.device = device;
 	CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo);
     }
-#endif
+
     if (event->type == ET_Motion)
     {
 #ifdef PANORAMIX
diff --git a/include/dix.h b/include/dix.h
index ed3acb6..6505fd0 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -576,8 +576,8 @@ typedef struct {
 extern _X_EXPORT CallbackListPtr DeviceEventCallback;
 
 typedef struct {
-    xEventPtr events;
-    int count;
+    InternalEvent *event;
+    DeviceIntPtr device;
 } DeviceEventInfoRec;
 
 extern int XItoCoreType(int xi_type);
@@ -585,7 +585,7 @@ extern Bool DevHasCursor(DeviceIntPtr pDev);
 extern Bool _X_EXPORT IsPointerDevice( DeviceIntPtr dev);
 extern Bool _X_EXPORT IsKeyboardDevice(DeviceIntPtr dev);
 extern Bool IsPointerEvent(InternalEvent *event);
-extern Bool IsMaster(DeviceIntPtr dev);
+extern _X_EXPORT Bool IsMaster(DeviceIntPtr dev);
 
 extern _X_HIDDEN void CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
 extern _X_HIDDEN int CorePointerProc(DeviceIntPtr dev, int what);
diff --git a/include/eventconvert.h b/include/eventconvert.h
index 277a6c4..b1196a0 100644
--- a/include/eventconvert.h
+++ b/include/eventconvert.h
@@ -30,9 +30,9 @@
 
 #define FP1616(integral, frac) ((integral) * (1 << 16) + (frac) * (1 << 16))
 
-_X_INTERNAL int EventToCore(InternalEvent *event, xEvent *core);
-_X_INTERNAL int EventToXI(InternalEvent *ev, xEvent **xi, int *count);
-_X_INTERNAL int EventToXI2(InternalEvent *ev, xEvent **xi);
+_X_EXPORT int EventToCore(InternalEvent *event, xEvent *core);
+_X_EXPORT int EventToXI(InternalEvent *ev, xEvent **xi, int *count);
+_X_EXPORT int EventToXI2(InternalEvent *ev, xEvent **xi);
 _X_INTERNAL int GetCoreType(InternalEvent* ev);
 _X_INTERNAL int GetXIType(InternalEvent* ev);
 _X_INTERNAL int GetXI2Type(InternalEvent* ev);
diff --git a/record/record.c b/record/record.c
index 242544f..1a10c9e 100644
--- a/record/record.c
+++ b/record/record.c
@@ -42,6 +42,8 @@ and Jim Haggerty of Metheus.
 #include "set.h"
 #include "swaprep.h"
 #include "inputstr.h"
+#include "eventconvert.h"
+
 
 #include <stdio.h>
 #include <assert.h>
@@ -139,7 +141,8 @@ static int RecordDeleteContext(
     XID /*id*/
 );
 
-
+void RecordExtensionInit(void);
+
 /***************************************************************************/
 
 /* client private stuff */
@@ -727,6 +730,59 @@ RecordADeliveredEventOrError(CallbackListPtr *pcbl, pointer nulldata, pointer ca
 } /* RecordADeliveredEventOrError */
 
 
+static void
+RecordSendProtocolEvents(RecordClientsAndProtocolPtr pRCAP,
+			RecordContextPtr pContext,
+			xEvent* pev, int count)
+{
+    int ev; /* event index */
+
+    for (ev = 0; ev < count; ev++, pev++)
+    {
+	if (RecordIsMemberOfSet(pRCAP->pDeviceEventSet,
+		    pev->u.u.type & 0177))
+	{
+	    xEvent swappedEvent;
+	    xEvent *pEvToRecord = pev;
+#ifdef PANORAMIX
+	    xEvent shiftedEvent;
+
+	    if (!noPanoramiXExtension &&
+		    (pev->u.u.type == MotionNotify ||
+		     pev->u.u.type == ButtonPress ||
+		     pev->u.u.type == ButtonRelease ||
+		     pev->u.u.type == KeyPress ||
+		     pev->u.u.type == KeyRelease)) {
+		int scr = XineramaGetCursorScreen(inputInfo.pointer);
+		memcpy(&shiftedEvent, pev, sizeof(xEvent));
+		shiftedEvent.u.keyButtonPointer.rootX +=
+		    panoramiXdataPtr[scr].x -
+		    panoramiXdataPtr[0].x;
+		shiftedEvent.u.keyButtonPointer.rootY +=
+		    panoramiXdataPtr[scr].y -
+		    panoramiXdataPtr[0].y;
+		pEvToRecord = &shiftedEvent;
+	    }
+#endif /* PANORAMIX */
+
+	    if (pContext->pRecordingClient->swapped)
+	    {
+		(*EventSwapVector[pEvToRecord->u.u.type & 0177])
+		    (pEvToRecord, &swappedEvent);
+		pEvToRecord = &swappedEvent;
+	    }
+
+	    RecordAProtocolElement(pContext, NULL,
+		    XRecordFromServer,  pEvToRecord, SIZEOF(xEvent), 0);
+	    /* make sure device events get flushed in the absence
+	     * of other client activity
+	     */
+	    SetCriticalOutputPending();
+	}
+    } /* end for each event */
+
+} /* RecordADeviceEvent */
+
 /* RecordADeviceEvent
  *
  * Arguments:
@@ -756,55 +812,24 @@ RecordADeviceEvent(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
 	{
 	    if (pRCAP->pDeviceEventSet)
 	    {
-		int ev; /* event index */
-		xEvent *pev = pei->events;
-		for (ev = 0; ev < pei->count; ev++, pev++)
-		{
-		    if (RecordIsMemberOfSet(pRCAP->pDeviceEventSet,
-					    pev->u.u.type & 0177))
-		    {
-		        xEvent swappedEvent;
-		        xEvent *pEvToRecord = pev;
-#ifdef PANORAMIX
-		        xEvent shiftedEvent;
-
-			if (!noPanoramiXExtension &&
-			    (pev->u.u.type == MotionNotify ||
-			     pev->u.u.type == ButtonPress ||
-			     pev->u.u.type == ButtonRelease ||
-			     pev->u.u.type == KeyPress ||
-			     pev->u.u.type == KeyRelease)) {
-				int scr = XineramaGetCursorScreen(inputInfo.pointer);
-				memcpy(&shiftedEvent, pev, sizeof(xEvent));
-				shiftedEvent.u.keyButtonPointer.rootX +=
-				    panoramiXdataPtr[scr].x - 
-					panoramiXdataPtr[0].x;
-				shiftedEvent.u.keyButtonPointer.rootY +=
-				    panoramiXdataPtr[scr].y -
-					panoramiXdataPtr[0].y;
-				pEvToRecord = &shiftedEvent;
-			}
-#endif /* PANORAMIX */
+		int count;
+		xEvent *xi_events = NULL;
 
-			if (pContext->pRecordingClient->swapped)
-			{
-			    (*EventSwapVector[pEvToRecord->u.u.type & 0177])
-				(pEvToRecord, &swappedEvent);
-			    pEvToRecord = &swappedEvent;
-			}
+		/* TODO check return values */
+		if (IsMaster(pei->device))
+		{
+		    xEvent xE;
+		    EventToCore(pei->event, &xE);
+		    RecordSendProtocolEvents(pRCAP, pContext, &xE, 1);
+		}
 
-			RecordAProtocolElement(pContext, NULL,
-			   XRecordFromServer,  pEvToRecord, SIZEOF(xEvent), 0);
-			/* make sure device events get flushed in the absence
-			 * of other client activity
-			 */
-			SetCriticalOutputPending();
-		    }
-		} /* end for each event */
+		EventToXI(pei->event, &xi_events, &count);
+		RecordSendProtocolEvents(pRCAP, pContext, xi_events, count);
+		xfree(xi_events);
 	    } /* end this RCAP selects device events */
 	} /* end for each RCAP on this context */
     } /* end for each enabled context */
-} /* RecordADeviceEvent */
+}
 
 
 /* RecordFlushAllContexts
@@ -2866,13 +2891,6 @@ RecordCloseDown(ExtensionEntry *extEntry)
 void 
 RecordExtensionInit(void)
 {
-    /* FIXME Record is currently broken. Dont initialize it so that clients
-     * that require it can bail out correctly rather than waiting for stuff
-     * that'll never happen */
-    ErrorF("record: RECORD extension enabled at configure time.\n");
-    ErrorF("record: This extension is known to be broken, disabling extension now..\n");
-    ErrorF("record: http://bugs.freedesktop.org/show_bug.cgi?id=20500\n");
-#if 0
     ExtensionEntry *extentry;
 
     RTContext = CreateNewResourceType(RecordDeleteContext, "RecordContext");
@@ -2895,6 +2913,5 @@ RecordExtensionInit(void)
     }
     RecordErrorBase = extentry->errorBase;
 
-#endif
 } /* RecordExtensionInit */
 
commit 03ef00ae79687046dc9f9987857062a16ff2c2e0
Author: Michel Dänzer <daenzer at vmware.com>
Date:   Wed Feb 17 11:40:44 2010 +0100

    EXA/mixed: Clean up exaPrepareAccessReg_mixed() a little.
    
    Signed-off-by: Michel Dänzer <daenzer at vmware.com>
    Acked-by: Maarten Maathuis <madman2003 at gmail.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
index d200917..fb47151 100644
--- a/exa/exa_migration_mixed.c
+++ b/exa/exa_migration_mixed.c
@@ -165,10 +165,12 @@ void
 exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
 {
     ExaPixmapPriv(pPixmap);
+    Bool has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
     Bool success;
 
-    if ((success = ExaDoPrepareAccess(pPixmap, index)) &&
-	    pExaPixmap->pDamage && exaPixmapHasGpuCopy(pPixmap)) {
+    success = ExaDoPrepareAccess(pPixmap, index);
+
+    if (success && has_gpu_copy && pExaPixmap->pDamage) {
 	/* You cannot do accelerated operations while a buffer is mapped. */
 	exaFinishAccess(&pPixmap->drawable, index);
 	/* Update the gpu view of both deferred destination pixmaps and of
@@ -176,10 +178,24 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
 	 */
 	exaMoveInPixmap_mixed(pPixmap);
 	success = ExaDoPrepareAccess(pPixmap, index);
+
+	if (success) {
+	    /* We have a gpu pixmap that can be accessed, we don't need the cpu
+	     * copy anymore. Drivers that prefer DFS, should fail prepare
+	     * access.
+	     */
+	    DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
+	    DamageDestroy(pExaPixmap->pDamage);
+	    pExaPixmap->pDamage = NULL;
+
+	    free(pExaPixmap->sys_ptr);
+	    pExaPixmap->sys_ptr = NULL;
+
+	    return;
+	}
     }
 
     if (!success) {
-	Bool has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
 	ExaMigrationRec pixmaps[1];
 
 	/* Do we need to allocate our system buffer? */
@@ -240,15 +256,6 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
 	pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
 	pPixmap->devKind = pExaPixmap->sys_pitch;
 	pExaPixmap->use_gpu_copy = FALSE;
-    /* We have a gpu pixmap that can be accessed, we don't need the cpu copy
-     * anymore. Drivers that prefer DFS, should fail prepare access. */
-    } else if (pExaPixmap->pDamage && exaPixmapHasGpuCopy(pPixmap)) {
-	DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
-	DamageDestroy(pExaPixmap->pDamage);
-	pExaPixmap->pDamage = NULL;
-
-	free(pExaPixmap->sys_ptr);
-	pExaPixmap->sys_ptr = NULL;
     }
 }
 
commit 9623daad7c864d46b0dfcbb6e689820b96cc8115
Author: Maarten Maathuis <madman2003 at gmail.com>
Date:   Wed Feb 17 11:40:43 2010 +0100

    exa/mixed: fix gnome-panel corruption
    
    - A mapped pixmap can't be used for acceleration, any decent memory manager
    will refuse this.
    - Source pixmaps migrated with a bounding region are incomplete (from the
    gpu point of view), so do the upload unconditionally, instead of just for
    deferred destination pixmaps.
    - Fixes fd.o bug #26076.
    
    Signed-off-by: Maarten Maathuis <madman2003 at gmail.com>
    Acked-by: Michel Dänzer <michel at daenzer.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
index 6816e6c..d200917 100644
--- a/exa/exa_migration_mixed.c
+++ b/exa/exa_migration_mixed.c
@@ -165,8 +165,20 @@ void
 exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
 {
     ExaPixmapPriv(pPixmap);
+    Bool success;
+
+    if ((success = ExaDoPrepareAccess(pPixmap, index)) &&
+	    pExaPixmap->pDamage && exaPixmapHasGpuCopy(pPixmap)) {
+	/* You cannot do accelerated operations while a buffer is mapped. */
+	exaFinishAccess(&pPixmap->drawable, index);
+	/* Update the gpu view of both deferred destination pixmaps and of
+	 * source pixmaps that were migrated with a bounding region.
+	 */
+	exaMoveInPixmap_mixed(pPixmap);
+	success = ExaDoPrepareAccess(pPixmap, index);
+    }
 
-    if (!ExaDoPrepareAccess(pPixmap, index)) {
+    if (!success) {
 	Bool has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
 	ExaMigrationRec pixmaps[1];
 
@@ -231,13 +243,6 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
     /* We have a gpu pixmap that can be accessed, we don't need the cpu copy
      * anymore. Drivers that prefer DFS, should fail prepare access. */
     } else if (pExaPixmap->pDamage && exaPixmapHasGpuCopy(pPixmap)) {
-	ExaScreenPriv(pPixmap->drawable.pScreen);
-
-	/* Copy back any deferred content if needed. */
-	if (pExaScr->deferred_mixed_pixmap &&
-	    pExaScr->deferred_mixed_pixmap == pPixmap)
-	    exaMoveInPixmap_mixed(pPixmap);
-
 	DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
 	DamageDestroy(pExaPixmap->pDamage);
 	pExaPixmap->pDamage = NULL;
commit 5b9a52be7e975e59e0bbc6b43539ecaff96b2ecd
Author: Rami Ylimaki <ext-rami.ylimaki at nokia.com>
Date:   Thu Jan 28 11:08:34 2010 +0200

    os: Prevent core dump from being truncated.
    
    The problem fixed by this patch can be reproduced on Linux with the
    following steps.
    - Access NULL pointer intentionally in ProcessOtherEvent on key press.
    - Instead of saving core dump to a file, write it into a pipe.
      echo "|/usr/sbin/my-core-dumper" > /proc/sys/kernel/core_pattern
    - Dump the core by pressing a key.
    
    While the core is being dumped into the pipe, the smart schedule timer
    will cause a pending SIGALRM. Linux kernel stops writing data to the
    pipe when there are pending signals. This causes the core dump to be
    truncated. On my system I'm expecting a 6 MB dump but the size will be
    60 kB instead. The problem is solved if we block the SIGALRM caused by
    expired smart schedule timer.
    
    I haven't been able to reproduce this problem in the following cases.
    - Save core dump to a file instead of a pipe.
    - kill -SEGV `pidof Xorg`
    - Press a key to dump core while gdb is attached to Xorg.
    - Give option -dumbSched to Xorg.
    
    Also note that the fix works only when NoTrapSignals has the default
    value FALSE. The problem can still be reproduced if error signals
    aren't trapped. In addition to pending SIGALRM, there is a similar
    problem with pending SIGIO from the keyboard driver during core dump.
    
    Signed-off-by: Rami Ylimaki <ext-rami.ylimaki at nokia.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/composite/compwindow.c b/composite/compwindow.c
index c10cb9e..f2f6ea3 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -205,7 +205,7 @@ compPositionWindow (WindowPtr pWin, int x, int y)
 #ifdef COMPOSITE_DEBUG
     if ((pWin->redirectDraw != RedirectDrawNone) !=
 	(pWin->viewable && (GetCompWindow(pWin) != NULL)))
-	abort ();
+	OsAbort ();
 #endif
     if (pWin->redirectDraw != RedirectDrawNone)
     {
diff --git a/glx/glthread.c b/glx/glthread.c
index 4caaea1..8b9f618 100644
--- a/glx/glthread.c
+++ b/glx/glthread.c
@@ -129,7 +129,7 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
 _X_EXPORT unsigned long
 _glthread_GetID(void)
 {
-   abort();   /* XXX not implemented yet */
+   OsAbort();   /* XXX not implemented yet */
    return (unsigned long) 0;
 }
 
diff --git a/hw/dmx/examples/xinput.c b/hw/dmx/examples/xinput.c
index 74353a9..7421be3 100644
--- a/hw/dmx/examples/xinput.c
+++ b/hw/dmx/examples/xinput.c
@@ -233,7 +233,7 @@ int main(int argc, char **argv)
         int         total = 0;
 
 #define ADD(type)                                     \
-        if (cnt >= MAX_EVENTS) abort();               \
+        if (cnt >= MAX_EVENTS) OsAbort();             \
         names[cnt] = #type;                           \
         type(dev, event_type[cnt], event_list[cnt]);  \
         if (event_type[cnt]) ++cnt
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 7675c1e..1902ab8 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -335,7 +335,7 @@ AbortDDX(void)
     }
 
     if (kdCaughtSignal)
-        abort();
+        OsAbort();
 }
 
 void
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 2c206ff..72241a7 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1235,7 +1235,7 @@ ddxGiveUp(void)
 
     /* If an unexpected signal was caught, dump a core for debugging */
     if (xf86Info.caughtSignal)
-	abort();
+	OsAbort();
 }
 
 
diff --git a/hw/xquartz/GL/capabilities.c b/hw/xquartz/GL/capabilities.c
index 4306404..5f1f870 100644
--- a/hw/xquartz/GL/capabilities.c
+++ b/hw/xquartz/GL/capabilities.c
@@ -522,7 +522,7 @@ bool getGlCapabilities(struct glCapabilities *cap) {
 	    conf = malloc(sizeof(*conf));
 	    if(NULL == conf) {
             perror("malloc");
-            abort();
+            OsAbort();
 	    }
 
 	    /* Copy the struct. */
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index b7ec92a..2851aed 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -1705,7 +1705,7 @@ damageRemoveDamage (DamagePtr *pPrev, DamagePtr pDamage)
     }
 #if DAMAGE_VALIDATE_ENABLE
     ErrorF ("Damage not on list\n");
-    abort ();
+    OsAbort ();
 #endif
 }
 
@@ -1718,7 +1718,7 @@ damageInsertDamage (DamagePtr *pPrev, DamagePtr pDamage)
     for (pOld = *pPrev; pOld; pOld = pOld->pNext)
 	if (pOld == pDamage) {
 	    ErrorF ("Damage already on list\n");
-	    abort ();
+	    OsAbort ();
 	}
 #endif
     pDamage->pNext = *pPrev;
@@ -1971,7 +1971,7 @@ DamageRegister (DrawablePtr pDrawable,
     if (pDrawable->pScreen != pDamage->pScreen)
     {
 	ErrorF ("DamageRegister called with mismatched screens\n");
-	abort ();
+	OsAbort ();
     }
 #endif
 
@@ -1986,7 +1986,7 @@ DamageRegister (DrawablePtr pDrawable,
 	for (pOld = *pPrev; pOld; pOld = pOld->pNextWin)
 	    if (pOld == pDamage) {
 		ErrorF ("Damage already on window list\n");
-		abort ();
+		OsAbort ();
 	    }
 #endif
 	pDamage->pNextWin = *pPrev;
@@ -2040,7 +2040,7 @@ DamageUnregister (DrawablePtr	    pDrawable,
 #if DAMAGE_VALIDATE_ENABLE
 	if (!found) {
 	    ErrorF ("Damage not on window list\n");
-	    abort ();
+	    OsAbort ();
 	}
 #endif
     }
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index 5320956..e78e2c8 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -978,7 +978,7 @@ StartFrameResize(WindowPtr pWin, Bool gravity,
                 copy_rect.y2 = oldY2;
             }
             else
-                abort();
+                OsAbort();
 
             Bpp = winRec->win->drawable.bitsPerPixel / 8;
             copy_rect_width = copy_rect.x2 - copy_rect.x1;
diff --git a/os/log.c b/os/log.c
index 03dc11f..0002e59 100644
--- a/os/log.c
+++ b/os/log.c
@@ -413,7 +413,7 @@ AbortServer(void)
     AbortDDX();
     fflush(stderr);
     if (CoreDump)
-	abort();
+	OsAbort();
     exit (1);
 }
 
@@ -537,7 +537,7 @@ FatalError(const char *f, ...)
 	beenhere = TRUE;
 	AbortServer();
     } else
-	abort();
+	OsAbort();
     /*NOTREACHED*/
 }
 
commit ca364ca82a760d8e5347a6f9f79636c9a5e4e03f
Author: Rami Ylimaki <ext-rami.ylimaki at nokia.com>
Date:   Thu Jan 28 11:08:33 2010 +0200

    os: Introduce OsAbort for proper core dumps.
    
    Signed-off-by: Rami Ylimaki <ext-rami.ylimaki at nokia.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/include/os.h b/include/os.h
index dad1af7..453ab82 100644
--- a/include/os.h
+++ b/include/os.h
@@ -262,6 +262,8 @@ extern _X_EXPORT void OsBlockSignals (void);
 
 extern _X_EXPORT void OsReleaseSignals (void);
 
+extern _X_EXPORT void OsAbort (void);
+
 #if !defined(WIN32)
 extern _X_EXPORT int System(char *);
 extern _X_EXPORT pointer Popen(char *, char *);
diff --git a/os/utils.c b/os/utils.c
index 79399fa..21e25e0 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1310,6 +1310,18 @@ OsReleaseSignals (void)
 #endif
 }
 
+/*
+ * Pending signals may interfere with core dumping. Provide a
+ * mechanism to block signals when aborting.
+ */
+
+void
+OsAbort (void)
+{
+    OsBlockSignals();
+    abort();
+}
+
 #if !defined(WIN32)
 /*
  * "safer" versions of system(3), popen(3) and pclose(3) which give up
commit 031f92bf9ab15226df410012a0d1c9c390efc36d
Author: Oliver McFadden <oliver.mcfadden at nokia.com>
Date:   Wed Feb 3 10:05:20 2010 +0200

    parser: corrected xf86getBoolValue to use case insensitive compare
    
    commit c6e8637e29e0ca11dfb35c02da7ca6002ac8c597 introduced this
    regression; it can cause existing config files to be parsed incorrectly.
    
    Acked-by: Julien Cristau <jcristau at debian.org>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Signed-off-by: Oliver McFadden <oliver.mcfadden at nokia.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index 03cbc8a..cdca9ca 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -1207,21 +1207,21 @@ xf86getBoolValue(Bool *val, const char *str)
 	if (*str == '\0') {
 		*val = TRUE;
 	} else {
-		if (strcmp(str, "1") == 0)
+		if (xf86nameCompare(str, "1") == 0)
 			*val = TRUE;
-		else if (strcmp(str, "on") == 0)
+		else if (xf86nameCompare(str, "on") == 0)
 			*val = TRUE;
-		else if (strcmp(str, "true") == 0)
+		else if (xf86nameCompare(str, "true") == 0)
 			*val = TRUE;
-		else if (strcmp(str, "yes") == 0)
+		else if (xf86nameCompare(str, "yes") == 0)
 			*val = TRUE;
-		else if (strcmp(str, "0") == 0)
+		else if (xf86nameCompare(str, "0") == 0)
 			*val = FALSE;
-		else if (strcmp(str, "off") == 0)
+		else if (xf86nameCompare(str, "off") == 0)
 			*val = FALSE;
-		else if (strcmp(str, "false") == 0)
+		else if (xf86nameCompare(str, "false") == 0)
 			*val = FALSE;
-		else if (strcmp(str, "no") == 0)
+		else if (xf86nameCompare(str, "no") == 0)
 			*val = FALSE;
 		else
 			return FALSE;
commit be96fb2f02c13a6ee8aba40f7d4c3f9141f06cea
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Mon Feb 15 17:42:11 2010 -0800

    Solaris xf86OSRingBell() off-by-one error in filling iov[] array
    
    When generating sound buffers for /dev/audio bells, insert waveform
    for beep *or* silence, but not both, so we don't write one entry past
    the end of the iov buffer when the final bit of soundwave ends up in
    the final entry allocated in the iov array.
    
    Fixes OpenSolaris bug 6894890:
     http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6894890
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Acked-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/os-support/solaris/sun_bell.c b/hw/xfree86/os-support/solaris/sun_bell.c
index 7f146ea..05d1749 100644
--- a/hw/xfree86/os-support/solaris/sun_bell.c
+++ b/hw/xfree86/os-support/solaris/sun_bell.c
@@ -126,14 +126,15 @@ xf86OSRingBell(int loudness, int pitch, int duration)
     iovcnt = 0;
 
     for (cnt = 0; cnt <= repeats; cnt++) {
-        iov[iovcnt].iov_base = (char *) samples;
-        iov[iovcnt++].iov_len = sizeof(samples);
         if (cnt == repeats) {
             /* Insert a bit of silence so that multiple beeps are distinct and
              * not compressed into a single tone.
              */
             iov[iovcnt].iov_base = (char *) silence;
             iov[iovcnt++].iov_len = sizeof(silence);
+        } else {
+            iov[iovcnt].iov_base = (char *) samples;
+            iov[iovcnt++].iov_len = sizeof(samples);
         }
         if ((iovcnt >= IOV_MAX) || (cnt == repeats)) {
             written = writev(audioFD, iov, iovcnt);
commit 2d40f22d1ec970a84b23aa42b1feca4feedeb4bb
Author: Matt Turner <mattst88 at gmail.com>
Date:   Mon Feb 15 20:05:24 2010 -0500

    Use C-style comments in x86emu
    
    Signed-off-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/x86emu/validate.c b/hw/xfree86/x86emu/validate.c
index 239f6c1..b8c4d12 100644
--- a/hw/xfree86/x86emu/validate.c
+++ b/hw/xfree86/x86emu/validate.c
@@ -673,7 +673,7 @@ int main(int argc)
     VAL_LONG_LONG_BINARY(cmp_long);
 
     VAL_BYTE_UNARY(daa_byte);
-    VAL_BYTE_UNARY(das_byte);   // Fails for 0x9A (out of range anyway)
+    VAL_BYTE_UNARY(das_byte);   /* Fails for 0x9A (out of range anyway) */
 
     VAL_BYTE_UNARY(dec_byte);
     VAL_WORD_UNARY(dec_word);
diff --git a/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h b/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h
index 5530a3a..4c850a1 100644
--- a/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h
+++ b/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h
@@ -61,7 +61,7 @@ static inline void hw_cpuid (u32 *a, u32 *b, u32 *c, u32 *d)
                           : "cc");
 }
 
-#else // ! (__PIC__ && __i386__)
+#else /* ! (__PIC__ && __i386__) */
 
 #define x86EMU_HAS_HW_CPUID 1
 static inline void hw_cpuid (u32 *a, u32 *b, u32 *c, u32 *d)
@@ -73,7 +73,7 @@ static inline void hw_cpuid (u32 *a, u32 *b, u32 *c, u32 *d)
                           : "cc");
 }
 
-#endif // __PIC__ && __i386__
+#endif /* __PIC__ && __i386__ */
 
 
-#endif // __X86EMU_PRIM_X86_GCC_H
+#endif /* __X86EMU_PRIM_X86_GCC_H */


More information about the xorg-commit mailing list