From cdeb178cd020bbbd0ebbdb512de1d1d16474858a Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 10 Jul 2012 02:03:17 +0100 Subject: DRI2: Remove prototype for DRI2DestroyDrawable DRI2DestroyDrawable() was still being _X_EXPORTed, but hasn't existed since 1da1f33f last year. Signed-off-by: Daniel Stone Reviewed-by: Cyril Brulebois Reviewed-by: Jamey Sharp Reviewed-by: Ian Romanick Signed-off-by: Peter Hutterer Signed-off-by: Keith Packard (cherry picked from commit b8a3267c36e2e335b888bd4f2ef2f2c477cdfdce) Signed-off-by: Julien Cristau --- hw/xfree86/dri2/dri2.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h index 00b3668cc..204fec566 100644 --- a/hw/xfree86/dri2/dri2.h +++ b/hw/xfree86/dri2/dri2.h @@ -235,8 +235,6 @@ extern _X_EXPORT int DRI2CreateDrawable(ClientPtr client, DRI2InvalidateProcPtr invalidate, void *priv); -extern _X_EXPORT void DRI2DestroyDrawable(DrawablePtr pDraw); - extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffers(DrawablePtr pDraw, int *width, int *height, -- cgit v1.2.3 From 60da5029634ca6258e4e2924ed204096437a0503 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 12 Jul 2012 13:16:36 +0200 Subject: dri2: Add DRI2CreateDrawable2. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same as DRI2CreateDrawable, except it can return the DRI2 specific XID of the DRI2 drawable reference to the base drawable. Signed-off-by: Michel Dänzer Reviewed-by: Kristian Høgsberg Signed-off-by: Keith Packard (cherry picked from commit 8a87acc9e57be740e3bd252567622246051a0723) Signed-off-by: Julien Cristau --- hw/xfree86/dri2/dri2.c | 15 +++++++++++++-- hw/xfree86/dri2/dri2.h | 7 +++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 591ff3ace..156d4986e 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -280,8 +280,9 @@ DRI2AddDrawableRef(DRI2DrawablePtr pPriv, XID id, XID dri2_id, } int -DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id, - DRI2InvalidateProcPtr invalidate, void *priv) +DRI2CreateDrawable2(ClientPtr client, DrawablePtr pDraw, XID id, + DRI2InvalidateProcPtr invalidate, void *priv, + XID *dri2_id_out) { DRI2DrawablePtr pPriv; XID dri2_id; @@ -298,9 +299,19 @@ DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id, if (rc != Success) return rc; + if (dri2_id_out) + *dri2_id_out = dri2_id; + return Success; } +int +DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id, + DRI2InvalidateProcPtr invalidate, void *priv) +{ + return DRI2CreateDrawable2(client, pDraw, id, invalidate, priv, NULL); +} + static int DRI2DrawableGone(pointer p, XID id) { diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h index 204fec566..06546bb54 100644 --- a/hw/xfree86/dri2/dri2.h +++ b/hw/xfree86/dri2/dri2.h @@ -235,6 +235,13 @@ extern _X_EXPORT int DRI2CreateDrawable(ClientPtr client, DRI2InvalidateProcPtr invalidate, void *priv); +extern _X_EXPORT int DRI2CreateDrawable2(ClientPtr client, + DrawablePtr pDraw, + XID id, + DRI2InvalidateProcPtr invalidate, + void *priv, + XID *dri2_id_out); + extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffers(DrawablePtr pDraw, int *width, int *height, -- cgit v1.2.3 From 953c8df9fb7515f70ee6dac7e210e909d26e1490 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 12 Jul 2012 13:16:37 +0200 Subject: glx: Free DRI2 drawable reference to destroyed GLX drawable. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise the reference can lead to use after free in __glXDRIinvalidateBuffers(). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50019 Signed-off-by: Michel Dänzer Reviewed-by: Kristian Høgsberg Signed-off-by: Keith Packard (cherry picked from commit a2d0829531249e24dbca25fc20ed30a2bb2d8ed8) Signed-off-by: Julien Cristau --- glx/glxdri2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/glx/glxdri2.c b/glx/glxdri2.c index aa38295fa..29af190d6 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -95,6 +95,7 @@ struct __GLXDRIdrawable { int height; __DRIbuffer buffers[MAX_DRAWABLE_BUFFERS]; int count; + XID dri2_id; }; static void @@ -103,6 +104,8 @@ __glXDRIdrawableDestroy(__GLXdrawable * drawable) __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; const __DRIcoreExtension *core = private->screen->core; + FreeResource(private->dri2_id, FALSE); + (*core->destroyDrawable) (private->driDrawable); __glXDrawableRelease(drawable); @@ -456,8 +459,9 @@ __glXDRIscreenCreateDrawable(ClientPtr client, private->base.waitGL = __glXDRIdrawableWaitGL; private->base.waitX = __glXDRIdrawableWaitX; - if (DRI2CreateDrawable(client, pDraw, drawId, - __glXDRIinvalidateBuffers, private)) { + if (DRI2CreateDrawable2(client, pDraw, drawId, + __glXDRIinvalidateBuffers, private, + &private->dri2_id)) { free(private); return NULL; } -- cgit v1.2.3 From e08f1c261c75d50a3581e8791700436cba6e4b21 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 30 Jul 2012 19:24:38 +0200 Subject: Bump video ABI version to 12.1 Track the addition of DRI2CreateDrawable2. Signed-off-by: Julien Cristau --- hw/xfree86/common/xf86Module.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index 894b93f59..0036c5935 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -82,7 +82,7 @@ typedef enum { * mask is 0xFFFF0000. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(12, 0) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(12, 1) #define ABI_XINPUT_VERSION SET_ABI_VERSION(16, 0) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(6, 0) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) -- cgit v1.2.3 From 49bb2694f10149fbd27c04375939dcfe7cde1e4e Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 12 Jun 2012 22:29:51 -0700 Subject: OtherClientGone: Remove unreachable return statement Now that FatalError is marked as _X_NORETURN, the compilers know we can't get here, and the return statement added to make them happy in the past now makes them unhappy. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Reviewed-by: Keith Packard (cherry picked from commit 93a378aad4a4a03f37ddafccfedeb9d6e2be2a6a) --- dix/events.c | 1 - 1 file changed, 1 deletion(-) diff --git a/dix/events.c b/dix/events.c index 86336fef6..64edf189a 100644 --- a/dix/events.c +++ b/dix/events.c @@ -4314,7 +4314,6 @@ OtherClientGone(pointer value, XID id) prev = other; } FatalError("client not on event list"); - /*NOTREACHED*/ return -1; /* make compiler happy */ } int -- cgit v1.2.3 From 94c7d0f8b979ccadd8e5c95f030b8b2cd7ef6f98 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 12 Jun 2012 22:38:46 -0700 Subject: Fix some overly indented/poorly line wrapped comments in dix/events.c Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Reviewed-by: Keith Packard (cherry picked from commit 687536b1044a3297f6b9a45f6a2d2987daa7be59) --- dix/events.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/dix/events.c b/dix/events.c index 64edf189a..822b6e931 100644 --- a/dix/events.c +++ b/dix/events.c @@ -4336,12 +4336,10 @@ EventSelectForWindow(WindowPtr pWin, ClientPtr client, Mask mask) return rc; } check = (mask & AtMostOneClient); - if (check & (pWin->eventMask | wOtherEventMasks(pWin))) { /* It is illegal for two different - clients to select on any of the - events for AtMostOneClient. However, - it is OK, for some client to - continue selecting on one of those - events. */ + if (check & (pWin->eventMask | wOtherEventMasks(pWin))) { + /* It is illegal for two different clients to select on any of the + events for AtMostOneClient. However, it is OK, for some client to + continue selecting on one of those events. */ if ((wClient(pWin) != client) && (check & pWin->eventMask)) return BadAccess; for (others = wOtherClients(pWin); others; others = others->next) { @@ -5621,8 +5619,8 @@ DeleteWindowFromAnyEvents(WindowPtr pWin, Bool freeResources) if (IsKeyboardDevice(keybd)) { focus = keybd->focus; - /* If the focus window is a root window (ie. has no parent) then don't - delete the focus from it. */ + /* If the focus window is a root window (ie. has no parent) + then don't delete the focus from it. */ if ((pWin == focus->win) && (pWin->parent != NullWindow)) { int focusEventMode = NotifyNormal; @@ -5644,12 +5642,12 @@ DeleteWindowFromAnyEvents(WindowPtr pWin, Bool freeResources) parent = parent->parent; focus->traceGood--; } while (!parent->realized - /* This would be a good protocol change -- windows being reparented - during SaveSet processing would cause the focus to revert to the - nearest enclosing window which will survive the death of the exiting - client, instead of ending up reverting to a dying window and thence - to None - */ + /* This would be a good protocol change -- windows being + reparented during SaveSet processing would cause the + focus to revert to the nearest enclosing window which + will survive the death of the exiting client, instead + of ending up reverting to a dying window and thence + to None */ #ifdef NOTDEF || wClient(parent)->clientGone #endif -- cgit v1.2.3 From b348cfd4b85e10e1ff36344473758325201c3816 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Wed, 13 Jun 2012 21:20:51 -0700 Subject: Remove obsolete tab stop comments from hw/xfree86/parser/*.c Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer (cherry picked from commit ff541e0a1f84bd98966148793f35afeaf71c271b) --- hw/xfree86/parser/Device.c | 2 -- hw/xfree86/parser/Files.c | 2 -- hw/xfree86/parser/Flags.c | 2 -- hw/xfree86/parser/Input.c | 2 -- hw/xfree86/parser/InputClass.c | 2 -- hw/xfree86/parser/Layout.c | 2 -- hw/xfree86/parser/Module.c | 2 -- hw/xfree86/parser/Monitor.c | 2 -- hw/xfree86/parser/Pointer.c | 2 -- hw/xfree86/parser/Screen.c | 2 -- hw/xfree86/parser/Vendor.c | 2 -- hw/xfree86/parser/Video.c | 2 -- hw/xfree86/parser/read.c | 2 -- hw/xfree86/parser/scan.c | 2 -- hw/xfree86/parser/write.c | 2 -- 15 files changed, 30 deletions(-) diff --git a/hw/xfree86/parser/Device.c b/hw/xfree86/parser/Device.c index f27b56fef..bb1ba88fb 100644 --- a/hw/xfree86/parser/Device.c +++ b/hw/xfree86/parser/Device.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/hw/xfree86/parser/Files.c b/hw/xfree86/parser/Files.c index d8152c008..0d3e47ac5 100644 --- a/hw/xfree86/parser/Files.c +++ b/hw/xfree86/parser/Files.c @@ -51,8 +51,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c index 29a60a2e1..2461476d1 100644 --- a/hw/xfree86/parser/Flags.c +++ b/hw/xfree86/parser/Flags.c @@ -51,8 +51,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/hw/xfree86/parser/Input.c b/hw/xfree86/parser/Input.c index 6e0073437..ff2b9acbc 100644 --- a/hw/xfree86/parser/Input.c +++ b/hw/xfree86/parser/Input.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/hw/xfree86/parser/InputClass.c b/hw/xfree86/parser/InputClass.c index 8493685cd..de6a816ea 100644 --- a/hw/xfree86/parser/InputClass.c +++ b/hw/xfree86/parser/InputClass.c @@ -23,8 +23,6 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/hw/xfree86/parser/Layout.c b/hw/xfree86/parser/Layout.c index bd33d6dfc..cbd8d247a 100644 --- a/hw/xfree86/parser/Layout.c +++ b/hw/xfree86/parser/Layout.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/hw/xfree86/parser/Module.c b/hw/xfree86/parser/Module.c index 1c458ae6c..87ddfc635 100644 --- a/hw/xfree86/parser/Module.c +++ b/hw/xfree86/parser/Module.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/hw/xfree86/parser/Monitor.c b/hw/xfree86/parser/Monitor.c index b237dfb32..36b4ebe35 100644 --- a/hw/xfree86/parser/Monitor.c +++ b/hw/xfree86/parser/Monitor.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/hw/xfree86/parser/Pointer.c b/hw/xfree86/parser/Pointer.c index cdbc09c1a..ff748d99a 100644 --- a/hw/xfree86/parser/Pointer.c +++ b/hw/xfree86/parser/Pointer.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/hw/xfree86/parser/Screen.c b/hw/xfree86/parser/Screen.c index 71778d88d..f294ec490 100644 --- a/hw/xfree86/parser/Screen.c +++ b/hw/xfree86/parser/Screen.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/hw/xfree86/parser/Vendor.c b/hw/xfree86/parser/Vendor.c index b4e2165b0..9b7695c8e 100644 --- a/hw/xfree86/parser/Vendor.c +++ b/hw/xfree86/parser/Vendor.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/hw/xfree86/parser/Video.c b/hw/xfree86/parser/Video.c index fc1f1e544..68d611ae7 100644 --- a/hw/xfree86/parser/Video.c +++ b/hw/xfree86/parser/Video.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c index eef873e89..6545bcdae 100644 --- a/hw/xfree86/parser/read.c +++ b/hw/xfree86/parser/read.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c index 795da615f..f852b83ec 100644 --- a/hw/xfree86/parser/scan.c +++ b/hw/xfree86/parser/scan.c @@ -51,8 +51,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/hw/xfree86/parser/write.c b/hw/xfree86/parser/write.c index c001c3d51..9c706a062 100644 --- a/hw/xfree86/parser/write.c +++ b/hw/xfree86/parser/write.c @@ -51,8 +51,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif -- cgit v1.2.3 From ba0fe0092c25556e682d7b51fa94cafb75c00f3e Mon Sep 17 00:00:00 2001 From: Ricardo Salveti de Araujo Date: Thu, 21 Jun 2012 00:55:53 -0300 Subject: randr: first check pScrPriv before using the pointer at RRFirstOutput Fix a seg fault in case pScrPriv is NULL at ProcRRGetScreenInfo, which later calls RRFirstOutput. Signed-off-by: Ricardo Salveti de Araujo Reviewed-by: Keith Packard Signed-off-by: Keith Packard (cherry picked from commit 32603f57ca03b6390b109960f8bb5ea53ac95ecb) --- randr/randr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/randr/randr.c b/randr/randr.c index 5c1f70cb3..dbd381054 100644 --- a/randr/randr.c +++ b/randr/randr.c @@ -446,6 +446,9 @@ RRFirstOutput(ScreenPtr pScreen) RROutputPtr output; int i, j; + if (!pScrPriv) + return NULL; + if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) return pScrPriv->primaryOutput; -- cgit v1.2.3 From 47c61c56472f885e355f4b5e932f5282c1a7b1f5 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 21 Jun 2012 18:42:46 -0700 Subject: randr: Clean up compiler warnings about unused and shadowing variables set but not used variables shadowing a previous local A hidden problem was that the VERIFY_RR_* macros define local 'rc' variables, any other local definitions for those would be shadowed and generate warnings from gcc. I've renamed the other locals 'ret' instead of 'rc'. Signed-off-by: Keith Packard (cherry picked from commit 4ba340cfaa8d430c808566495f8deda0ff1b4424) --- randr/rrcrtc.c | 10 ++++------ randr/rrinfo.c | 7 ++++--- randr/rrmode.c | 4 +--- randr/rroutput.c | 8 ++++---- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 36caa5822..0c596dd4c 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -825,10 +825,9 @@ ProcRRSetCrtcConfig(ClientPtr client) int numOutputs; RROutputPtr *outputs = NULL; RROutput *outputIds; - TimeStamp configTime; TimeStamp time; Rotation rotation; - int rc, i, j; + int ret, i, j; REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq); numOutputs = (stuff->length - bytes_to_int32(SIZEOF(xRRSetCrtcConfigReq))); @@ -855,11 +854,11 @@ ProcRRSetCrtcConfig(ClientPtr client) outputIds = (RROutput *) (stuff + 1); for (i = 0; i < numOutputs; i++) { - rc = dixLookupResourceByType((pointer *) (outputs + i), outputIds[i], + ret = dixLookupResourceByType((pointer *) (outputs + i), outputIds[i], RROutputType, client, DixSetAttrAccess); - if (rc != Success) { + if (ret != Success) { free(outputs); - return rc; + return ret; } /* validate crtc for this output */ for (j = 0; j < outputs[i]->numCrtcs; j++) @@ -904,7 +903,6 @@ ProcRRSetCrtcConfig(ClientPtr client) pScrPriv = rrGetScrPriv(pScreen); time = ClientTimeToServerTime(stuff->timestamp); - configTime = ClientTimeToServerTime(stuff->configTimestamp); if (!pScrPriv) { time = currentTime; diff --git a/randr/rrinfo.c b/randr/rrinfo.c index 114ec3471..1408d6f64 100644 --- a/randr/rrinfo.c +++ b/randr/rrinfo.c @@ -82,6 +82,7 @@ RRScanOldConfig(ScreenPtr pScreen, Rotation rotations) int i; CARD16 minWidth = MAXSHORT, minHeight = MAXSHORT; CARD16 maxWidth = 0, maxHeight = 0; + CARD16 width, height; /* * First time through, create a crtc and output and hook @@ -141,11 +142,11 @@ RRScanOldConfig(ScreenPtr pScreen, Rotation rotations) /* find size bounds */ for (i = 0; i < output->numModes + output->numUserModes; i++) { - RRModePtr mode = (i < output->numModes ? + mode = (i < output->numModes ? output->modes[i] : output->userModes[i - output->numModes]); - CARD16 width = mode->mode.width; - CARD16 height = mode->mode.height; + width = mode->mode.width; + height = mode->mode.height; if (width < minWidth) minWidth = width; diff --git a/randr/rrmode.c b/randr/rrmode.c index b637c06b9..49a45c7f6 100644 --- a/randr/rrmode.c +++ b/randr/rrmode.c @@ -173,7 +173,7 @@ RRModesForScreen(ScreenPtr pScreen, int *num_ret) */ for (o = 0; o < pScrPriv->numOutputs; o++) { RROutputPtr output = pScrPriv->outputs[o]; - int m, n; + int n; for (m = 0; m < output->numModes + output->numUserModes; m++) { RRModePtr mode = (m < output->numModes ? @@ -285,7 +285,6 @@ ProcRRCreateMode(ClientPtr client) xRRCreateModeReply rep = { 0 }; WindowPtr pWin; ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; xRRModeInfo *modeInfo; long units_after; char *name; @@ -298,7 +297,6 @@ ProcRRCreateMode(ClientPtr client) return rc; pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); modeInfo = &stuff->modeInfo; name = (char *) (stuff + 1); diff --git a/randr/rroutput.c b/randr/rroutput.c index 0890c55b5..091e06b8a 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -528,13 +528,13 @@ ProcRRSetOutputPrimary(ClientPtr client) RROutputPtr output = NULL; WindowPtr pWin; rrScrPrivPtr pScrPriv; - int rc; + int ret; REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq); - rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); - if (rc != Success) - return rc; + ret = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); + if (ret != Success) + return ret; if (stuff->output) { VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); -- cgit v1.2.3 From 6f4b6bca4c8f823adf83519b40f02b39a0c271ed Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 21 Jun 2012 18:45:18 -0700 Subject: randr: Catch two more potential unset rrScrPriv uses Ricardo Salveti found one place where the randr code could use the randr screen private data without checking for null first. This happens when the X server is running with multiple screens, some of which are randr enabled and some of which are not. Applications making protocol requests to the non-randr screens can cause segfaults where the server touches the unset private structure. I audited the code and found two more possible problem spots; the trick to auditing for this issue was to look for functions not taking a RandR data structure and where there was no null screen private check above them in the call graph. Signed-off-by: Keith Packard (cherry picked from commit 855003c333a0ead1db912695bc9705ef2b3144b4) --- randr/rroutput.c | 3 ++- randr/rrscreen.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/randr/rroutput.c b/randr/rroutput.c index 091e06b8a..fbd0e32b3 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -546,7 +546,8 @@ ProcRRSetOutputPrimary(ClientPtr client) } pScrPriv = rrGetScrPriv(pWin->drawable.pScreen); - RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output); + if (pScrPriv) + RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output); return Success; } diff --git a/randr/rrscreen.c b/randr/rrscreen.c index f570afaf4..55110e088 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -248,6 +248,9 @@ ProcRRSetScreenSize(ClientPtr client) pScreen = pWin->drawable.pScreen; pScrPriv = rrGetScrPriv(pScreen); + if (!pScrPriv) + return BadMatch; + if (stuff->width < pScrPriv->minWidth || pScrPriv->maxWidth < stuff->width) { client->errorValue = stuff->width; return BadValue; -- cgit v1.2.3 From 465a7a253ae36a35d2d85a990c6c50c2a26a861e Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Fri, 29 Jun 2012 13:33:58 -0700 Subject: randr: Fix REQUEST vs. REQUEST_SIZE_MATCH mismatch ProcRRGetScreenSizeRange uses REQUEST(xRRGetScreenSizeRangeReq) followed by REQUEST_SIZE_MATCH(xRRGetScreenInfoReq). This happens to work out because both requests have the same size, so this is not a functional change, just a cosmetic one. Signed-off-by: Aaron Plattner Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard (cherry picked from commit 212b9803238d2de2e77cbe5de62d3f616ae50daf) --- randr/rrscreen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/randr/rrscreen.c b/randr/rrscreen.c index 55110e088..c564d1f96 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -195,7 +195,7 @@ ProcRRGetScreenSizeRange(ClientPtr client) rrScrPrivPtr pScrPriv; int rc; - REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); + REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; -- cgit v1.2.3 From b99a4ac32cc613337af79eb130247364f478dd21 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 20 Jun 2012 14:25:54 +1000 Subject: xkb: use local variable instead of casting arg No functional changes. Signed-off-by: Peter Hutterer (cherry picked from commit 252a69b592001b34714d0fe7508e1898883f9d01) --- xkb/xkbAccessX.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index 765772bad..e19ef30eb 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -281,12 +281,12 @@ AccessXStickyKeysTurnOff(DeviceIntPtr dev, xkbControlsNotify * pCN) static CARD32 AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg) { - XkbSrvInfoPtr xkbi = ((DeviceIntPtr) arg)->key->xkbInfo; xkbControlsNotify cn; + DeviceIntPtr dev = arg; + XkbSrvInfoPtr xkbi = dev->key->xkbInfo; if (xkbi->krgTimerActive == _KRG_WARN_TIMER) { - XkbDDXAccessXBeep((DeviceIntPtr) arg, _BEEP_SLOW_WARN, - XkbStickyKeysMask); + XkbDDXAccessXBeep(dev, _BEEP_SLOW_WARN, XkbStickyKeysMask); xkbi->krgTimerActive = _KRG_TIMER; return 4000; } @@ -296,11 +296,11 @@ AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg) cn.requestMajor = 0; cn.requestMinor = 0; if (xkbi->desc->ctrls->enabled_ctrls & XkbSlowKeysMask) { - AccessXKRGTurnOff((DeviceIntPtr) arg, &cn); + AccessXKRGTurnOff(dev, &cn); LogMessage(X_INFO, "XKB SlowKeys are disabled.\n"); } else { - AccessXKRGTurnOn((DeviceIntPtr) arg, XkbSlowKeysMask, &cn); + AccessXKRGTurnOn(dev, XkbSlowKeysMask, &cn); LogMessage(X_INFO, "XKB SlowKeys are now enabled. Hold shift to disable.\n"); } -- cgit v1.2.3 From b0e3696e01ec69e17b74164f4b366baef316f86c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 25 Jun 2012 14:22:31 +1000 Subject: dix: fix dereference before null check Found by Coverity. Signed-off-by: Peter Hutterer Reviewed-by: Dave Airlie (cherry picked from commit 55ff20eb37f00a3ad07b5acff19d4497ab513a97) --- dix/touch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dix/touch.c b/dix/touch.c index 04733ab35..ad48d8a66 100644 --- a/dix/touch.c +++ b/dix/touch.c @@ -160,11 +160,13 @@ TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id) int i; TouchClassPtr t = dev->touch; DDXTouchPointInfoPtr ti = NULL; - Bool emulate_pointer = (t->mode == XIDirectTouch); + Bool emulate_pointer; if (!t) return NULL; + emulate_pointer = (t->mode == XIDirectTouch); + /* Look for another active touchpoint with the same DDX ID. DDX * touchpoints must be unique. */ if (TouchFindByDDXID(dev, ddx_id, FALSE)) -- cgit v1.2.3 From 7197c1c571dab1ecef2dc57b8e3bd2689b589f6d Mon Sep 17 00:00:00 2001 From: Michal Srb Date: Thu, 28 Jun 2012 17:17:12 +0200 Subject: Look for ModuleData only in appropriate library LoaderSymbol calls dlsym with RTLD_DEFAULT pseudo handle making it search in every loaded library. In addition glibc adds NODELETE flag to the library containing the symbol. It's used in doLoadModule to locate ModuleData symbol, the module's library gets the flag and is kept in memory even after it is unloaded. This patch adds LoaderSymbolFromModule function that looks for symbol only in library specified by handle. That way the NODELETE flag isn't added. This glibc behavior doesn't seem to be documented, but even if other implementations differ, there is no reason to search ModuleData symbol outside the module's library. Signed-off-by: Michal Srb Reviewed-by: Daniel Stone v2: Switch LoaderSymbolFromModule arguments order. Correct description. Reviewed-by: Adam Jackson Signed-off-by: Peter Hutterer (cherry picked from commit 258abbf823f753757e4dddc13ef495f4024680db) --- hw/xfree86/loader/loader.c | 6 ++++++ hw/xfree86/loader/loader.h | 1 + hw/xfree86/loader/loadmod.c | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c index b72b8b89d..483696450 100644 --- a/hw/xfree86/loader/loader.c +++ b/hw/xfree86/loader/loader.c @@ -160,6 +160,12 @@ LoaderSymbol(const char *name) return NULL; } +void * +LoaderSymbolFromModule(void *handle, const char *name) +{ + return dlsym(handle, name); +} + void LoaderUnload(const char *name, void *handle) { diff --git a/hw/xfree86/loader/loader.h b/hw/xfree86/loader/loader.h index 5cadd5ad6..c89c6410a 100644 --- a/hw/xfree86/loader/loader.h +++ b/hw/xfree86/loader/loader.h @@ -72,5 +72,6 @@ extern unsigned long LoaderOptions; /* Internal Functions */ void *LoaderOpen(const char *, int *, int *); +void *LoaderSymbolFromModule(void *, const char *); #endif /* _LOADER_H */ diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index c6b559072..6fa9554c9 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -938,7 +938,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist, *errmin = 0; goto LoadModule_fail; } - initdata = LoaderSymbol(p); + initdata = LoaderSymbolFromModule(ret->handle, p); if (initdata) { ModuleSetupProc setup; ModuleTearDownProc teardown; -- cgit v1.2.3 From 31ca2e2d5d2f26826fe15d4537a57e1cbf863140 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 5 Jul 2012 16:17:56 +1000 Subject: list.h: don't crash when removing an element from a NULL list Signed-off-by: Peter Hutterer Signed-off-by: Keith Packard (cherry picked from commit 167993254a5cbe11a1f44fad1e8ae042089c1619) --- include/list.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/list.h b/include/list.h index 96c0bcbd6..d54a207b1 100644 --- a/include/list.h +++ b/include/list.h @@ -453,7 +453,7 @@ xorg_list_is_empty(struct xorg_list *head) #define nt_list_del(_entry, _list, _type, _member) \ do { \ _type *__e = _entry; \ - if (__e == NULL) break; \ + if (__e == NULL || _list == NULL) break; \ if ((_list) == __e) { \ _list = __e->_member; \ } else { \ -- cgit v1.2.3 From 4060ebfea066693f9d9dd5fab63278ebd4951533 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 19 Jun 2012 16:01:08 +0100 Subject: xf86: cursor code got mangled by indenting This fixes some really ugly code that got mangled by the indenting. Reviewed-by: Keith Packard Signed-off-by: Dave Airlie (cherry picked from commit 2c52d776a42a28bb3e1463edf0cfe0672d0c08a9) --- hw/xfree86/ramdac/xf86Cursor.c | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c index 678d2be5c..4a4def5c5 100644 --- a/hw/xfree86/ramdac/xf86Cursor.c +++ b/hw/xfree86/ramdac/xf86Cursor.c @@ -336,28 +336,19 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, if (!infoPtr->pScrn->vtSema) ScreenPriv->SavedCursor = pCurs; - if (infoPtr->pScrn->vtSema && (ScreenPriv->ForceHWCursorCount || (( + if (infoPtr->pScrn->vtSema && + (ScreenPriv->ForceHWCursorCount || + (( #ifdef ARGB_CURSOR - pCurs-> - bits-> - argb - && - infoPtr-> - UseHWCursorARGB - && - (*infoPtr-> - UseHWCursorARGB) - (pScreen, - pCurs)) - || - (pCurs-> - bits-> - argb - == 0 - && + pCurs->bits->argb && + infoPtr->UseHWCursorARGB && + (*infoPtr->UseHWCursorARGB)(pScreen, pCurs)) || + (pCurs->bits->argb == 0 && #endif - (pCurs->bits->height <= infoPtr->MaxHeight) && (pCurs->bits->width <= infoPtr->MaxWidth) && (!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor) (pScreen, pCurs)))))) { - + (pCurs->bits->height <= infoPtr->MaxHeight) && + (pCurs->bits->width <= infoPtr->MaxWidth) && + (!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor) (pScreen, pCurs)))))) { + if (ScreenPriv->SWCursor) /* remove the SW cursor */ (*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, NullCursor, x, y); -- cgit v1.2.3 From 5c6c4fc0820b4f7845ec43a1b784fa566713e566 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 9 Jul 2012 16:29:04 -0700 Subject: Add 'install-headers' target in the top-level Makefile This target recursively locates directories with sdk headers and installs them all. Useful when you want to build a complete new X server and drivers without having to install the X server before the drivers are actually working. Signed-off-by: Keith Packard (cherry picked from commit d1c639c006526b8cab14dac582508f3f54848967) --- Makefile.am | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile.am b/Makefile.am index cea140bea..9a628537d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -95,3 +95,10 @@ DIST_SUBDIRS = \ # gross hack relink: all $(AM_V_at)$(MAKE) -C hw relink + +install-headers: Makefile + +find . -name Makefile | while read m; do \ + if grep -q install-sdkHEADERS $$m; then \ + (cd `dirname "$$m"` && make install-sdkHEADERS) \ + fi \ + done -- cgit v1.2.3 From abffc882af655d2c8434e6eb7374dda472d6a8b0 Mon Sep 17 00:00:00 2001 From: Jaroslav Šmíd Date: Mon, 9 Jul 2012 19:12:42 -0700 Subject: Bug 51375: Xorg doesn't set status for RRGetOutputInfo https://bugs.freedesktop.org/show_bug.cgi?id=51375 https://bugs.freedesktop.org/attachment.cgi?id=63397 Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard Tested-by: Daniel Stone (cherry picked from commit 3a013b8816bc0bb765c99e8a2bf2ea536dc62c3b) --- randr/rroutput.c | 1 + 1 file changed, 1 insertion(+) diff --git a/randr/rroutput.c b/randr/rroutput.c index fbd0e32b3..cd6b365e7 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -426,6 +426,7 @@ ProcRRGetOutputInfo(ClientPtr client) pScrPriv = rrGetScrPriv(pScreen); rep.type = X_Reply; + rep.status = RRSetConfigSuccess; rep.sequenceNumber = client->sequence; rep.length = bytes_to_int32(OutputInfoExtra); rep.timestamp = pScrPriv->lastSetTime.milliseconds; -- cgit v1.2.3 From 18863154bdb0f4ff79b2c79eae73ddd7a6ddc764 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 9 Jul 2012 19:12:42 -0700 Subject: ProcRRGetScreenInfo: swap configTimestamp as well Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard Tested-by: Daniel Stone (cherry picked from commit 15bc13c8d088e05f14c7262348e0066929c29251) --- randr/rrscreen.c | 1 + 1 file changed, 1 insertion(+) diff --git a/randr/rrscreen.c b/randr/rrscreen.c index c564d1f96..a9c3f610d 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -685,6 +685,7 @@ ProcRRGetScreenInfo(ClientPtr client) swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.timestamp); + swapl(&rep.configTimestamp); swaps(&rep.rotation); swaps(&rep.nSizes); swaps(&rep.sizeID); -- cgit v1.2.3 From 8cefa9bf0766f10a1fc09a8d414e6ddfaa4addd9 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 9 Jul 2012 19:12:42 -0700 Subject: xf86dga2.c & xf86vmode.c: Move REQUEST_SIZE_MATCH checks before using stuff Seems silly waiting to check if the client failed to send us enough bytes until after we've already tried using them. Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard Tested-by: Daniel Stone (cherry picked from commit ef0f701c9245b0373eb0c7a84dd804af4738bb29) --- hw/xfree86/dixmods/extmod/xf86dga2.c | 81 ++++++++++++++++++++--------------- hw/xfree86/dixmods/extmod/xf86vmode.c | 12 +++--- 2 files changed, 52 insertions(+), 41 deletions(-) diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c index 6b33941ef..4b3238fd2 100644 --- a/hw/xfree86/dixmods/extmod/xf86dga2.c +++ b/hw/xfree86/dixmods/extmod/xf86dga2.c @@ -96,13 +96,14 @@ ProcXDGAOpenFramebuffer(ClientPtr client) char *deviceName; int nameSize; + REQUEST_SIZE_MATCH(xXDGAOpenFramebufferReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (!DGAAvailable(stuff->screen)) return DGAErrorBase + XF86DGANoDirectVideoMode; - REQUEST_SIZE_MATCH(xXDGAOpenFramebufferReq); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; @@ -129,14 +130,14 @@ ProcXDGACloseFramebuffer(ClientPtr client) { REQUEST(xXDGACloseFramebufferReq); + REQUEST_SIZE_MATCH(xXDGACloseFramebufferReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (!DGAAvailable(stuff->screen)) return DGAErrorBase + XF86DGANoDirectVideoMode; - REQUEST_SIZE_MATCH(xXDGACloseFramebufferReq); - DGACloseFramebuffer(stuff->screen); return Success; @@ -152,10 +153,11 @@ ProcXDGAQueryModes(ClientPtr client) xXDGAModeInfo info; XDGAModePtr mode; + REQUEST_SIZE_MATCH(xXDGAQueryModesReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; - REQUEST_SIZE_MATCH(xXDGAQueryModesReq); rep.type = X_Reply; rep.length = 0; rep.number = 0; @@ -267,11 +269,12 @@ ProcXDGASetMode(ClientPtr client) ClientPtr owner; int size; + REQUEST_SIZE_MATCH(xXDGASetModeReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; owner = DGA_GETCLIENT(stuff->screen); - REQUEST_SIZE_MATCH(xXDGASetModeReq); rep.type = X_Reply; rep.length = 0; rep.offset = 0; @@ -357,14 +360,14 @@ ProcXDGASetViewport(ClientPtr client) { REQUEST(xXDGASetViewportReq); + REQUEST_SIZE_MATCH(xXDGASetViewportReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (DGA_GETCLIENT(stuff->screen) != client) return DGAErrorBase + XF86DGADirectNotActivated; - REQUEST_SIZE_MATCH(xXDGASetViewportReq); - DGASetViewport(stuff->screen, stuff->x, stuff->y, stuff->flags); return Success; @@ -378,14 +381,14 @@ ProcXDGAInstallColormap(ClientPtr client) REQUEST(xXDGAInstallColormapReq); + REQUEST_SIZE_MATCH(xXDGAInstallColormapReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (DGA_GETCLIENT(stuff->screen) != client) return DGAErrorBase + XF86DGADirectNotActivated; - REQUEST_SIZE_MATCH(xXDGAInstallColormapReq); - rc = dixLookupResourceByType((pointer *) &cmap, stuff->cmap, RT_COLORMAP, client, DixInstallAccess); if (rc != Success) @@ -399,14 +402,14 @@ ProcXDGASelectInput(ClientPtr client) { REQUEST(xXDGASelectInputReq); + REQUEST_SIZE_MATCH(xXDGASelectInputReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (DGA_GETCLIENT(stuff->screen) != client) return DGAErrorBase + XF86DGADirectNotActivated; - REQUEST_SIZE_MATCH(xXDGASelectInputReq); - if (DGA_GETCLIENT(stuff->screen) == client) DGASelectInput(stuff->screen, client, stuff->mask); @@ -418,14 +421,14 @@ ProcXDGAFillRectangle(ClientPtr client) { REQUEST(xXDGAFillRectangleReq); + REQUEST_SIZE_MATCH(xXDGAFillRectangleReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (DGA_GETCLIENT(stuff->screen) != client) return DGAErrorBase + XF86DGADirectNotActivated; - REQUEST_SIZE_MATCH(xXDGAFillRectangleReq); - if (Success != DGAFillRect(stuff->screen, stuff->x, stuff->y, stuff->width, stuff->height, stuff->color)) return BadMatch; @@ -438,14 +441,14 @@ ProcXDGACopyArea(ClientPtr client) { REQUEST(xXDGACopyAreaReq); + REQUEST_SIZE_MATCH(xXDGACopyAreaReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (DGA_GETCLIENT(stuff->screen) != client) return DGAErrorBase + XF86DGADirectNotActivated; - REQUEST_SIZE_MATCH(xXDGACopyAreaReq); - if (Success != DGABlitRect(stuff->screen, stuff->srcx, stuff->srcy, stuff->width, stuff->height, stuff->dstx, stuff->dsty)) @@ -459,14 +462,14 @@ ProcXDGACopyTransparentArea(ClientPtr client) { REQUEST(xXDGACopyTransparentAreaReq); + REQUEST_SIZE_MATCH(xXDGACopyTransparentAreaReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (DGA_GETCLIENT(stuff->screen) != client) return DGAErrorBase + XF86DGADirectNotActivated; - REQUEST_SIZE_MATCH(xXDGACopyTransparentAreaReq); - if (Success != DGABlitTransRect(stuff->screen, stuff->srcx, stuff->srcy, stuff->width, stuff->height, stuff->dstx, stuff->dsty, stuff->key)) @@ -481,13 +484,14 @@ ProcXDGAGetViewportStatus(ClientPtr client) REQUEST(xXDGAGetViewportStatusReq); xXDGAGetViewportStatusReply rep; + REQUEST_SIZE_MATCH(xXDGAGetViewportStatusReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (DGA_GETCLIENT(stuff->screen) != client) return DGAErrorBase + XF86DGADirectNotActivated; - REQUEST_SIZE_MATCH(xXDGAGetViewportStatusReq); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; @@ -504,13 +508,14 @@ ProcXDGASync(ClientPtr client) REQUEST(xXDGASyncReq); xXDGASyncReply rep; + REQUEST_SIZE_MATCH(xXDGASyncReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (DGA_GETCLIENT(stuff->screen) != client) return DGAErrorBase + XF86DGADirectNotActivated; - REQUEST_SIZE_MATCH(xXDGASyncReq); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; @@ -549,13 +554,14 @@ ProcXDGAChangePixmapMode(ClientPtr client) xXDGAChangePixmapModeReply rep; int x, y; + REQUEST_SIZE_MATCH(xXDGAChangePixmapModeReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (DGA_GETCLIENT(stuff->screen) != client) return DGAErrorBase + XF86DGADirectNotActivated; - REQUEST_SIZE_MATCH(xXDGAChangePixmapModeReq); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; @@ -579,14 +585,14 @@ ProcXDGACreateColormap(ClientPtr client) REQUEST(xXDGACreateColormapReq); int result; + REQUEST_SIZE_MATCH(xXDGACreateColormapReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (DGA_GETCLIENT(stuff->screen) != client) return DGAErrorBase + XF86DGADirectNotActivated; - REQUEST_SIZE_MATCH(xXDGACreateColormapReq); - if (!stuff->mode) return BadValue; @@ -615,10 +621,11 @@ ProcXF86DGAGetVideoLL(ClientPtr client) int num, offset, flags; char *name; + REQUEST_SIZE_MATCH(xXF86DGAGetVideoLLReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; - REQUEST_SIZE_MATCH(xXF86DGAGetVideoLLReq); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; @@ -655,9 +662,10 @@ ProcXF86DGADirectVideo(ClientPtr client) REQUEST(xXF86DGADirectVideoReq); + REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; - REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq); if (!DGAAvailable(stuff->screen)) return DGAErrorBase + XF86DGANoDirectVideoMode; @@ -713,10 +721,11 @@ ProcXF86DGAGetViewPortSize(ClientPtr client) REQUEST(xXF86DGAGetViewPortSizeReq); xXF86DGAGetViewPortSizeReply rep; + REQUEST_SIZE_MATCH(xXF86DGAGetViewPortSizeReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; - REQUEST_SIZE_MATCH(xXF86DGAGetViewPortSizeReq); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; @@ -741,14 +750,14 @@ ProcXF86DGASetViewPort(ClientPtr client) { REQUEST(xXF86DGASetViewPortReq); + REQUEST_SIZE_MATCH(xXF86DGASetViewPortReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (DGA_GETCLIENT(stuff->screen) != client) return DGAErrorBase + XF86DGADirectNotActivated; - REQUEST_SIZE_MATCH(xXF86DGASetViewPortReq); - if (!DGAAvailable(stuff->screen)) return DGAErrorBase + XF86DGANoDirectVideoMode; @@ -768,10 +777,11 @@ ProcXF86DGAGetVidPage(ClientPtr client) REQUEST(xXF86DGAGetVidPageReq); xXF86DGAGetVidPageReply rep; + REQUEST_SIZE_MATCH(xXF86DGAGetVidPageReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; - REQUEST_SIZE_MATCH(xXF86DGAGetVidPageReq); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; @@ -786,11 +796,11 @@ ProcXF86DGASetVidPage(ClientPtr client) { REQUEST(xXF86DGASetVidPageReq); + REQUEST_SIZE_MATCH(xXF86DGASetVidPageReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; - REQUEST_SIZE_MATCH(xXF86DGASetVidPageReq); - /* silently fail */ return Success; @@ -804,14 +814,14 @@ ProcXF86DGAInstallColormap(ClientPtr client) REQUEST(xXF86DGAInstallColormapReq); + REQUEST_SIZE_MATCH(xXF86DGAInstallColormapReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (DGA_GETCLIENT(stuff->screen) != client) return DGAErrorBase + XF86DGADirectNotActivated; - REQUEST_SIZE_MATCH(xXF86DGAInstallColormapReq); - if (!DGAActive(stuff->screen)) return DGAErrorBase + XF86DGADirectNotActivated; @@ -832,10 +842,11 @@ ProcXF86DGAQueryDirectVideo(ClientPtr client) REQUEST(xXF86DGAQueryDirectVideoReq); xXF86DGAQueryDirectVideoReply rep; + REQUEST_SIZE_MATCH(xXF86DGAQueryDirectVideoReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; - REQUEST_SIZE_MATCH(xXF86DGAQueryDirectVideoReq); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; @@ -854,14 +865,14 @@ ProcXF86DGAViewPortChanged(ClientPtr client) REQUEST(xXF86DGAViewPortChangedReq); xXF86DGAViewPortChangedReply rep; + REQUEST_SIZE_MATCH(xXF86DGAViewPortChangedReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (DGA_GETCLIENT(stuff->screen) != client) return DGAErrorBase + XF86DGADirectNotActivated; - REQUEST_SIZE_MATCH(xXF86DGAViewPortChangedReq); - if (!DGAActive(stuff->screen)) return DGAErrorBase + XF86DGADirectNotActivated; diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c index 68c4b583f..d5d97c933 100644 --- a/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/hw/xfree86/dixmods/extmod/xf86vmode.c @@ -1489,14 +1489,14 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client) REQUEST(xXF86VidModeGetGammaRampReq); + REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (stuff->size != VidModeGetGammaRampSize(stuff->screen)) return BadValue; - REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq); - length = (stuff->size + 1) & ~1; if (stuff->size) { @@ -1537,11 +1537,11 @@ ProcXF86VidModeGetGammaRampSize(ClientPtr client) REQUEST(xXF86VidModeGetGammaRampSizeReq); + REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; - REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq); - rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; @@ -1564,11 +1564,11 @@ ProcXF86VidModeGetPermissions(ClientPtr client) REQUEST(xXF86VidModeGetPermissionsReq); + REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; - REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq); - rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; -- cgit v1.2.3 From eeefadf95ed764755bfb04b107f636c6ae60bdde Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 9 Jul 2012 19:12:42 -0700 Subject: Use calloc to zero fill buffers being allocated for replies & events Ensures padding bytes are zero-filled Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard Tested-by: Daniel Stone (cherry picked from commit cdf5bcd420e5bcf4a4a24a275d3133a4e16ce41e) --- Xext/sync.c | 2 +- Xext/xf86bigfont.c | 2 +- glx/glxcmds.c | 4 ++-- hw/xfree86/dixmods/extmod/xf86vmode.c | 2 +- mi/miexpose.c | 2 +- randr/rrcrtc.c | 2 +- render/render.c | 4 ++-- xfixes/cursor.c | 7 ++++--- xfixes/region.c | 3 ++- 9 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Xext/sync.c b/Xext/sync.c index 37c59c2be..532cb6473 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -466,7 +466,7 @@ SyncSendCounterNotifyEvents(ClientPtr client, SyncAwait ** ppAwait, if (client->clientGone) return; - pev = pEvents = malloc(num_events * sizeof(xSyncCounterNotifyEvent)); + pev = pEvents = calloc(num_events, sizeof(xSyncCounterNotifyEvent)); if (!pEvents) return; UpdateCurrentTime(); diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c index 9de785678..9d089f996 100644 --- a/Xext/xf86bigfont.c +++ b/Xext/xf86bigfont.c @@ -555,7 +555,7 @@ ProcXF86BigfontQueryFont(ClientPtr client) ? nUniqCharInfos * sizeof(xCharInfo) + (nCharInfos + 1) / 2 * 2 * sizeof(CARD16) : 0); - xXF86BigfontQueryFontReply *reply = malloc(rlength); + xXF86BigfontQueryFontReply *reply = calloc(1, rlength); char *p; if (!reply) { diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 24fed8f63..f62fd7962 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -2304,7 +2304,7 @@ __glXDisp_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc) reply.n = n; /* Allocate buffer to make sure it's a multiple of 4 bytes big. */ - buf = (char *) malloc(length << 2); + buf = calloc(length, 4); if (buf == NULL) return BadAlloc; memcpy(buf, pGlxScreen->GLXextensions, n); @@ -2365,7 +2365,7 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc) reply.length = length; reply.n = n; - buf = (char *) malloc(length << 2); + buf = calloc(length, 4); if (buf == NULL) { return BadAlloc; } diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c index d5d97c933..ac3bee08f 100644 --- a/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/hw/xfree86/dixmods/extmod/xf86vmode.c @@ -1362,7 +1362,7 @@ ProcXF86VidModeGetDotClocks(ClientPtr client) rep.flags = 0; if (!ClockProg) { - Clocks = malloc(numClocks * sizeof(int)); + Clocks = calloc(numClocks, sizeof(int)); if (!Clocks) return BadValue; if (!VidModeGetClocks(stuff->screen, Clocks)) { diff --git a/mi/miexpose.c b/mi/miexpose.c index dbb29ca4a..2dc465d9c 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -327,7 +327,7 @@ miSendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID drawable, numRects = RegionNumRects(pRgn); pBox = RegionRects(pRgn); - if (!(pEvent = malloc(numRects * sizeof(xEvent)))) + if (!(pEvent = calloc(numRects, sizeof(xEvent)))) return; pe = pEvent; diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 0c596dd4c..71d53f207 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -1342,7 +1342,7 @@ ProcRRGetCrtcTransform(ClientPtr client) nextra = (transform_filter_length(pending) + transform_filter_length(current)); - reply = malloc(sizeof(xRRGetCrtcTransformReply) + nextra); + reply = calloc(1, sizeof(xRRGetCrtcTransformReply) + nextra); if (!reply) return BadAlloc; diff --git a/render/render.c b/render/render.c index 344ca75e2..aa66020b9 100644 --- a/render/render.c +++ b/render/render.c @@ -531,7 +531,7 @@ ProcRenderQueryPictIndexValues(ClientPtr client) num = pFormat->index.nvalues; rlength = (sizeof(xRenderQueryPictIndexValuesReply) + num * sizeof(xIndexValue)); - reply = (xRenderQueryPictIndexValuesReply *) malloc(rlength); + reply = (xRenderQueryPictIndexValuesReply *) calloc(1, rlength); if (!reply) return BadAlloc; @@ -1688,7 +1688,7 @@ ProcRenderQueryFilters(ClientPtr client) } len = ((nnames + 1) >> 1) + bytes_to_int32(nbytesName); total_bytes = sizeof(xRenderQueryFiltersReply) + (len << 2); - reply = (xRenderQueryFiltersReply *) malloc(total_bytes); + reply = (xRenderQueryFiltersReply *) calloc(1, total_bytes); if (!reply) return BadAlloc; aliases = (INT16 *) (reply + 1); diff --git a/xfixes/cursor.c b/xfixes/cursor.c index 602b9061e..7d0b9a105 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -380,7 +380,8 @@ ProcXFixesGetCursorImage(ClientPtr client) width = pCursor->bits->width; height = pCursor->bits->height; npixels = width * height; - rep = malloc(sizeof(xXFixesGetCursorImageReply) + npixels * sizeof(CARD32)); + rep = calloc(sizeof(xXFixesGetCursorImageReply) + npixels * sizeof(CARD32), + 1); if (!rep) return BadAlloc; @@ -529,8 +530,8 @@ ProcXFixesGetCursorImageAndName(ClientPtr client) name = pCursor->name ? NameForAtom(pCursor->name) : ""; nbytes = strlen(name); nbytesRound = pad_to_int32(nbytes); - rep = malloc(sizeof(xXFixesGetCursorImageAndNameReply) + - npixels * sizeof(CARD32) + nbytesRound); + rep = calloc(sizeof(xXFixesGetCursorImageAndNameReply) + + npixels * sizeof(CARD32) + nbytesRound, 1); if (!rep) return BadAlloc; diff --git a/xfixes/region.c b/xfixes/region.c index 624109de1..71101774a 100644 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -558,7 +558,8 @@ ProcXFixesFetchRegion(ClientPtr client) pBox = RegionRects(pRegion); nBox = RegionNumRects(pRegion); - reply = malloc(sizeof(xXFixesFetchRegionReply) + nBox * sizeof(xRectangle)); + reply = calloc(sizeof(xXFixesFetchRegionReply) + nBox * sizeof(xRectangle), + 1); if (!reply) return BadAlloc; reply->type = X_Reply; -- cgit v1.2.3 From f29c0ddd5afc4549e20d72a1d9e4c17276bb4bb1 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 9 Jul 2012 19:12:44 -0700 Subject: Set padding bytes to 0 in WriteToClient Clear them out when needed instead of leaving whatever values were present in previously sent messages. Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard Tested-by: Daniel Stone (cherry picked from commit bed610fcae41ddfe21fa9acde599b17d1d15f5d1) --- os/io.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/os/io.c b/os/io.c index b67a5f324..8d0e5cc6f 100644 --- a/os/io.c +++ b/os/io.c @@ -815,7 +815,11 @@ WriteToClient(ClientPtr who, int count, const void *__buf) NewOutputPending = TRUE; FD_SET(oc->fd, &OutputPending); memmove((char *) oco->buf + oco->count, buf, count); - oco->count += count + padBytes; + oco->count += count; + if (padBytes) { + memset(oco->buf + oco->count, '\0', padBytes); + oco->count += padBytes; + } return count; } -- cgit v1.2.3 From af7ff8f1ccec722bc8690c6f512a986b0f3c7a9c Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 9 Jul 2012 19:12:44 -0700 Subject: Initialize padding bits to 0 in ErrorConnMax() Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard Tested-by: Daniel Stone (cherry picked from commit 7a29f6878284e2d65e69fcd157aa9ec01d21b3c0) --- os/connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/connection.c b/os/connection.c index 1099752e4..d7e21f362 100644 --- a/os/connection.c +++ b/os/connection.c @@ -863,7 +863,7 @@ ErrorConnMax(XtransConnInfo trans_conn) { int fd = _XSERVTransGetConnectionNumber(trans_conn); xConnSetupPrefix csp; - char pad[3]; + char pad[3] = { 0, 0, 0 }; struct iovec iov[3]; char byteOrder = 0; int whichbyte = 1; -- cgit v1.2.3 From 7b7db8ced263093bdcc1e57dfe7574e07cd5b63a Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 10 Jul 2012 02:02:46 +0100 Subject: Don't make failure to -nolisten fatal If failing to disable a protocol specified by -nolisten failed, we'd throw a FatalError and bomb startup entirely. From poking at xtrans, it looks like the only way we can get a failure here is because we've specified a protocol name which doesn't exist, which probably doesn't constitute a security risk. And it makes it possible to start gdm even though you've built with --disable-tcp-transport. Signed-off-by: Daniel Stone Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard (cherry picked from commit 656af2c7e73d948338683675e14cd827b46a97c4) --- os/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/os/utils.c b/os/utils.c index 30592d2cc..e33e4d22e 100644 --- a/os/utils.c +++ b/os/utils.c @@ -746,8 +746,8 @@ ProcessCommandLine(int argc, char *argv[]) else if (strcmp(argv[i], "-nolisten") == 0) { if (++i < argc) { if (_XSERVTransNoListen(argv[i])) - FatalError("Failed to disable listen for %s transport", - argv[i]); + ErrorF("Failed to disable listen for %s transport", + argv[i]); } else UseMsg(); -- cgit v1.2.3 From ce106ae299a5444ee7cca1b6f4b7bc3bdfe15888 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 10 Jul 2012 02:02:49 +0100 Subject: Xorg: Link XKB DDX library after core server libs libxorgxkb.a contains a number of libraries which are used by XKB action code to call back into the DDX, e.g. for VT switching, termination, grab breaking, et al. Make sure libxkb.a comes first in the link order, so it can mark XkbDDX* as used in order for the linker to not discard them. Signed-off-by: Daniel Stone Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard (cherry picked from commit 67953d6975ef2ee573b95e7641aaf3d72e9f8379) --- hw/xfree86/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am index 72be8891c..391b26eb8 100644 --- a/hw/xfree86/Makefile.am +++ b/hw/xfree86/Makefile.am @@ -54,8 +54,8 @@ LOCAL_LIBS = \ ramdac/libramdac.la \ ddc/libddc.la \ i2c/libi2c.la \ - dixmods/libxorgxkb.la \ $(XORG_LIBS) \ + dixmods/libxorgxkb.la \ $(top_builddir)/mi/libmi.la \ $(top_builddir)/os/libos.la Xorg_LDADD = \ -- cgit v1.2.3 From fc13888f19cd068ee6485d5d7be54edfa17036a2 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 10 Jul 2012 02:02:52 +0100 Subject: Xinerama: Fix ExtensionInit prototype Huh, so I guess INITARGS used to be int argc, char *argv then. Either way, it's now void, so fix that ... Signed-off-by: Daniel Stone Reviewed-by: Cyril Brulebois Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer Signed-off-by: Keith Packard (cherry picked from commit bddb8c6cbe52ba9923b1d36d01f5ac9391b0ec0e) --- Xext/panoramiX.c | 2 +- hw/xfree86/dixmods/extmod/modinit.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index 98d327f26..3e5cd62ea 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -434,7 +434,7 @@ XineramaReinitData(void) */ void -PanoramiXExtensionInit(int argc, char *argv[]) +PanoramiXExtensionInit(void) { int i; Bool success = FALSE; diff --git a/hw/xfree86/dixmods/extmod/modinit.h b/hw/xfree86/dixmods/extmod/modinit.h index 9753fe0fd..e7c744859 100644 --- a/hw/xfree86/dixmods/extmod/modinit.h +++ b/hw/xfree86/dixmods/extmod/modinit.h @@ -85,7 +85,7 @@ extern void SecurityExtensionInit(INITARGS); #endif #if 1 -extern void PanoramiXExtensionInit(int argc, char *argv[]); +extern void PanoramiXExtensionInit(INITARGS); #endif #if 1 -- cgit v1.2.3 From 1b2ae1fd7a630c9100ed87bc785fa5d9a52661b0 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 10 Jul 2012 09:10:22 +0100 Subject: AllocDevicePair: Ensure XKB privates are initialised Since we call directly into XKB and may be doing so before the extension has been initialised, make sure its privates are set up first. XTest had a hack to do this itself, but seems cleaner to just make sure we do it in AllocDevicePair. Signed-off-by: Daniel Stone Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard (cherry picked from commit 59c2c4f645b4d782599c274f4bc752de9623d308) --- dix/devices.c | 2 ++ test/xtest.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dix/devices.c b/dix/devices.c index 012550443..fbc9fec57 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -2630,6 +2630,8 @@ AllocDevicePair(ClientPtr client, const char *name, *ptr = *keybd = NULL; + XkbInitPrivates(); + pointer = AddInputDevice(client, ptr_proc, TRUE); if (!pointer) diff --git a/test/xtest.c b/test/xtest.c index aeca669d8..0b8d866c3 100644 --- a/test/xtest.c +++ b/test/xtest.c @@ -63,8 +63,6 @@ xtest_init_devices(void) dixResetPrivates(); InitAtoms(); - XkbInitPrivates(); - /* this also inits the xtest devices */ InitCoreDevices(); -- cgit v1.2.3 From cb8fbccba79b30d0f8443d181016fa78ccce86e6 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Wed, 11 Jul 2012 23:49:33 -0700 Subject: XQuartz: Silence an unused-variable warning Signed-off-by: Jeremy Huddleston (cherry picked from commit 228f8bfe81890770f1ba109a0acca1c81a2ffee9) --- hw/xquartz/pseudoramiX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xquartz/pseudoramiX.c b/hw/xquartz/pseudoramiX.c index 8bb7f2d01..01113cee7 100644 --- a/hw/xquartz/pseudoramiX.c +++ b/hw/xquartz/pseudoramiX.c @@ -256,7 +256,7 @@ ProcPseudoramiXGetScreenSize(ClientPtr client) REQUEST(xPanoramiXGetScreenSizeReq); WindowPtr pWin; xPanoramiXGetScreenSizeReply rep; - register int n, rc; + register int rc; TRACE(); -- cgit v1.2.3 From bfcc45861c7a2396c109fdac9b6db84d6b614db1 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Wed, 11 Jul 2012 23:49:59 -0700 Subject: XQuartz: Fix incorrect PseudoramiXExtensionInit prototype Signed-off-by: Jeremy Huddleston (cherry picked from commit 1a64d3cc9c319d5e9ab2365b60469fb5b83407fc) --- hw/xquartz/pseudoramiX.c | 2 +- hw/xquartz/pseudoramiX.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xquartz/pseudoramiX.c b/hw/xquartz/pseudoramiX.c index 01113cee7..24349e31a 100644 --- a/hw/xquartz/pseudoramiX.c +++ b/hw/xquartz/pseudoramiX.c @@ -125,7 +125,7 @@ PseudoramiXAddScreen(int x, int y, int w, int h) // Initialize PseudoramiX. // Copied from PanoramiXExtensionInit void -PseudoramiXExtensionInit(int argc, char *argv[]) +PseudoramiXExtensionInit(void) { Bool success = FALSE; ExtensionEntry *extEntry; diff --git a/hw/xquartz/pseudoramiX.h b/hw/xquartz/pseudoramiX.h index f41b5cbe4..7e08749df 100644 --- a/hw/xquartz/pseudoramiX.h +++ b/hw/xquartz/pseudoramiX.h @@ -6,6 +6,6 @@ extern int noPseudoramiXExtension; void PseudoramiXAddScreen(int x, int y, int w, int h); -void PseudoramiXExtensionInit(int argc, char *argv[]); +void PseudoramiXExtensionInit(void); void PseudoramiXResetScreens(void); -- cgit v1.2.3 From dfc943609acf73dc3946ba106bcdf6c66997a3b8 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Wed, 25 Jul 2012 11:40:33 -0700 Subject: XQuartz: Call xp_window_bring_all_to_front if available in libXplugin Signed-off-by: Jeremy Huddleston (cherry picked from commit fd228d318428d0d9dea52ca560a9b66660dd2d02) --- hw/xquartz/xpr/xprEvent.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/hw/xquartz/xpr/xprEvent.c b/hw/xquartz/xpr/xprEvent.c index 106a91931..73bcc930d 100644 --- a/hw/xquartz/xpr/xprEvent.c +++ b/hw/xquartz/xpr/xprEvent.c @@ -52,9 +52,20 @@ #include #include +#ifdef HAVE_LIBDISPATCH +#include +#endif + #include "rootlessWindow.h" #include "xprEvent.h" +/* This is important enough to declare here if building against an old + * libXplugin, so we pick it up whenever libXplugin starts to support it. + */ +#if !defined(XPLUGIN_VERSION) || XPLUGIN_VERSION < 6 +extern xp_error xp_window_bring_all_to_front(void) __attribute__((weak_import)); +#endif + Bool QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev) { @@ -72,7 +83,28 @@ QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev) case kXquartzBringAllToFront: DEBUG_LOG("kXquartzBringAllToFront\n"); + /* There's no need to do xp_window_bring_all_to_front on Leopard, + * and we don't care about the result, so just do it async. + */ +#if defined(HAVE_LIBDISPATCH) +#if (defined(XPLUGIN_VERSION_MIN_REQUIRED) && XPLUGIN_VERSION_MIN_REQUIRED >= 6) || \ + (!defined(XPLUGIN_VERSION_MIN_REQUIRED) && defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 6) + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + xp_window_bring_all_to_front(); + }); +#else + if (&xp_window_bring_all_to_front) { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + xp_window_bring_all_to_front(); + }); + } else { + RootlessOrderAllWindows(e->data[0]); + } +#endif +#else RootlessOrderAllWindows(e->data[0]); +#endif + return TRUE; default: -- cgit v1.2.3 From e2df31de390f58211029bd975e8af0169d121737 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 23 Jul 2012 12:16:36 +0100 Subject: hw/xquartz: Various fixes for pseudoramiX.c Various fixes, applied to panoramiX.c in commit 2b266eda, also need applying to pseudoramiX.c: Fix panoramiX request and reply swapping Set window and screen values in panoramix replies Prevent buffer overrun in ProcPanoramiXGetScreenSize These fixes seem to be necessary in order to compile pseudoramiX.c with gcc pseudoramiX.c: In function 'ProcPseudoramiXGetState': pseudoramiX.c:221:56: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap pseudoramiX.c: In function 'ProcPseudoramiXGetScreenCount': pseudoramiX.c:250:62: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap pseudoramiX.c: In function 'ProcPseudoramiXGetScreenSize': pseudoramiX.c:283:56: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap pseudoramiX.c:284:57: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap Signed-off-by: Jon TURNEY Reviewed-by: Jeremy Huddleston Sequoia (cherry picked from commit 067931ccce592e319baffa26d4f7380d8d924537) --- hw/xquartz/pseudoramiX.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/hw/xquartz/pseudoramiX.c b/hw/xquartz/pseudoramiX.c index 24349e31a..0f591d5ca 100644 --- a/hw/xquartz/pseudoramiX.c +++ b/hw/xquartz/pseudoramiX.c @@ -211,10 +211,11 @@ ProcPseudoramiXGetState(ClientPtr client) rep.length = 0; rep.sequenceNumber = client->sequence; rep.state = !noPseudoramiXExtension; + rep.window = stuff->window; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); - swaps(&rep.state); + swapl(&rep.window); } WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep); return Success; @@ -240,10 +241,11 @@ ProcPseudoramiXGetScreenCount(ClientPtr client) rep.length = 0; rep.sequenceNumber = client->sequence; rep.ScreenCount = pseudoramiXNumScreens; + rep.window = stuff->window; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); - swaps(&rep.ScreenCount); + swapl(&rep.window); } WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep); return Success; @@ -260,6 +262,9 @@ ProcPseudoramiXGetScreenSize(ClientPtr client) TRACE(); + if (stuff->screen >= pseudoramiXNumScreens) + return BadMatch; + REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) @@ -273,11 +278,15 @@ ProcPseudoramiXGetScreenSize(ClientPtr client) // was screenInfo.screens[stuff->screen]->width; rep.height = pseudoramiXScreens[stuff->screen].h; // was screenInfo.screens[stuff->screen]->height; + rep.window = stuff->window; + rep.screen = stuff->screen; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); - swaps(&rep.width); - swaps(&rep.height); + swapl(&rep.width); + swapl(&rep.height); + swapl(&rep.window); + swapl(&rep.screen); } WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep); return Success; -- cgit v1.2.3 From 631715e12953a392066ca2a0787b37471747f879 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Wed, 1 Aug 2012 18:46:08 -0700 Subject: XQuartz: Fix xp_window_bring_all_to_front linking on OS versions with older libXplugin Found-by: Tinderbox Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 884f51e9770c9ccd3b38a14ea393ea2c7a5ef235) --- hw/xquartz/xpr/xprEvent.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/hw/xquartz/xpr/xprEvent.c b/hw/xquartz/xpr/xprEvent.c index 73bcc930d..398177ca8 100644 --- a/hw/xquartz/xpr/xprEvent.c +++ b/hw/xquartz/xpr/xprEvent.c @@ -59,13 +59,6 @@ #include "rootlessWindow.h" #include "xprEvent.h" -/* This is important enough to declare here if building against an old - * libXplugin, so we pick it up whenever libXplugin starts to support it. - */ -#if !defined(XPLUGIN_VERSION) || XPLUGIN_VERSION < 6 -extern xp_error xp_window_bring_all_to_front(void) __attribute__((weak_import)); -#endif - Bool QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev) { @@ -86,21 +79,18 @@ QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev) /* There's no need to do xp_window_bring_all_to_front on Leopard, * and we don't care about the result, so just do it async. */ -#if defined(HAVE_LIBDISPATCH) -#if (defined(XPLUGIN_VERSION_MIN_REQUIRED) && XPLUGIN_VERSION_MIN_REQUIRED >= 6) || \ - (!defined(XPLUGIN_VERSION_MIN_REQUIRED) && defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 6) - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - xp_window_bring_all_to_front(); - }); -#else - if (&xp_window_bring_all_to_front) { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - xp_window_bring_all_to_front(); - }); - } else { - RootlessOrderAllWindows(e->data[0]); - } -#endif +#if defined(HAVE_LIBDISPATCH) && defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 6 +# if defined(XPLUGIN_VERSION_MIN_REQUIRED) && XPLUGIN_VERSION_MIN_REQUIRED < 6 + if (&xp_window_bring_all_to_front) { +# endif + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + xp_window_bring_all_to_front(); + }); +# if defined(XPLUGIN_VERSION_MIN_REQUIRED) && XPLUGIN_VERSION_MIN_REQUIRED < 6 + } else { + RootlessOrderAllWindows(e->data[0]); + } +# endif #else RootlessOrderAllWindows(e->data[0]); #endif -- cgit v1.2.3 From ab46bdec65b4b1150ffa0aa4d9f3142e7e89cef9 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Fri, 3 Aug 2012 10:21:11 -0700 Subject: configure.ac: Version bump to 1.12.3.901 (1.12.4 RC1) Signed-off-by: Jeremy Huddleston Sequoia --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index c8dee9060..aece8198a 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,8 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.60) -AC_INIT([xorg-server], 1.12.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2012-07-09" +AC_INIT([xorg-server], 1.12.3.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2012-08-03" AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE -- cgit v1.2.3 From 7749c58134022bc6718150c3bb81f18b07687674 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 30 Jul 2012 14:32:08 -0400 Subject: ephyr: Fix up some bizarre formatting Signed-off-by: Adam Jackson Signed-off-by: Keith Packard (cherry picked from commit b46bbafae6d0a8b3f2f7853d5c1475fc223b1ed6) --- hw/kdrive/ephyr/hostx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index 6988f1625..e13910b72 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -345,7 +345,10 @@ hostx_init(void) attr.event_mask = ButtonPressMask | ButtonReleaseMask - | PointerMotionMask | KeyPressMask | KeyReleaseMask | ExposureMask; + | PointerMotionMask + | KeyPressMask + | KeyReleaseMask + | ExposureMask; EPHYR_DBG("mark"); -- cgit v1.2.3 From 3a2b67577cdf0d4e3aae28883e65cf782673198a Mon Sep 17 00:00:00 2001 From: Vic Lee Date: Mon, 30 Jul 2012 14:32:09 -0400 Subject: ephyr: Resize screen automatically when parent window is resized Bugzilla: https://bugs.freedesktop.org/25804 Reviewed-by: Adam Jackson Signed-off-by: Vic Lee Signed-off-by: Keith Packard (cherry picked from commit 8843aed82e7d69422e7763a35832a2be8f26723f) --- hw/kdrive/ephyr/ephyr.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ hw/kdrive/ephyr/hostx.c | 33 ++++++++++++++++++++++++++------- hw/kdrive/ephyr/hostx.h | 10 +++++++++- 3 files changed, 82 insertions(+), 8 deletions(-) diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index 8eda539aa..abc668e35 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -562,6 +562,8 @@ ephyrRandRSetConfig(ScreenPtr pScreen, if (wasEnabled) KdEnableScreen(pScreen); + RRScreenSizeNotify(pScreen); + return TRUE; bail4: @@ -594,6 +596,43 @@ ephyrRandRInit(ScreenPtr pScreen) pScrPriv->rrSetConfig = ephyrRandRSetConfig; return TRUE; } + +static Bool +ephyrResizeScreen (ScreenPtr pScreen, + int newwidth, + int newheight) +{ + KdScreenPriv(pScreen); + KdScreenInfo *screen = pScreenPriv->screen; + RRScreenSize size = {0}; + Bool ret; + int t; + + if (screen->randr & (RR_Rotate_90|RR_Rotate_270)) { + t = newwidth; + newwidth = newheight; + newheight = t; + } + + if (newwidth == screen->width && newheight == screen->height) { + return FALSE; + } + + size.width = newwidth; + size.height = newheight; + + ret = ephyrRandRSetConfig (pScreen, screen->randr, 0, &size); + if (ret) { + RROutputPtr output; + + output = RRFirstOutput(pScreen); + if (!output) + return FALSE; + RROutputSetModes(output, NULL, 0, 0); + } + + return ret; +} #endif Bool @@ -963,6 +1002,14 @@ ephyrPoll(void) break; #endif /* XF86DRI */ +#ifdef RANDR + case EPHYR_EV_CONFIGURE: + ephyrResizeScreen(screenInfo.screens[ev.data.configure.screen], + ev.data.configure.width, + ev.data.configure.height); + break; +#endif /* RANDR */ + default: break; } diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index e13910b72..02729d6f6 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -348,7 +348,8 @@ hostx_init(void) | PointerMotionMask | KeyPressMask | KeyReleaseMask - | ExposureMask; + | ExposureMask + | StructureNotifyMask; EPHYR_DBG("mark"); @@ -696,12 +697,14 @@ hostx_screen_init(EphyrScreenInfo screen, XResizeWindow(HostX.dpy, host_screen->win, width, height); /* Ask the WM to keep our size static */ - size_hints = XAllocSizeHints(); - size_hints->max_width = size_hints->min_width = width; - size_hints->max_height = size_hints->min_height = height; - size_hints->flags = PMinSize | PMaxSize; - XSetWMNormalHints(HostX.dpy, host_screen->win, size_hints); - XFree(size_hints); + if (host_screen->win_pre_existing == None) { + size_hints = XAllocSizeHints(); + size_hints->max_width = size_hints->min_width = width; + size_hints->max_height = size_hints->min_height = height; + size_hints->flags = PMinSize | PMaxSize; + XSetWMNormalHints(HostX.dpy, host_screen->win, size_hints); + XFree(size_hints); + } XMapWindow(HostX.dpy, host_screen->win); @@ -1004,6 +1007,22 @@ hostx_get_event(EphyrHostXEvent * ev) ev->data.key_up.scancode = xev.xkey.keycode; return 1; + case ConfigureNotify: + { + struct EphyrHostScreen *host_screen = + host_screen_from_window(xev.xconfigure.window); + + if (host_screen && host_screen->win_pre_existing != None) { + ev->type = EPHYR_EV_CONFIGURE; + ev->data.configure.width = xev.xconfigure.width; + ev->data.configure.height = xev.xconfigure.height; + ev->data.configure.window = xev.xconfigure.window; + ev->data.configure.screen = host_screen->mynum; + return 1; + } + + return 0; + } default: break; diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h index d6217119a..31c4053aa 100644 --- a/hw/kdrive/ephyr/hostx.h +++ b/hw/kdrive/ephyr/hostx.h @@ -47,7 +47,8 @@ typedef enum EphyrHostXEventType { EPHYR_EV_MOUSE_RELEASE, EPHYR_EV_KEY_PRESS, EPHYR_EV_KEY_RELEASE, - EPHYR_EV_EXPOSE + EPHYR_EV_EXPOSE, + EPHYR_EV_CONFIGURE, } EphyrHostXEventType; /* I can't believe it's not a KeySymsRec. */ @@ -89,6 +90,13 @@ struct EphyrHostXEvent { int window; } expose; + struct configure { + int width; + int height; + int screen; + int window; + } configure; + } data; int key_state; -- cgit v1.2.3 From af8ffefc070be8cb449812100b86501db17e8fd8 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 30 Jul 2012 14:32:10 -0400 Subject: kinput: allocate enough space for null character. This code wasn't allocating enough space and was assigning the NULL one past the end. Pointed out by coverity. Reviewed-by: Jeremy Huddleston Reviewed-by: Adam Jackson Signed-off-by: Dave Airlie Signed-off-by: Keith Packard (cherry picked from commit 531785dd746d64ef7f473a83ca73bb20e74b6fca) --- hw/kdrive/src/kinput.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index 692e511a8..eabee6d41 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -1055,7 +1055,7 @@ KdGetOptions(InputOption **options, char *string) if (strchr(string, '=')) { tam_key = (strchr(string, '=') - string); - key = strndup(string, tam_key); + key = strndup(string, tam_key + 1); if (!key) goto out; -- cgit v1.2.3 From afe8ef9043a0bc3b9322448c004b3f4ce203160a Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 30 Jul 2012 14:32:11 -0400 Subject: randr: Fix up yet another corner case in preferred mode selection Let's say - purely for the sake of argument, mind you - that you had a server GPU with anemic memory bandwidth, and you walked up to it and plugged in a monitor that was 1920x1080 because that's what happened to be on the crash cart. Say the memory bandwidth is such that anything larger than 1280x1024 gets filtered away. Now you're in trouble, because the established timings section includes a 720x400 mode because that's what DOS 80x25 is, and that happens to just about match the physical aspect ratio. Instead let's reuse the logic from the existing aspect-match path: pick the larger mode of either the physical aspect ratio or 4:3. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Reviewed-by: Alex Deucher Signed-off-by: Keith Packard (cherry picked from commit ff56f88616aa63797384c2c484b2bd0f194df96a) --- hw/xfree86/modes/xf86Crtc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 6d5e92f12..803de88f3 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -2054,12 +2054,13 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, /* * If there's no preferred mode, but only one monitor, pick the - * biggest mode for its aspect ratio, assuming one exists. + * biggest mode for its aspect ratio or 4:3, assuming one exists. */ if (!ret) do { int i = 0; float aspect = 0.0; + DisplayModePtr a = NULL, b = NULL; /* count the number of enabled outputs */ for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++); @@ -2073,8 +2074,11 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, aspect = (float) config->output[p]->mm_width / (float) config->output[p]->mm_height; + a = bestModeForAspect(config, enabled, 4.0/3.0); if (aspect) - preferred_match[p] = bestModeForAspect(config, enabled, aspect); + b = bestModeForAspect(config, enabled, aspect); + + preferred_match[p] = biggestMode(a, b); if (preferred_match[p]) ret = TRUE; -- cgit v1.2.3 From b6be94d89cab650ed73c5f3ca65f3a08bb79ebae Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 16 Jul 2012 20:53:00 -0700 Subject: Fix up formatting of initializers for arrays of structs The indenter seems to have gotten confused by initializing arrays of structs with the struct defined inline - for predefined structs it did a better job, so match that. Signed-off-by: Alan Coopersmith (cherry picked from commit 9f7ef7f7f0566f6319d8328ce0a1e6d0fa866720) --- Xi/extinit.c | 38 ++--- Xi/xiproperty.c | 251 ++++++++++++++--------------- config/wscons.c | 6 +- dix/gc.c | 10 +- hw/kdrive/ephyr/ephyr.c | 33 ++-- hw/kdrive/src/kdrive.c | 20 +-- hw/xfree86/loader/loader.c | 13 +- hw/xfree86/modes/xf86DisplayIDModes.c | 171 ++++++++++---------- hw/xfree86/modes/xf86EdidModes.c | 122 +++++++------- hw/xfree86/os-support/bsd/bsd_apm.c | 26 ++- hw/xfree86/os-support/bsd/bsd_kqueue_apm.c | 26 ++- hw/xfree86/os-support/bus/Sbus.c | 20 +-- hw/xfree86/os-support/linux/lnx_apm.c | 31 ++-- hw/xfree86/os-support/solaris/sun_apm.c | 26 ++- 14 files changed, 384 insertions(+), 409 deletions(-) diff --git a/Xi/extinit.c b/Xi/extinit.c index 2637f08e5..d6320b885 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -162,25 +162,25 @@ static struct dev_type { Atom type; const char *name; } dev_type[] = { - { - 0, XI_KEYBOARD}, { - 0, XI_MOUSE}, { - 0, XI_TABLET}, { - 0, XI_TOUCHSCREEN}, { - 0, XI_TOUCHPAD}, { - 0, XI_BARCODE}, { - 0, XI_BUTTONBOX}, { - 0, XI_KNOB_BOX}, { - 0, XI_ONE_KNOB}, { - 0, XI_NINE_KNOB}, { - 0, XI_TRACKBALL}, { - 0, XI_QUADRATURE}, { - 0, XI_ID_MODULE}, { - 0, XI_SPACEBALL}, { - 0, XI_DATAGLOVE}, { - 0, XI_EYETRACKER}, { - 0, XI_CURSORKEYS}, { -0, XI_FOOTMOUSE}}; + {0, XI_KEYBOARD}, + {0, XI_MOUSE}, + {0, XI_TABLET}, + {0, XI_TOUCHSCREEN}, + {0, XI_TOUCHPAD}, + {0, XI_BARCODE}, + {0, XI_BUTTONBOX}, + {0, XI_KNOB_BOX}, + {0, XI_ONE_KNOB}, + {0, XI_NINE_KNOB}, + {0, XI_TRACKBALL}, + {0, XI_QUADRATURE}, + {0, XI_ID_MODULE}, + {0, XI_SPACEBALL}, + {0, XI_DATAGLOVE}, + {0, XI_EYETRACKER}, + {0, XI_CURSORKEYS}, + {0, XI_FOOTMOUSE} +}; CARD8 event_base[numInputClasses]; XExtEventInfo EventInfo[32]; diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index e17efe407..e51aadb16 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -49,132 +49,131 @@ static struct dev_properties { Atom type; const char *name; } dev_properties[] = { - { - 0, XI_PROP_ENABLED}, { - 0, XI_PROP_XTEST_DEVICE}, { - 0, XATOM_FLOAT}, { - 0, ACCEL_PROP_PROFILE_NUMBER}, { - 0, ACCEL_PROP_CONSTANT_DECELERATION}, { - 0, ACCEL_PROP_ADAPTIVE_DECELERATION}, { - 0, ACCEL_PROP_VELOCITY_SCALING}, { - 0, AXIS_LABEL_PROP}, { - 0, AXIS_LABEL_PROP_REL_X}, { - 0, AXIS_LABEL_PROP_REL_Y}, { - 0, AXIS_LABEL_PROP_REL_Z}, { - 0, AXIS_LABEL_PROP_REL_RX}, { - 0, AXIS_LABEL_PROP_REL_RY}, { - 0, AXIS_LABEL_PROP_REL_RZ}, { - 0, AXIS_LABEL_PROP_REL_HWHEEL}, { - 0, AXIS_LABEL_PROP_REL_DIAL}, { - 0, AXIS_LABEL_PROP_REL_WHEEL}, { - 0, AXIS_LABEL_PROP_REL_MISC}, { - 0, AXIS_LABEL_PROP_REL_VSCROLL}, { - 0, AXIS_LABEL_PROP_REL_HSCROLL}, { - 0, AXIS_LABEL_PROP_ABS_X}, { - 0, AXIS_LABEL_PROP_ABS_Y}, { - 0, AXIS_LABEL_PROP_ABS_Z}, { - 0, AXIS_LABEL_PROP_ABS_RX}, { - 0, AXIS_LABEL_PROP_ABS_RY}, { - 0, AXIS_LABEL_PROP_ABS_RZ}, { - 0, AXIS_LABEL_PROP_ABS_THROTTLE}, { - 0, AXIS_LABEL_PROP_ABS_RUDDER}, { - 0, AXIS_LABEL_PROP_ABS_WHEEL}, { - 0, AXIS_LABEL_PROP_ABS_GAS}, { - 0, AXIS_LABEL_PROP_ABS_BRAKE}, { - 0, AXIS_LABEL_PROP_ABS_HAT0X}, { - 0, AXIS_LABEL_PROP_ABS_HAT0Y}, { - 0, AXIS_LABEL_PROP_ABS_HAT1X}, { - 0, AXIS_LABEL_PROP_ABS_HAT1Y}, { - 0, AXIS_LABEL_PROP_ABS_HAT2X}, { - 0, AXIS_LABEL_PROP_ABS_HAT2Y}, { - 0, AXIS_LABEL_PROP_ABS_HAT3X}, { - 0, AXIS_LABEL_PROP_ABS_HAT3Y}, { - 0, AXIS_LABEL_PROP_ABS_PRESSURE}, { - 0, AXIS_LABEL_PROP_ABS_DISTANCE}, { - 0, AXIS_LABEL_PROP_ABS_TILT_X}, { - 0, AXIS_LABEL_PROP_ABS_TILT_Y}, { - 0, AXIS_LABEL_PROP_ABS_TOOL_WIDTH}, { - 0, AXIS_LABEL_PROP_ABS_VOLUME}, { - 0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MAJOR}, { - 0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MINOR}, { - 0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MAJOR}, { - 0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MINOR}, { - 0, AXIS_LABEL_PROP_ABS_MT_ORIENTATION}, { - 0, AXIS_LABEL_PROP_ABS_MT_POSITION_X}, { - 0, AXIS_LABEL_PROP_ABS_MT_POSITION_Y}, { - 0, AXIS_LABEL_PROP_ABS_MT_TOOL_TYPE}, { - 0, AXIS_LABEL_PROP_ABS_MT_BLOB_ID}, { - 0, AXIS_LABEL_PROP_ABS_MT_TRACKING_ID}, { - 0, AXIS_LABEL_PROP_ABS_MT_PRESSURE}, { - 0, AXIS_LABEL_PROP_ABS_MISC}, { - 0, BTN_LABEL_PROP}, { - 0, BTN_LABEL_PROP_BTN_UNKNOWN}, { - 0, BTN_LABEL_PROP_BTN_WHEEL_UP}, { - 0, BTN_LABEL_PROP_BTN_WHEEL_DOWN}, { - 0, BTN_LABEL_PROP_BTN_HWHEEL_LEFT}, { - 0, BTN_LABEL_PROP_BTN_HWHEEL_RIGHT}, { - 0, BTN_LABEL_PROP_BTN_0}, { - 0, BTN_LABEL_PROP_BTN_1}, { - 0, BTN_LABEL_PROP_BTN_2}, { - 0, BTN_LABEL_PROP_BTN_3}, { - 0, BTN_LABEL_PROP_BTN_4}, { - 0, BTN_LABEL_PROP_BTN_5}, { - 0, BTN_LABEL_PROP_BTN_6}, { - 0, BTN_LABEL_PROP_BTN_7}, { - 0, BTN_LABEL_PROP_BTN_8}, { - 0, BTN_LABEL_PROP_BTN_9}, { - 0, BTN_LABEL_PROP_BTN_LEFT}, { - 0, BTN_LABEL_PROP_BTN_RIGHT}, { - 0, BTN_LABEL_PROP_BTN_MIDDLE}, { - 0, BTN_LABEL_PROP_BTN_SIDE}, { - 0, BTN_LABEL_PROP_BTN_EXTRA}, { - 0, BTN_LABEL_PROP_BTN_FORWARD}, { - 0, BTN_LABEL_PROP_BTN_BACK}, { - 0, BTN_LABEL_PROP_BTN_TASK}, { - 0, BTN_LABEL_PROP_BTN_TRIGGER}, { - 0, BTN_LABEL_PROP_BTN_THUMB}, { - 0, BTN_LABEL_PROP_BTN_THUMB2}, { - 0, BTN_LABEL_PROP_BTN_TOP}, { - 0, BTN_LABEL_PROP_BTN_TOP2}, { - 0, BTN_LABEL_PROP_BTN_PINKIE}, { - 0, BTN_LABEL_PROP_BTN_BASE}, { - 0, BTN_LABEL_PROP_BTN_BASE2}, { - 0, BTN_LABEL_PROP_BTN_BASE3}, { - 0, BTN_LABEL_PROP_BTN_BASE4}, { - 0, BTN_LABEL_PROP_BTN_BASE5}, { - 0, BTN_LABEL_PROP_BTN_BASE6}, { - 0, BTN_LABEL_PROP_BTN_DEAD}, { - 0, BTN_LABEL_PROP_BTN_A}, { - 0, BTN_LABEL_PROP_BTN_B}, { - 0, BTN_LABEL_PROP_BTN_C}, { - 0, BTN_LABEL_PROP_BTN_X}, { - 0, BTN_LABEL_PROP_BTN_Y}, { - 0, BTN_LABEL_PROP_BTN_Z}, { - 0, BTN_LABEL_PROP_BTN_TL}, { - 0, BTN_LABEL_PROP_BTN_TR}, { - 0, BTN_LABEL_PROP_BTN_TL2}, { - 0, BTN_LABEL_PROP_BTN_TR2}, { - 0, BTN_LABEL_PROP_BTN_SELECT}, { - 0, BTN_LABEL_PROP_BTN_START}, { - 0, BTN_LABEL_PROP_BTN_MODE}, { - 0, BTN_LABEL_PROP_BTN_THUMBL}, { - 0, BTN_LABEL_PROP_BTN_THUMBR}, { - 0, BTN_LABEL_PROP_BTN_TOOL_PEN}, { - 0, BTN_LABEL_PROP_BTN_TOOL_RUBBER}, { - 0, BTN_LABEL_PROP_BTN_TOOL_BRUSH}, { - 0, BTN_LABEL_PROP_BTN_TOOL_PENCIL}, { - 0, BTN_LABEL_PROP_BTN_TOOL_AIRBRUSH}, { - 0, BTN_LABEL_PROP_BTN_TOOL_FINGER}, { - 0, BTN_LABEL_PROP_BTN_TOOL_MOUSE}, { - 0, BTN_LABEL_PROP_BTN_TOOL_LENS}, { - 0, BTN_LABEL_PROP_BTN_TOUCH}, { - 0, BTN_LABEL_PROP_BTN_STYLUS}, { - 0, BTN_LABEL_PROP_BTN_STYLUS2}, { - 0, BTN_LABEL_PROP_BTN_TOOL_DOUBLETAP}, { - 0, BTN_LABEL_PROP_BTN_TOOL_TRIPLETAP}, { - 0, BTN_LABEL_PROP_BTN_GEAR_DOWN}, { - 0, BTN_LABEL_PROP_BTN_GEAR_UP}, { - 0, XI_PROP_TRANSFORM} + {0, XI_PROP_ENABLED}, + {0, XI_PROP_XTEST_DEVICE}, + {0, XATOM_FLOAT}, + {0, ACCEL_PROP_PROFILE_NUMBER}, + {0, ACCEL_PROP_CONSTANT_DECELERATION}, + {0, ACCEL_PROP_ADAPTIVE_DECELERATION}, + {0, ACCEL_PROP_VELOCITY_SCALING}, + {0, AXIS_LABEL_PROP}, + {0, AXIS_LABEL_PROP_REL_X}, + {0, AXIS_LABEL_PROP_REL_Y}, + {0, AXIS_LABEL_PROP_REL_Z}, + {0, AXIS_LABEL_PROP_REL_RX}, + {0, AXIS_LABEL_PROP_REL_RY}, + {0, AXIS_LABEL_PROP_REL_RZ}, + {0, AXIS_LABEL_PROP_REL_HWHEEL}, + {0, AXIS_LABEL_PROP_REL_DIAL}, + {0, AXIS_LABEL_PROP_REL_WHEEL}, + {0, AXIS_LABEL_PROP_REL_MISC}, + {0, AXIS_LABEL_PROP_REL_VSCROLL}, + {0, AXIS_LABEL_PROP_REL_HSCROLL}, + {0, AXIS_LABEL_PROP_ABS_X}, + {0, AXIS_LABEL_PROP_ABS_Y}, + {0, AXIS_LABEL_PROP_ABS_Z}, + {0, AXIS_LABEL_PROP_ABS_RX}, + {0, AXIS_LABEL_PROP_ABS_RY}, + {0, AXIS_LABEL_PROP_ABS_RZ}, + {0, AXIS_LABEL_PROP_ABS_THROTTLE}, + {0, AXIS_LABEL_PROP_ABS_RUDDER}, + {0, AXIS_LABEL_PROP_ABS_WHEEL}, + {0, AXIS_LABEL_PROP_ABS_GAS}, + {0, AXIS_LABEL_PROP_ABS_BRAKE}, + {0, AXIS_LABEL_PROP_ABS_HAT0X}, + {0, AXIS_LABEL_PROP_ABS_HAT0Y}, + {0, AXIS_LABEL_PROP_ABS_HAT1X}, + {0, AXIS_LABEL_PROP_ABS_HAT1Y}, + {0, AXIS_LABEL_PROP_ABS_HAT2X}, + {0, AXIS_LABEL_PROP_ABS_HAT2Y}, + {0, AXIS_LABEL_PROP_ABS_HAT3X}, + {0, AXIS_LABEL_PROP_ABS_HAT3Y}, + {0, AXIS_LABEL_PROP_ABS_PRESSURE}, + {0, AXIS_LABEL_PROP_ABS_DISTANCE}, + {0, AXIS_LABEL_PROP_ABS_TILT_X}, + {0, AXIS_LABEL_PROP_ABS_TILT_Y}, + {0, AXIS_LABEL_PROP_ABS_TOOL_WIDTH}, + {0, AXIS_LABEL_PROP_ABS_VOLUME}, + {0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MAJOR}, + {0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MINOR}, + {0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MAJOR}, + {0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MINOR}, + {0, AXIS_LABEL_PROP_ABS_MT_ORIENTATION}, + {0, AXIS_LABEL_PROP_ABS_MT_POSITION_X}, + {0, AXIS_LABEL_PROP_ABS_MT_POSITION_Y}, + {0, AXIS_LABEL_PROP_ABS_MT_TOOL_TYPE}, + {0, AXIS_LABEL_PROP_ABS_MT_BLOB_ID}, + {0, AXIS_LABEL_PROP_ABS_MT_TRACKING_ID}, + {0, AXIS_LABEL_PROP_ABS_MT_PRESSURE}, + {0, AXIS_LABEL_PROP_ABS_MISC}, + {0, BTN_LABEL_PROP}, + {0, BTN_LABEL_PROP_BTN_UNKNOWN}, + {0, BTN_LABEL_PROP_BTN_WHEEL_UP}, + {0, BTN_LABEL_PROP_BTN_WHEEL_DOWN}, + {0, BTN_LABEL_PROP_BTN_HWHEEL_LEFT}, + {0, BTN_LABEL_PROP_BTN_HWHEEL_RIGHT}, + {0, BTN_LABEL_PROP_BTN_0}, + {0, BTN_LABEL_PROP_BTN_1}, + {0, BTN_LABEL_PROP_BTN_2}, + {0, BTN_LABEL_PROP_BTN_3}, + {0, BTN_LABEL_PROP_BTN_4}, + {0, BTN_LABEL_PROP_BTN_5}, + {0, BTN_LABEL_PROP_BTN_6}, + {0, BTN_LABEL_PROP_BTN_7}, + {0, BTN_LABEL_PROP_BTN_8}, + {0, BTN_LABEL_PROP_BTN_9}, + {0, BTN_LABEL_PROP_BTN_LEFT}, + {0, BTN_LABEL_PROP_BTN_RIGHT}, + {0, BTN_LABEL_PROP_BTN_MIDDLE}, + {0, BTN_LABEL_PROP_BTN_SIDE}, + {0, BTN_LABEL_PROP_BTN_EXTRA}, + {0, BTN_LABEL_PROP_BTN_FORWARD}, + {0, BTN_LABEL_PROP_BTN_BACK}, + {0, BTN_LABEL_PROP_BTN_TASK}, + {0, BTN_LABEL_PROP_BTN_TRIGGER}, + {0, BTN_LABEL_PROP_BTN_THUMB}, + {0, BTN_LABEL_PROP_BTN_THUMB2}, + {0, BTN_LABEL_PROP_BTN_TOP}, + {0, BTN_LABEL_PROP_BTN_TOP2}, + {0, BTN_LABEL_PROP_BTN_PINKIE}, + {0, BTN_LABEL_PROP_BTN_BASE}, + {0, BTN_LABEL_PROP_BTN_BASE2}, + {0, BTN_LABEL_PROP_BTN_BASE3}, + {0, BTN_LABEL_PROP_BTN_BASE4}, + {0, BTN_LABEL_PROP_BTN_BASE5}, + {0, BTN_LABEL_PROP_BTN_BASE6}, + {0, BTN_LABEL_PROP_BTN_DEAD}, + {0, BTN_LABEL_PROP_BTN_A}, + {0, BTN_LABEL_PROP_BTN_B}, + {0, BTN_LABEL_PROP_BTN_C}, + {0, BTN_LABEL_PROP_BTN_X}, + {0, BTN_LABEL_PROP_BTN_Y}, + {0, BTN_LABEL_PROP_BTN_Z}, + {0, BTN_LABEL_PROP_BTN_TL}, + {0, BTN_LABEL_PROP_BTN_TR}, + {0, BTN_LABEL_PROP_BTN_TL2}, + {0, BTN_LABEL_PROP_BTN_TR2}, + {0, BTN_LABEL_PROP_BTN_SELECT}, + {0, BTN_LABEL_PROP_BTN_START}, + {0, BTN_LABEL_PROP_BTN_MODE}, + {0, BTN_LABEL_PROP_BTN_THUMBL}, + {0, BTN_LABEL_PROP_BTN_THUMBR}, + {0, BTN_LABEL_PROP_BTN_TOOL_PEN}, + {0, BTN_LABEL_PROP_BTN_TOOL_RUBBER}, + {0, BTN_LABEL_PROP_BTN_TOOL_BRUSH}, + {0, BTN_LABEL_PROP_BTN_TOOL_PENCIL}, + {0, BTN_LABEL_PROP_BTN_TOOL_AIRBRUSH}, + {0, BTN_LABEL_PROP_BTN_TOOL_FINGER}, + {0, BTN_LABEL_PROP_BTN_TOOL_MOUSE}, + {0, BTN_LABEL_PROP_BTN_TOOL_LENS}, + {0, BTN_LABEL_PROP_BTN_TOUCH}, + {0, BTN_LABEL_PROP_BTN_STYLUS}, + {0, BTN_LABEL_PROP_BTN_STYLUS2}, + {0, BTN_LABEL_PROP_BTN_TOOL_DOUBLETAP}, + {0, BTN_LABEL_PROP_BTN_TOOL_TRIPLETAP}, + {0, BTN_LABEL_PROP_BTN_GEAR_DOWN}, + {0, BTN_LABEL_PROP_BTN_GEAR_UP}, + {0, XI_PROP_TRANSFORM} }; static long XIPropHandlerID = 1; diff --git a/config/wscons.c b/config/wscons.c index 7a5e8cc10..fb114bd71 100644 --- a/config/wscons.c +++ b/config/wscons.c @@ -53,8 +53,10 @@ struct nameint { int val; char *name; } kbdenc[] = { - KB_OVRENC, KB_ENCTAB, { -0}}; + KB_OVRENC, + KB_ENCTAB, + {0} +}; struct nameint kbdvar[] = { {KB_NODEAD | KB_SG, "de_nodeadkeys"}, diff --git a/dix/gc.c b/dix/gc.c index 7be050221..42fca8a2b 100644 --- a/dix/gc.c +++ b/dix/gc.c @@ -419,11 +419,11 @@ static const struct { RESTYPE type; Mask access_mode; } xidfields[] = { - { - GCTile, RT_PIXMAP, DixReadAccess}, { - GCStipple, RT_PIXMAP, DixReadAccess}, { - GCFont, RT_FONT, DixUseAccess}, { -GCClipMask, RT_PIXMAP, DixReadAccess},}; + {GCTile, RT_PIXMAP, DixReadAccess}, + {GCStipple, RT_PIXMAP, DixReadAccess}, + {GCFont, RT_FONT, DixUseAccess}, + {GCClipMask, RT_PIXMAP, DixReadAccess}, +}; int ChangeGCXIDs(ClientPtr client, GC * pGC, BITS32 mask, CARD32 *pC32) diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index abc668e35..33bf4085b 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -419,23 +419,22 @@ ephyrRandRGetInfo(ScreenPtr pScreen, Rotation * rotations) struct { int width, height; } sizes[] = { - { - 1600, 1200}, { - 1400, 1050}, { - 1280, 960}, { - 1280, 1024}, { - 1152, 864}, { - 1024, 768}, { - 832, 624}, { - 800, 600}, { - 720, 400}, { - 480, 640}, { - 640, 480}, { - 640, 400}, { - 320, 240}, { - 240, 320}, { - 160, 160}, { - 0, 0} + {1600, 1200}, + {1400, 1050}, + {1280, 960}, + {1280, 1024}, + {1152, 864}, + {1024, 768}, + {832, 624}, + {800, 600}, + {720, 400}, + {480, 640}, + {640, 480}, + {640, 400}, + {320, 240}, + {240, 320}, + {160, 160}, + {0, 0} }; EPHYR_LOG("mark"); diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c index f65ab96bc..716f18ef1 100644 --- a/hw/kdrive/src/kdrive.c +++ b/hw/kdrive/src/kdrive.c @@ -730,22 +730,22 @@ KdSetSubpixelOrder(ScreenPtr pScreen, Rotation randr) int subpixel_order; Rotation direction; } orders[] = { - { - SubPixelHorizontalRGB, RR_Rotate_0}, { - SubPixelHorizontalBGR, RR_Rotate_180}, { - SubPixelVerticalRGB, RR_Rotate_270}, { - SubPixelVerticalBGR, RR_Rotate_90},}; + {SubPixelHorizontalRGB, RR_Rotate_0}, + {SubPixelHorizontalBGR, RR_Rotate_180}, + {SubPixelVerticalRGB, RR_Rotate_270}, + {SubPixelVerticalBGR, RR_Rotate_90}, + }; static struct { int bit; int normal; int reflect; } reflects[] = { - { - RR_Reflect_X, SubPixelHorizontalRGB, SubPixelHorizontalBGR}, { - RR_Reflect_X, SubPixelHorizontalBGR, SubPixelHorizontalRGB}, { - RR_Reflect_Y, SubPixelVerticalRGB, SubPixelVerticalBGR}, { - RR_Reflect_Y, SubPixelVerticalRGB, SubPixelVerticalRGB},}; + {RR_Reflect_X, SubPixelHorizontalRGB, SubPixelHorizontalBGR}, + {RR_Reflect_X, SubPixelHorizontalBGR, SubPixelHorizontalRGB}, + {RR_Reflect_Y, SubPixelVerticalRGB, SubPixelVerticalBGR}, + {RR_Reflect_Y, SubPixelVerticalRGB, SubPixelVerticalRGB}, + }; /* map subpixel to direction */ for (i = 0; i < 4; i++) diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c index 483696450..dc289c5f1 100644 --- a/hw/xfree86/loader/loader.c +++ b/hw/xfree86/loader/loader.c @@ -195,13 +195,12 @@ LoaderGetABIVersion(const char *abiclass) const char *name; int version; } classes[] = { - { - ABI_CLASS_ANSIC, LoaderVersionInfo.ansicVersion}, { - ABI_CLASS_VIDEODRV, LoaderVersionInfo.videodrvVersion}, { - ABI_CLASS_XINPUT, LoaderVersionInfo.xinputVersion}, { - ABI_CLASS_EXTENSION, LoaderVersionInfo.extensionVersion}, { - ABI_CLASS_FONT, LoaderVersionInfo.fontVersion}, { - NULL, 0} + {ABI_CLASS_ANSIC, LoaderVersionInfo.ansicVersion}, + {ABI_CLASS_VIDEODRV, LoaderVersionInfo.videodrvVersion}, + {ABI_CLASS_XINPUT, LoaderVersionInfo.xinputVersion}, + {ABI_CLASS_EXTENSION, LoaderVersionInfo.extensionVersion}, + {ABI_CLASS_FONT, LoaderVersionInfo.fontVersion}, + {NULL, 0} }; int i; diff --git a/hw/xfree86/modes/xf86DisplayIDModes.c b/hw/xfree86/modes/xf86DisplayIDModes.c index 781c806bc..bead1265a 100644 --- a/hw/xfree86/modes/xf86DisplayIDModes.c +++ b/hw/xfree86/modes/xf86DisplayIDModes.c @@ -184,105 +184,96 @@ static const struct did_dmt { short w, h, r, f; } did_dmt[] = { /* byte 3 */ - { - 640, 350, 85, 0}, { - 640, 400, 85, 0}, { - 720, 400, 85, 0}, { - 640, 480, 60, 0}, { - 640, 480, 72, 0}, { - 640, 480, 75, 0}, { - 640, 480, 85, 0}, { - 800, 600, 56, 0}, + {640, 350, 85, 0}, + {640, 400, 85, 0}, + {720, 400, 85, 0}, + {640, 480, 60, 0}, + {640, 480, 72, 0}, + {640, 480, 75, 0}, + {640, 480, 85, 0}, + {800, 600, 56, 0}, /* byte 4 */ - { - 800, 600, 60, 0}, { - 800, 600, 72, 0}, { - 800, 600, 75, 0}, { - 800, 600, 85, 0}, { - 800, 600, 120, RB}, { - 848, 480, 60, 0}, { - 1024, 768, 43, INT}, { - 1024, 768, 60, 0}, + {800, 600, 60, 0}, + {800, 600, 72, 0}, + {800, 600, 75, 0}, + {800, 600, 85, 0}, + {800, 600, 120, RB}, + {848, 480, 60, 0}, + {1024, 768, 43, INT}, + {1024, 768, 60, 0}, /* byte 5 */ - { - 1024, 768, 70, 0}, { - 1024, 768, 75, 0}, { - 1024, 768, 85, 0}, { - 1024, 768, 120, RB}, { - 1152, 864, 75, 0}, { - 1280, 768, 60, RB}, { - 1280, 768, 60, 0}, { - 1280, 768, 75, 0}, + {1024, 768, 70, 0}, + {1024, 768, 75, 0}, + {1024, 768, 85, 0}, + {1024, 768, 120, RB}, + {1152, 864, 75, 0}, + {1280, 768, 60, RB}, + {1280, 768, 60, 0}, + {1280, 768, 75, 0}, /* byte 6 */ - { - 1280, 768, 85, 0}, { - 1280, 768, 120, RB}, { - 1280, 800, 60, RB}, { - 1280, 800, 60, 0}, { - 1280, 800, 75, 0}, { - 1280, 800, 85, 0}, { - 1280, 800, 120, RB}, { - 1280, 960, 60, 0}, + {1280, 768, 85, 0}, + {1280, 768, 120, RB}, + {1280, 800, 60, RB}, + {1280, 800, 60, 0}, + {1280, 800, 75, 0}, + {1280, 800, 85, 0}, + {1280, 800, 120, RB}, + {1280, 960, 60, 0}, /* byte 7 */ - { - 1280, 960, 85, 0}, { - 1280, 960, 120, RB}, { - 1280, 1024, 60, 0}, { - 1280, 1024, 75, 0}, { - 1280, 1024, 85, 0}, { - 1280, 1024, 120, RB}, { - 1360, 768, 60, 0}, { - 1360, 768, 120, RB}, + {1280, 960, 85, 0}, + {1280, 960, 120, RB}, + {1280, 1024, 60, 0}, + {1280, 1024, 75, 0}, + {1280, 1024, 85, 0}, + {1280, 1024, 120, RB}, + {1360, 768, 60, 0}, + {1360, 768, 120, RB}, /* byte 8 */ - { - 1400, 1050, 60, RB}, { - 1400, 1050, 60, 0}, { - 1400, 1050, 75, 0}, { - 1400, 1050, 85, 0}, { - 1400, 1050, 120, RB}, { - 1440, 900, 60, RB}, { - 1440, 900, 60, 0}, { - 1440, 900, 75, 0}, + {1400, 1050, 60, RB}, + {1400, 1050, 60, 0}, + {1400, 1050, 75, 0}, + {1400, 1050, 85, 0}, + {1400, 1050, 120, RB}, + {1440, 900, 60, RB}, + {1440, 900, 60, 0}, + {1440, 900, 75, 0}, /* byte 9 */ - { - 1440, 900, 85, 0}, { - 1440, 900, 120, RB}, { - 1600, 1200, 60, 0}, { - 1600, 1200, 65, 0}, { - 1600, 1200, 70, 0}, { - 1600, 1200, 75, 0}, { - 1600, 1200, 85, 0}, { - 1600, 1200, 120, RB}, + {1440, 900, 85, 0}, + {1440, 900, 120, RB}, + {1600, 1200, 60, 0}, + {1600, 1200, 65, 0}, + {1600, 1200, 70, 0}, + {1600, 1200, 75, 0}, + {1600, 1200, 85, 0}, + {1600, 1200, 120, RB}, /* byte a */ - { - 1680, 1050, 60, RB}, { - 1680, 1050, 60, 0}, { - 1680, 1050, 75, 0}, { - 1680, 1050, 85, 0}, { - 1680, 1050, 120, RB}, { - 1792, 1344, 60, 0}, { - 1792, 1344, 75, 0}, { - 1792, 1344, 120, RB}, + {1680, 1050, 60, RB}, + {1680, 1050, 60, 0}, + {1680, 1050, 75, 0}, + {1680, 1050, 85, 0}, + {1680, 1050, 120, RB}, + {1792, 1344, 60, 0}, + {1792, 1344, 75, 0}, + {1792, 1344, 120, RB}, /* byte b */ - { - 1856, 1392, 60, 0}, { - 1856, 1392, 75, 0}, { - 1856, 1392, 120, RB}, { - 1920, 1200, 60, RB}, { - 1920, 1200, 60, 0}, { - 1920, 1200, 75, 0}, { - 1920, 1200, 85, 0}, { - 1920, 1200, 120, RB}, + {1856, 1392, 60, 0}, + {1856, 1392, 75, 0}, + {1856, 1392, 120, RB}, + {1920, 1200, 60, RB}, + {1920, 1200, 60, 0}, + {1920, 1200, 75, 0}, + {1920, 1200, 85, 0}, + {1920, 1200, 120, RB}, /* byte c */ - { - 1920, 1440, 60, 0}, { - 1920, 1440, 75, 0}, { - 1920, 1440, 120, RB}, { - 2560, 1600, 60, RB}, { - 2560, 1600, 60, 0}, { - 2560, 1600, 75, 0}, { - 2560, 1600, 85, 0}, { -2560, 1600, 120, RB},}; + {1920, 1440, 60, 0}, + {1920, 1440, 75, 0}, + {1920, 1440, 120, RB}, + {2560, 1600, 60, RB}, + {2560, 1600, 60, 0}, + {2560, 1600, 75, 0}, + {2560, 1600, 85, 0}, + {2560, 1600, 120, RB}, +}; static void didVesaTiming(int scrn, unsigned char *x, MonPtr mon) diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c index 258ada5b4..4ee862da0 100644 --- a/hw/xfree86/modes/xf86EdidModes.c +++ b/hw/xfree86/modes/xf86EdidModes.c @@ -513,14 +513,14 @@ DDCModeDoInterlaceQuirks(DisplayModePtr mode) static const struct { int w, h; } cea_interlaced[] = { - { - 1920, 1080}, { - 720, 480}, { - 1440, 480}, { - 2880, 480}, { - 720, 576}, { - 1440, 576}, { - 2880, 576},}; + {1920, 1080}, + {720, 480}, + {1440, 480}, + {2880, 480}, + {720, 576}, + {1440, 576}, + {2880, 576}, + }; static const int n_modes = sizeof(cea_interlaced) / sizeof(cea_interlaced[0]); int i; @@ -668,68 +668,62 @@ static const struct { short r; short rb; } EstIIIModes[] = { - /* byte 6 */ - { - 640, 350, 85, 0}, { - 640, 400, 85, 0}, { - 720, 400, 85, 0}, { - 640, 480, 85, 0}, { - 848, 480, 60, 0}, { - 800, 600, 85, 0}, { - 1024, 768, 85, 0}, { - 1152, 864, 75, 0}, + /* byte 6 */ + {640, 350, 85, 0}, + {640, 400, 85, 0}, + {720, 400, 85, 0}, + {640, 480, 85, 0}, + {848, 480, 60, 0}, + {800, 600, 85, 0}, + {1024, 768, 85, 0}, + {1152, 864, 75, 0}, /* byte 7 */ - { - 1280, 768, 60, 1}, { - 1280, 768, 60, 0}, { - 1280, 768, 75, 0}, { - 1280, 768, 85, 0}, { - 1280, 960, 60, 0}, { - 1280, 960, 85, 0}, { - 1280, 1024, 60, 0}, { - 1280, 1024, 85, 0}, + {1280, 768, 60, 1}, + {1280, 768, 60, 0}, + {1280, 768, 75, 0}, + {1280, 768, 85, 0}, + {1280, 960, 60, 0}, + {1280, 960, 85, 0}, + {1280, 1024, 60, 0}, + {1280, 1024, 85, 0}, /* byte 8 */ - { - 1360, 768, 60, 0}, { - 1440, 900, 60, 1}, { - 1440, 900, 60, 0}, { - 1440, 900, 75, 0}, { - 1440, 900, 85, 0}, { - 1400, 1050, 60, 1}, { - 1400, 1050, 60, 0}, { - 1400, 1050, 75, 0}, + {1360, 768, 60, 0}, + {1440, 900, 60, 1}, + {1440, 900, 60, 0}, + {1440, 900, 75, 0}, + {1440, 900, 85, 0}, + {1400, 1050, 60, 1}, + {1400, 1050, 60, 0}, + {1400, 1050, 75, 0}, /* byte 9 */ - { - 1400, 1050, 85, 0}, { - 1680, 1050, 60, 1}, { - 1680, 1050, 60, 0}, { - 1680, 1050, 75, 0}, { - 1680, 1050, 85, 0}, { - 1600, 1200, 60, 0}, { - 1600, 1200, 65, 0}, { - 1600, 1200, 70, 0}, + {1400, 1050, 85, 0}, + {1680, 1050, 60, 1}, + {1680, 1050, 60, 0}, + {1680, 1050, 75, 0}, + {1680, 1050, 85, 0}, + {1600, 1200, 60, 0}, + {1600, 1200, 65, 0}, + {1600, 1200, 70, 0}, /* byte 10 */ - { - 1600, 1200, 75, 0}, { - 1600, 1200, 85, 0}, { - 1792, 1344, 60, 0}, { - 1792, 1344, 85, 0}, { - 1856, 1392, 60, 0}, { - 1856, 1392, 75, 0}, { - 1920, 1200, 60, 1}, { - 1920, 1200, 60, 0}, + {1600, 1200, 75, 0}, + {1600, 1200, 85, 0}, + {1792, 1344, 60, 0}, + {1792, 1344, 85, 0}, + {1856, 1392, 60, 0}, + {1856, 1392, 75, 0}, + {1920, 1200, 60, 1}, + {1920, 1200, 60, 0}, /* byte 11 */ - { - 1920, 1200, 75, 0}, { - 1920, 1200, 85, 0}, { - 1920, 1440, 60, 0}, { - 1920, 1440, 75, 0}, + {1920, 1200, 75, 0}, + {1920, 1200, 85, 0}, + {1920, 1440, 60, 0}, + {1920, 1440, 75, 0}, /* fill up last byte */ - { - 0,0,0,0}, { - 0,0,0,0}, { - 0,0,0,0}, { - 0,0,0,0}, }; + {0,0,0,0}, + {0,0,0,0}, + {0,0,0,0}, + {0,0,0,0}, +}; static DisplayModePtr DDCModesFromEstIII(unsigned char *est) diff --git a/hw/xfree86/os-support/bsd/bsd_apm.c b/hw/xfree86/os-support/bsd/bsd_apm.c index a8a4164e0..b1938cf0d 100644 --- a/hw/xfree86/os-support/bsd/bsd_apm.c +++ b/hw/xfree86/os-support/bsd/bsd_apm.c @@ -21,21 +21,19 @@ static struct { u_int apmBsd; pmEvent xf86; } bsdToXF86Array[] = { - { - APM_STANDBY_REQ, XF86_APM_SYS_STANDBY}, { - APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND}, { - APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, { - APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME}, { - APM_BATTERY_LOW, XF86_APM_LOW_BATTERY}, { - APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, { - APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, { - APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND}, { - APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY}, { - APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND}, { - APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME}, + {APM_STANDBY_REQ, XF86_APM_SYS_STANDBY}, + {APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND}, + {APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, + {APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME}, + {APM_BATTERY_LOW, XF86_APM_LOW_BATTERY}, + {APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, + {APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, + {APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND}, + {APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY}, + {APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND}, + {APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME}, #ifdef APM_CAPABILITY_CHANGE - { - APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED}, + {APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED}, #endif }; diff --git a/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c b/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c index 10251f38e..22943855b 100644 --- a/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c +++ b/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c @@ -54,21 +54,19 @@ static struct { u_int apmBsd; pmEvent xf86; } bsdToXF86Array[] = { - { - APM_STANDBY_REQ, XF86_APM_SYS_STANDBY}, { - APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND}, { - APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, { - APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME}, { - APM_BATTERY_LOW, XF86_APM_LOW_BATTERY}, { - APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, { - APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, { - APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND}, { - APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY}, { - APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND}, { - APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME}, + {APM_STANDBY_REQ, XF86_APM_SYS_STANDBY}, + {APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND}, + {APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, + {APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME}, + {APM_BATTERY_LOW, XF86_APM_LOW_BATTERY}, + {APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, + {APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, + {APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND}, + {APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY}, + {APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND}, + {APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME}, #ifdef APM_CAPABILITY_CHANGE - { - APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED}, + {APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED}, #endif }; diff --git a/hw/xfree86/os-support/bus/Sbus.c b/hw/xfree86/os-support/bus/Sbus.c index b75308aa1..826000712 100644 --- a/hw/xfree86/os-support/bus/Sbus.c +++ b/hw/xfree86/os-support/bus/Sbus.c @@ -403,16 +403,16 @@ sparcPromAssignNodes(void) int devId; char *prefix; } procFbPrefixes[] = { - { - SBUS_DEVICE_BW2, "BWtwo"}, { - SBUS_DEVICE_CG14, "CGfourteen"}, { - SBUS_DEVICE_CG6, "CGsix"}, { - SBUS_DEVICE_CG3, "CGthree"}, { - SBUS_DEVICE_FFB, "Creator"}, { - SBUS_DEVICE_FFB, "Elite 3D"}, { - SBUS_DEVICE_LEO, "Leo"}, { - SBUS_DEVICE_TCX, "TCX"}, { - 0, NULL},}; + {SBUS_DEVICE_BW2, "BWtwo"}, + {SBUS_DEVICE_CG14, "CGfourteen"}, + {SBUS_DEVICE_CG6, "CGsix"}, + {SBUS_DEVICE_CG3, "CGthree"}, + {SBUS_DEVICE_FFB, "Creator"}, + {SBUS_DEVICE_FFB, "Elite 3D"}, + {SBUS_DEVICE_LEO, "Leo"}, + {SBUS_DEVICE_TCX, "TCX"}, + {0, NULL}, + }; while (fscanf(f, "%d %63s\n", &fbNum, buffer) == 2) { for (i = 0; procFbPrefixes[i].devId; i++) diff --git a/hw/xfree86/os-support/linux/lnx_apm.c b/hw/xfree86/os-support/linux/lnx_apm.c index a37331e52..387934099 100644 --- a/hw/xfree86/os-support/linux/lnx_apm.c +++ b/hw/xfree86/os-support/linux/lnx_apm.c @@ -42,26 +42,23 @@ static struct { apm_event_t apmLinux; pmEvent xf86; } LinuxToXF86[] = { - { - APM_SYS_STANDBY, XF86_APM_SYS_STANDBY}, { - APM_SYS_SUSPEND, XF86_APM_SYS_SUSPEND}, { - APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, { - APM_CRITICAL_RESUME, XF86_APM_CRITICAL_RESUME}, { - APM_LOW_BATTERY, XF86_APM_LOW_BATTERY}, { - APM_POWER_STATUS_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, { - APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, { - APM_CRITICAL_SUSPEND, XF86_APM_CRITICAL_SUSPEND}, { - APM_USER_STANDBY, XF86_APM_USER_STANDBY}, { - APM_USER_SUSPEND, XF86_APM_USER_SUSPEND}, { - APM_STANDBY_RESUME, XF86_APM_STANDBY_RESUME}, + {APM_SYS_STANDBY, XF86_APM_SYS_STANDBY}, + {APM_SYS_SUSPEND, XF86_APM_SYS_SUSPEND}, + {APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, + {APM_CRITICAL_RESUME, XF86_APM_CRITICAL_RESUME}, + {APM_LOW_BATTERY, XF86_APM_LOW_BATTERY}, + {APM_POWER_STATUS_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, + {APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, + {APM_CRITICAL_SUSPEND, XF86_APM_CRITICAL_SUSPEND}, + {APM_USER_STANDBY, XF86_APM_USER_STANDBY}, + {APM_USER_SUSPEND, XF86_APM_USER_SUSPEND}, + {APM_STANDBY_RESUME, XF86_APM_STANDBY_RESUME}, #if defined(APM_CAPABILITY_CHANGED) - { - APM_CAPABILITY_CHANGED, XF86_CAPABILITY_CHANGED}, + {APM_CAPABILITY_CHANGED, XF86_CAPABILITY_CHANGED}, #endif #if 0 - { - APM_STANDBY_FAILED, XF86_APM_STANDBY_FAILED}, { - APM_SUSPEND_FAILED, XF86_APM_SUSPEND_FAILED} + {APM_STANDBY_FAILED, XF86_APM_STANDBY_FAILED}, + {APM_SUSPEND_FAILED, XF86_APM_SUSPEND_FAILED} #endif }; diff --git a/hw/xfree86/os-support/solaris/sun_apm.c b/hw/xfree86/os-support/solaris/sun_apm.c index 4ff64649a..b6a1432f6 100644 --- a/hw/xfree86/os-support/solaris/sun_apm.c +++ b/hw/xfree86/os-support/solaris/sun_apm.c @@ -97,21 +97,19 @@ static struct { u_int apmBsd; pmEvent xf86; } sunToXF86Array[] = { - { - APM_STANDBY_REQ, XF86_APM_SYS_STANDBY}, { - APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND}, { - APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, { - APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME}, { - APM_BATTERY_LOW, XF86_APM_LOW_BATTERY}, { - APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, { - APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, { - APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND}, { - APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY}, { - APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND}, { - APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME}, + {APM_STANDBY_REQ, XF86_APM_SYS_STANDBY}, + {APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND}, + {APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, + {APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME}, + {APM_BATTERY_LOW, XF86_APM_LOW_BATTERY}, + {APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, + {APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, + {APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND}, + {APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY}, + {APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND}, + {APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME}, #ifdef APM_CAPABILITY_CHANGE - { - APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED}, + {APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED}, #endif }; -- cgit v1.2.3 From 83cba78a0c858df4d5405783f3a1fb4bab128129 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 16 Jul 2012 21:12:06 -0700 Subject: Make indentation of dix/tables.c much more consistent and readable Signed-off-by: Alan Coopersmith Acked-by: Daniel Stone (cherry picked from commit c37c65052f674cd58894ad0b9ec22928a62c624e) --- dix/tables.c | 955 +++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 560 insertions(+), 395 deletions(-) diff --git a/dix/tables.c b/dix/tables.c index 705ef0d4d..686cddd7d 100644 --- a/dix/tables.c +++ b/dix/tables.c @@ -58,364 +58,529 @@ SOFTWARE. #include "swaprep.h" #include "swapreq.h" -int (*InitialVector[3]) (ClientPtr /* client */ - ) = { -0, ProcInitialConnection, ProcEstablishConnection}; +int (*InitialVector[3]) (ClientPtr /* client */) = { + 0, + ProcInitialConnection, + ProcEstablishConnection +}; -int (*ProcVector[256]) (ClientPtr /* client */ - ) = { - ProcBadRequest, ProcCreateWindow, ProcChangeWindowAttributes, ProcGetWindowAttributes, ProcDestroyWindow, ProcDestroySubwindows, /* 5 */ - ProcChangeSaveSet, ProcReparentWindow, ProcMapWindow, ProcMapSubwindows, ProcUnmapWindow, /* 10 */ - ProcUnmapSubwindows, ProcConfigureWindow, ProcCirculateWindow, ProcGetGeometry, ProcQueryTree, /* 15 */ - ProcInternAtom, ProcGetAtomName, ProcChangeProperty, ProcDeleteProperty, ProcGetProperty, /* 20 */ - ProcListProperties, ProcSetSelectionOwner, ProcGetSelectionOwner, ProcConvertSelection, ProcSendEvent, /* 25 */ - ProcGrabPointer, ProcUngrabPointer, ProcGrabButton, ProcUngrabButton, ProcChangeActivePointerGrab, /* 30 */ - ProcGrabKeyboard, ProcUngrabKeyboard, ProcGrabKey, ProcUngrabKey, ProcAllowEvents, /* 35 */ - ProcGrabServer, ProcUngrabServer, ProcQueryPointer, ProcGetMotionEvents, ProcTranslateCoords, /* 40 */ - ProcWarpPointer, ProcSetInputFocus, ProcGetInputFocus, ProcQueryKeymap, ProcOpenFont, /* 45 */ - ProcCloseFont, ProcQueryFont, ProcQueryTextExtents, ProcListFonts, ProcListFontsWithInfo, /* 50 */ - ProcSetFontPath, ProcGetFontPath, ProcCreatePixmap, ProcFreePixmap, ProcCreateGC, /* 55 */ - ProcChangeGC, ProcCopyGC, ProcSetDashes, ProcSetClipRectangles, ProcFreeGC, /* 60 */ - ProcClearToBackground, ProcCopyArea, ProcCopyPlane, ProcPolyPoint, ProcPolyLine, /* 65 */ - ProcPolySegment, ProcPolyRectangle, ProcPolyArc, ProcFillPoly, ProcPolyFillRectangle, /* 70 */ - ProcPolyFillArc, ProcPutImage, ProcGetImage, ProcPolyText, ProcPolyText, /* 75 */ - ProcImageText8, ProcImageText16, ProcCreateColormap, ProcFreeColormap, ProcCopyColormapAndFree, /* 80 */ - ProcInstallColormap, ProcUninstallColormap, ProcListInstalledColormaps, ProcAllocColor, ProcAllocNamedColor, /* 85 */ - ProcAllocColorCells, ProcAllocColorPlanes, ProcFreeColors, ProcStoreColors, ProcStoreNamedColor, /* 90 */ - ProcQueryColors, ProcLookupColor, ProcCreateCursor, ProcCreateGlyphCursor, ProcFreeCursor, /* 95 */ - ProcRecolorCursor, ProcQueryBestSize, ProcQueryExtension, ProcListExtensions, ProcChangeKeyboardMapping, /* 100 */ - ProcGetKeyboardMapping, ProcChangeKeyboardControl, ProcGetKeyboardControl, ProcBell, ProcChangePointerControl, /* 105 */ - ProcGetPointerControl, ProcSetScreenSaver, ProcGetScreenSaver, ProcChangeHosts, ProcListHosts, /* 110 */ - ProcChangeAccessControl, ProcChangeCloseDownMode, ProcKillClient, ProcRotateProperties, ProcForceScreenSaver, /* 115 */ - ProcSetPointerMapping, ProcGetPointerMapping, ProcSetModifierMapping, ProcGetModifierMapping, ProcBadRequest, /* 120 */ - ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest, /* 125 */ -ProcBadRequest, - ProcNoOperation, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest}; +int (*ProcVector[256]) (ClientPtr /* client */) = { + ProcBadRequest, + ProcCreateWindow, + ProcChangeWindowAttributes, + ProcGetWindowAttributes, + ProcDestroyWindow, + ProcDestroySubwindows, /* 5 */ + ProcChangeSaveSet, + ProcReparentWindow, + ProcMapWindow, + ProcMapSubwindows, + ProcUnmapWindow, /* 10 */ + ProcUnmapSubwindows, + ProcConfigureWindow, + ProcCirculateWindow, + ProcGetGeometry, + ProcQueryTree, /* 15 */ + ProcInternAtom, + ProcGetAtomName, + ProcChangeProperty, + ProcDeleteProperty, + ProcGetProperty, /* 20 */ + ProcListProperties, + ProcSetSelectionOwner, + ProcGetSelectionOwner, + ProcConvertSelection, + ProcSendEvent, /* 25 */ + ProcGrabPointer, + ProcUngrabPointer, + ProcGrabButton, + ProcUngrabButton, + ProcChangeActivePointerGrab, /* 30 */ + ProcGrabKeyboard, + ProcUngrabKeyboard, + ProcGrabKey, + ProcUngrabKey, + ProcAllowEvents, /* 35 */ + ProcGrabServer, + ProcUngrabServer, + ProcQueryPointer, + ProcGetMotionEvents, + ProcTranslateCoords, /* 40 */ + ProcWarpPointer, + ProcSetInputFocus, + ProcGetInputFocus, + ProcQueryKeymap, + ProcOpenFont, /* 45 */ + ProcCloseFont, + ProcQueryFont, + ProcQueryTextExtents, + ProcListFonts, + ProcListFontsWithInfo, /* 50 */ + ProcSetFontPath, + ProcGetFontPath, + ProcCreatePixmap, + ProcFreePixmap, + ProcCreateGC, /* 55 */ + ProcChangeGC, + ProcCopyGC, + ProcSetDashes, + ProcSetClipRectangles, + ProcFreeGC, /* 60 */ + ProcClearToBackground, + ProcCopyArea, + ProcCopyPlane, + ProcPolyPoint, + ProcPolyLine, /* 65 */ + ProcPolySegment, + ProcPolyRectangle, + ProcPolyArc, + ProcFillPoly, + ProcPolyFillRectangle, /* 70 */ + ProcPolyFillArc, + ProcPutImage, + ProcGetImage, + ProcPolyText, + ProcPolyText, /* 75 */ + ProcImageText8, + ProcImageText16, + ProcCreateColormap, + ProcFreeColormap, + ProcCopyColormapAndFree, /* 80 */ + ProcInstallColormap, + ProcUninstallColormap, + ProcListInstalledColormaps, + ProcAllocColor, + ProcAllocNamedColor, /* 85 */ + ProcAllocColorCells, + ProcAllocColorPlanes, + ProcFreeColors, + ProcStoreColors, + ProcStoreNamedColor, /* 90 */ + ProcQueryColors, + ProcLookupColor, + ProcCreateCursor, + ProcCreateGlyphCursor, + ProcFreeCursor, /* 95 */ + ProcRecolorCursor, + ProcQueryBestSize, + ProcQueryExtension, + ProcListExtensions, + ProcChangeKeyboardMapping, /* 100 */ + ProcGetKeyboardMapping, + ProcChangeKeyboardControl, + ProcGetKeyboardControl, + ProcBell, + ProcChangePointerControl, /* 105 */ + ProcGetPointerControl, + ProcSetScreenSaver, + ProcGetScreenSaver, + ProcChangeHosts, + ProcListHosts, /* 110 */ + ProcChangeAccessControl, + ProcChangeCloseDownMode, + ProcKillClient, + ProcRotateProperties, + ProcForceScreenSaver, /* 115 */ + ProcSetPointerMapping, + ProcGetPointerMapping, + ProcSetModifierMapping, + ProcGetModifierMapping, + ProcBadRequest, /* 120 */ + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, /* 125 */ + ProcBadRequest, + ProcNoOperation, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest +}; -int (*SwappedProcVector[256]) (ClientPtr /* client */ - ) = { - ProcBadRequest, SProcCreateWindow, SProcChangeWindowAttributes, SProcResourceReq, /* GetWindowAttributes */ - SProcResourceReq, /* DestroyWindow */ - SProcResourceReq, /* 5 DestroySubwindows */ - SProcResourceReq, /* SProcChangeSaveSet, */ - SProcReparentWindow, SProcResourceReq, /* MapWindow */ - SProcResourceReq, /* MapSubwindows */ - SProcResourceReq, /* 10 UnmapWindow */ - SProcResourceReq, /* UnmapSubwindows */ - SProcConfigureWindow, SProcResourceReq, /* SProcCirculateWindow, */ - SProcResourceReq, /* GetGeometry */ - SProcResourceReq, /* 15 QueryTree */ - SProcInternAtom, SProcResourceReq, /* SProcGetAtomName, */ - SProcChangeProperty, SProcDeleteProperty, SProcGetProperty, /* 20 */ - SProcResourceReq, /* SProcListProperties, */ - SProcSetSelectionOwner, SProcResourceReq, /* SProcGetSelectionOwner, */ - SProcConvertSelection, SProcSendEvent, /* 25 */ - SProcGrabPointer, SProcResourceReq, /* SProcUngrabPointer, */ - SProcGrabButton, SProcUngrabButton, SProcChangeActivePointerGrab, /* 30 */ - SProcGrabKeyboard, SProcResourceReq, /* SProcUngrabKeyboard, */ - SProcGrabKey, SProcUngrabKey, SProcResourceReq, /* 35 SProcAllowEvents, */ - SProcSimpleReq, /* SProcGrabServer, */ - SProcSimpleReq, /* SProcUngrabServer, */ - SProcResourceReq, /* SProcQueryPointer, */ - SProcGetMotionEvents, SProcTranslateCoords, /*40 */ - SProcWarpPointer, SProcSetInputFocus, SProcSimpleReq, /* SProcGetInputFocus, */ - SProcSimpleReq, /* QueryKeymap, */ - SProcOpenFont, /* 45 */ - SProcResourceReq, /* SProcCloseFont, */ - SProcResourceReq, /* SProcQueryFont, */ - SProcResourceReq, /* SProcQueryTextExtents, */ - SProcListFonts, SProcListFontsWithInfo, /* 50 */ - SProcSetFontPath, SProcSimpleReq, /* GetFontPath, */ - SProcCreatePixmap, SProcResourceReq, /* SProcFreePixmap, */ - SProcCreateGC, /* 55 */ - SProcChangeGC, SProcCopyGC, SProcSetDashes, SProcSetClipRectangles, SProcResourceReq, /* 60 SProcFreeGC, */ - SProcClearToBackground, SProcCopyArea, SProcCopyPlane, SProcPoly, /* PolyPoint, */ - SProcPoly, /* 65 PolyLine */ - SProcPoly, /* PolySegment, */ - SProcPoly, /* PolyRectangle, */ - SProcPoly, /* PolyArc, */ - SProcFillPoly, SProcPoly, /* 70 PolyFillRectangle */ - SProcPoly, /* PolyFillArc, */ - SProcPutImage, SProcGetImage, SProcPolyText, SProcPolyText, /* 75 */ - SProcImageText, SProcImageText, SProcCreateColormap, SProcResourceReq, /* SProcFreeColormap, */ - SProcCopyColormapAndFree, /* 80 */ - SProcResourceReq, /* SProcInstallColormap, */ - SProcResourceReq, /* SProcUninstallColormap, */ - SProcResourceReq, /* SProcListInstalledColormaps, */ - SProcAllocColor, SProcAllocNamedColor, /* 85 */ - SProcAllocColorCells, SProcAllocColorPlanes, SProcFreeColors, SProcStoreColors, SProcStoreNamedColor, /* 90 */ - SProcQueryColors, SProcLookupColor, SProcCreateCursor, SProcCreateGlyphCursor, SProcResourceReq, /* 95 SProcFreeCursor, */ - SProcRecolorCursor, SProcQueryBestSize, SProcQueryExtension, SProcSimpleReq, /* ListExtensions, */ - SProcChangeKeyboardMapping, /* 100 */ - SProcSimpleReq, /* GetKeyboardMapping, */ - SProcChangeKeyboardControl, SProcSimpleReq, /* GetKeyboardControl, */ - SProcSimpleReq, /* Bell, */ - SProcChangePointerControl, /* 105 */ - SProcSimpleReq, /* GetPointerControl, */ - SProcSetScreenSaver, SProcSimpleReq, /* GetScreenSaver, */ - SProcChangeHosts, SProcSimpleReq, /* 110 ListHosts, */ - SProcSimpleReq, /* SProcChangeAccessControl, */ - SProcSimpleReq, /* SProcChangeCloseDownMode, */ - SProcResourceReq, /* SProcKillClient, */ - SProcRotateProperties, SProcSimpleReq, /* 115 ForceScreenSaver */ - SProcSimpleReq, /* SetPointerMapping, */ - SProcSimpleReq, /* GetPointerMapping, */ - SProcSimpleReq, /* SetModifierMapping, */ - SProcSimpleReq, /* GetModifierMapping, */ - ProcBadRequest, /* 120 */ - ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest, /* 125 */ -ProcBadRequest, - SProcNoOperation, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest}; +int (*SwappedProcVector[256]) (ClientPtr /* client */) = { + ProcBadRequest, + SProcCreateWindow, + SProcChangeWindowAttributes, + SProcResourceReq, /* GetWindowAttributes */ + SProcResourceReq, /* DestroyWindow */ + SProcResourceReq, /* 5 DestroySubwindows */ + SProcResourceReq, /* SProcChangeSaveSet, */ + SProcReparentWindow, + SProcResourceReq, /* MapWindow */ + SProcResourceReq, /* MapSubwindows */ + SProcResourceReq, /* 10 UnmapWindow */ + SProcResourceReq, /* UnmapSubwindows */ + SProcConfigureWindow, + SProcResourceReq, /* SProcCirculateWindow, */ + SProcResourceReq, /* GetGeometry */ + SProcResourceReq, /* 15 QueryTree */ + SProcInternAtom, + SProcResourceReq, /* SProcGetAtomName, */ + SProcChangeProperty, + SProcDeleteProperty, + SProcGetProperty, /* 20 */ + SProcResourceReq, /* SProcListProperties, */ + SProcSetSelectionOwner, + SProcResourceReq, /* SProcGetSelectionOwner, */ + SProcConvertSelection, + SProcSendEvent, /* 25 */ + SProcGrabPointer, + SProcResourceReq, /* SProcUngrabPointer, */ + SProcGrabButton, + SProcUngrabButton, + SProcChangeActivePointerGrab, /* 30 */ + SProcGrabKeyboard, + SProcResourceReq, /* SProcUngrabKeyboard, */ + SProcGrabKey, + SProcUngrabKey, + SProcResourceReq, /* 35 SProcAllowEvents, */ + SProcSimpleReq, /* SProcGrabServer, */ + SProcSimpleReq, /* SProcUngrabServer, */ + SProcResourceReq, /* SProcQueryPointer, */ + SProcGetMotionEvents, + SProcTranslateCoords, /*40 */ + SProcWarpPointer, + SProcSetInputFocus, + SProcSimpleReq, /* SProcGetInputFocus, */ + SProcSimpleReq, /* QueryKeymap, */ + SProcOpenFont, /* 45 */ + SProcResourceReq, /* SProcCloseFont, */ + SProcResourceReq, /* SProcQueryFont, */ + SProcResourceReq, /* SProcQueryTextExtents, */ + SProcListFonts, + SProcListFontsWithInfo, /* 50 */ + SProcSetFontPath, + SProcSimpleReq, /* GetFontPath, */ + SProcCreatePixmap, + SProcResourceReq, /* SProcFreePixmap, */ + SProcCreateGC, /* 55 */ + SProcChangeGC, + SProcCopyGC, + SProcSetDashes, + SProcSetClipRectangles, + SProcResourceReq, /* 60 SProcFreeGC, */ + SProcClearToBackground, + SProcCopyArea, + SProcCopyPlane, + SProcPoly, /* PolyPoint, */ + SProcPoly, /* 65 PolyLine */ + SProcPoly, /* PolySegment, */ + SProcPoly, /* PolyRectangle, */ + SProcPoly, /* PolyArc, */ + SProcFillPoly, + SProcPoly, /* 70 PolyFillRectangle */ + SProcPoly, /* PolyFillArc, */ + SProcPutImage, + SProcGetImage, + SProcPolyText, + SProcPolyText, /* 75 */ + SProcImageText, + SProcImageText, + SProcCreateColormap, + SProcResourceReq, /* SProcFreeColormap, */ + SProcCopyColormapAndFree, /* 80 */ + SProcResourceReq, /* SProcInstallColormap, */ + SProcResourceReq, /* SProcUninstallColormap, */ + SProcResourceReq, /* SProcListInstalledColormaps, */ + SProcAllocColor, + SProcAllocNamedColor, /* 85 */ + SProcAllocColorCells, + SProcAllocColorPlanes, + SProcFreeColors, + SProcStoreColors, + SProcStoreNamedColor, /* 90 */ + SProcQueryColors, + SProcLookupColor, + SProcCreateCursor, + SProcCreateGlyphCursor, + SProcResourceReq, /* 95 SProcFreeCursor, */ + SProcRecolorCursor, + SProcQueryBestSize, + SProcQueryExtension, + SProcSimpleReq, /* ListExtensions, */ + SProcChangeKeyboardMapping, /* 100 */ + SProcSimpleReq, /* GetKeyboardMapping, */ + SProcChangeKeyboardControl, + SProcSimpleReq, /* GetKeyboardControl, */ + SProcSimpleReq, /* Bell, */ + SProcChangePointerControl, /* 105 */ + SProcSimpleReq, /* GetPointerControl, */ + SProcSetScreenSaver, + SProcSimpleReq, /* GetScreenSaver, */ + SProcChangeHosts, + SProcSimpleReq, /* 110 ListHosts, */ + SProcSimpleReq, /* SProcChangeAccessControl, */ + SProcSimpleReq, /* SProcChangeCloseDownMode, */ + SProcResourceReq, /* SProcKillClient, */ + SProcRotateProperties, + SProcSimpleReq, /* 115 ForceScreenSaver */ + SProcSimpleReq, /* SetPointerMapping, */ + SProcSimpleReq, /* GetPointerMapping, */ + SProcSimpleReq, /* SetModifierMapping, */ + SProcSimpleReq, /* GetModifierMapping, */ + ProcBadRequest, /* 120 */ + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, /* 125 */ + ProcBadRequest, + SProcNoOperation, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest +}; EventSwapPtr EventSwapVector[MAXEVENTS] = { (EventSwapPtr) SErrorEvent, @@ -423,32 +588,32 @@ EventSwapPtr EventSwapVector[MAXEVENTS] = { SKeyButtonPtrEvent, SKeyButtonPtrEvent, SKeyButtonPtrEvent, - SKeyButtonPtrEvent, /* 5 */ + SKeyButtonPtrEvent, /* 5 */ SKeyButtonPtrEvent, SEnterLeaveEvent, SEnterLeaveEvent, SFocusEvent, - SFocusEvent, /* 10 */ + SFocusEvent, /* 10 */ SKeymapNotifyEvent, SExposeEvent, SGraphicsExposureEvent, SNoExposureEvent, - SVisibilityEvent, /* 15 */ + SVisibilityEvent, /* 15 */ SCreateNotifyEvent, SDestroyNotifyEvent, SUnmapNotifyEvent, SMapNotifyEvent, - SMapRequestEvent, /* 20 */ + SMapRequestEvent, /* 20 */ SReparentEvent, SConfigureNotifyEvent, SConfigureRequestEvent, SGravityEvent, - SResizeRequestEvent, /* 25 */ + SResizeRequestEvent, /* 25 */ SCirculateEvent, SCirculateEvent, SPropertyEvent, SSelectionClearEvent, - SSelectionRequestEvent, /* 30 */ + SSelectionRequestEvent, /* 30 */ SSelectionNotifyEvent, SColormapEvent, SClientMessageEvent, @@ -554,37 +719,37 @@ ReplySwapPtr ReplySwapVector[256] = { ReplyNotSwappd, (ReplySwapPtr) SGetWindowAttributesReply, ReplyNotSwappd, - ReplyNotSwappd, /* 5 */ + ReplyNotSwappd, /* 5 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 10 */ + ReplyNotSwappd, /* 10 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, (ReplySwapPtr) SGetGeometryReply, - (ReplySwapPtr) SQueryTreeReply, /* 15 */ + (ReplySwapPtr) SQueryTreeReply, /* 15 */ (ReplySwapPtr) SInternAtomReply, (ReplySwapPtr) SGetAtomNameReply, ReplyNotSwappd, ReplyNotSwappd, - (ReplySwapPtr) SGetPropertyReply, /* 20 */ + (ReplySwapPtr) SGetPropertyReply, /* 20 */ (ReplySwapPtr) SListPropertiesReply, ReplyNotSwappd, (ReplySwapPtr) SGetSelectionOwnerReply, ReplyNotSwappd, - ReplyNotSwappd, /* 25 */ - (ReplySwapPtr) SGenericReply, /* SGrabPointerReply, */ + ReplyNotSwappd, /* 25 */ + (ReplySwapPtr) SGenericReply, /* SGrabPointerReply, */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 30 */ - (ReplySwapPtr) SGenericReply, /* SGrabKeyboardReply, */ + ReplyNotSwappd, /* 30 */ + (ReplySwapPtr) SGenericReply, /* SGrabKeyboardReply, */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 35 */ + ReplyNotSwappd, /* 35 */ ReplyNotSwappd, ReplyNotSwappd, (ReplySwapPtr) SQueryPointerReply, @@ -594,7 +759,7 @@ ReplySwapPtr ReplySwapVector[256] = { ReplyNotSwappd, (ReplySwapPtr) SGetInputFocusReply, (ReplySwapPtr) SQueryKeymapReply, - ReplyNotSwappd, /* 45 */ + ReplyNotSwappd, /* 45 */ ReplyNotSwappd, (ReplySwapPtr) SQueryFontReply, (ReplySwapPtr) SQueryTextExtentsReply, @@ -604,32 +769,32 @@ ReplySwapPtr ReplySwapVector[256] = { (ReplySwapPtr) SGetFontPathReply, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 55 */ + ReplyNotSwappd, /* 55 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 60 */ + ReplyNotSwappd, /* 60 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 65 */ + ReplyNotSwappd, /* 65 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 70 */ + ReplyNotSwappd, /* 70 */ ReplyNotSwappd, ReplyNotSwappd, (ReplySwapPtr) SGetImageReply, ReplyNotSwappd, - ReplyNotSwappd, /* 75 */ + ReplyNotSwappd, /* 75 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 80 */ + ReplyNotSwappd, /* 80 */ ReplyNotSwappd, ReplyNotSwappd, (ReplySwapPtr) SListInstalledColormapsReply, @@ -639,44 +804,44 @@ ReplySwapPtr ReplySwapVector[256] = { (ReplySwapPtr) SAllocColorPlanesReply, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 90 */ + ReplyNotSwappd, /* 90 */ (ReplySwapPtr) SQueryColorsReply, (ReplySwapPtr) SLookupColorReply, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 95 */ + ReplyNotSwappd, /* 95 */ ReplyNotSwappd, (ReplySwapPtr) SQueryBestSizeReply, - (ReplySwapPtr) SGenericReply, /* SQueryExtensionReply, */ + (ReplySwapPtr) SGenericReply, /* SQueryExtensionReply, */ (ReplySwapPtr) SListExtensionsReply, - ReplyNotSwappd, /* 100 */ + ReplyNotSwappd, /* 100 */ (ReplySwapPtr) SGetKeyboardMappingReply, ReplyNotSwappd, (ReplySwapPtr) SGetKeyboardControlReply, ReplyNotSwappd, - ReplyNotSwappd, /* 105 */ + ReplyNotSwappd, /* 105 */ (ReplySwapPtr) SGetPointerControlReply, ReplyNotSwappd, (ReplySwapPtr) SGetScreenSaverReply, ReplyNotSwappd, - (ReplySwapPtr) SListHostsReply, /* 110 */ + (ReplySwapPtr) SListHostsReply, /* 110 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 115 */ - (ReplySwapPtr) SGenericReply, /* SetPointerMapping */ + ReplyNotSwappd, /* 115 */ + (ReplySwapPtr) SGenericReply, /* SetPointerMapping */ (ReplySwapPtr) SGetPointerMappingReply, - (ReplySwapPtr) SGenericReply, /* SetModifierMapping */ + (ReplySwapPtr) SGenericReply, /* SetModifierMapping */ (ReplySwapPtr) SGetModifierMappingReply, /* 119 */ - ReplyNotSwappd, /* 120 */ - ReplyNotSwappd, /* 121 */ - ReplyNotSwappd, /* 122 */ - ReplyNotSwappd, /* 123 */ - ReplyNotSwappd, /* 124 */ - ReplyNotSwappd, /* 125 */ - ReplyNotSwappd, /* 126 */ - ReplyNotSwappd, /* NoOperation */ + ReplyNotSwappd, /* 120 */ + ReplyNotSwappd, /* 121 */ + ReplyNotSwappd, /* 122 */ + ReplyNotSwappd, /* 123 */ + ReplyNotSwappd, /* 124 */ + ReplyNotSwappd, /* 125 */ + ReplyNotSwappd, /* 126 */ + ReplyNotSwappd, /* NoOperation */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, -- cgit v1.2.3 From 1f8a958a12c1c7c684051e5679420fe3a02ce307 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 23 Jul 2012 16:34:28 -0400 Subject: sync: Fix logic error from b55bf248581dc66321b24b29f199f6dc8d02db1b That commit adds two hunks, and I _think_ they're backwards. It adds code to modify bracket_greater on NegativeTransition triggers, and bracket_less on PositiveTransition triggers. That breaks symmetry with the surrounding code; the code as of this commit could probably be simplified further. I can't keep the sync trigger rules in my head for more than about five minutes at a time, so I'm sending this on for more eyes. RHEL 6.3's xserver is shipping with b55bf248 reverted: https://bugzilla.redhat.com/show_bug.cgi?id=748704#c33 And there appear to be some upstream reports of the same issue: https://bugzilla.gnome.org/show_bug.cgi?id=658955 So I'd like to get this sorted out. Signed-off-by: Adam Jackson Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard (cherry picked from commit 4a6f42dda00ba3b5616f8a86f0d4c9a652c7d9d4) --- Xext/sync.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Xext/sync.c b/Xext/sync.c index 532cb6473..c9162ee27 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -1033,15 +1033,15 @@ SyncComputeBracketValues(SyncCounter * pCounter) pnewltval = &psci->bracket_less; } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) && - XSyncValueLessThan(pTrigger->test_value, - psci->bracket_greater)) { + XSyncValueGreaterThan(pTrigger->test_value, + psci->bracket_less)) { /* * The value is exactly equal to our threshold. We want one - * more event in the positive direction to ensure we pick up - * when the value *exceeds* this threshold. + * more event in the negative direction to ensure we pick up + * when the value is less than this threshold. */ - psci->bracket_greater = pTrigger->test_value; - pnewgtval = &psci->bracket_greater; + psci->bracket_less = pTrigger->test_value; + pnewltval = &psci->bracket_less; } } else if (pTrigger->test_type == XSyncPositiveTransition && @@ -1053,15 +1053,15 @@ SyncComputeBracketValues(SyncCounter * pCounter) pnewgtval = &psci->bracket_greater; } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) && - XSyncValueGreaterThan(pTrigger->test_value, - psci->bracket_less)) { + XSyncValueLessThan(pTrigger->test_value, + psci->bracket_greater)) { /* * The value is exactly equal to our threshold. We want one - * more event in the negative direction to ensure we pick up - * when the value is less than this threshold. + * more event in the positive direction to ensure we pick up + * when the value *exceeds* this threshold. */ - psci->bracket_less = pTrigger->test_value; - pnewltval = &psci->bracket_less; + psci->bracket_greater = pTrigger->test_value; + pnewgtval = &psci->bracket_greater; } } } /* end for each trigger */ -- cgit v1.2.3 From f0823a057e4c80dbb18c16f066ad36e6459fcc85 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 31 Jul 2012 16:09:38 +1000 Subject: dix: make sure the mask is set for emulated scroll events (#52508) If a device has smooth scrolling axes, but submits scroll button events, we convert those to motion events and update the valuators. For legacy button events, the valuator mask is likely unset though, causing add_to_scroll_valuator() to return early, leaving us with an empty mask. That again skipped the rest of the code and no events were generated. Fix it by making sure that the scroll valuator in the mask is at least initialized to 0. Broke evdev wheel emulation, introduced by 54476b5e4461ff523e935961affabcf0de12c556. X.Org Bug 52508 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas (cherry picked from commit cb306a8f174bec9ded95191b91797f59250e6808) --- dix/getevents.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dix/getevents.c b/dix/getevents.c index b78d5cec0..fade40c0f 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -1601,6 +1601,8 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, if (adj != 0.0 && axis != -1) { adj *= pDev->valuator->axes[axis].scroll.increment; + if (!valuator_mask_isset(&mask, axis)) + valuator_mask_set(&mask, axis, 0); add_to_scroll_valuator(pDev, &mask, axis, adj); type = MotionNotify; buttons = 0; -- cgit v1.2.3 From 3e62f48edf47a59d923ac58b6d4262b02456a556 Mon Sep 17 00:00:00 2001 From: Simon Schubert <2@0x2c.org> Date: Sun, 12 Aug 2012 09:40:16 -0700 Subject: fb: reorder Bresenham error correction to avoid overshoot. When fbBresSolid draws a line, it can happen that after the last pixel, the Bresenham error term overflows, and fbBresSolid paints another pixel before adjusting the error term. However, if this happens on the last pixel (len=0), this extra pixel might overshoot the boundary, and, in rare cases, lead to a segfault. Fix this issue by adjusting for the Bresenham error term before drawing the main pixel, not after. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=24274 Signed-off-by: Simon Schubert <2@0x2c.or> Tested-by: Mitch Davis Signed-off-by: Matt Turner Signed-off-by: Keith Packard (cherry picked from commit 863d528a9f76d0e8f122aebf19f8564a4c67a938) --- fb/fbseg.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/fb/fbseg.c b/fb/fbseg.c index 0e4e0a9f7..1848387f6 100644 --- a/fb/fbseg.c +++ b/fb/fbseg.c @@ -65,6 +65,12 @@ fbBresSolid(DrawablePtr pDrawable, if (axis == X_AXIS) { bits = 0; while (len--) { + if (e >= 0) { + WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, bits)); + bits = 0; + dst += dstStride; + e += e3; + } bits |= mask; mask = fbBresShiftMask(mask, signdx, dstBpp); if (!mask) { @@ -74,21 +80,12 @@ fbBresSolid(DrawablePtr pDrawable, mask = mask0; } e += e1; - if (e >= 0) { - WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, bits)); - bits = 0; - dst += dstStride; - e += e3; - } } if (bits) WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, bits)); } else { while (len--) { - WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, mask)); - dst += dstStride; - e += e1; if (e >= 0) { e += e3; mask = fbBresShiftMask(mask, signdx, dstBpp); @@ -97,6 +94,9 @@ fbBresSolid(DrawablePtr pDrawable, mask = mask0; } } + WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, mask)); + dst += dstStride; + e += e1; } } -- cgit v1.2.3 From 73d62f1aaea4a862cc512048cb6ca59586f4cdb6 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 7 Aug 2012 17:49:46 -0700 Subject: Only free Render filter names on last screen close Hotplugging screens causes the render filter names to get freed while still in use; wait for the last core screen to be closed before freeing them. That only happens at server reset, when we want them to be freed. Signed-off-by: Keith Packard Reviewed-by: Dave Airlie (cherry picked from commit 19772670e3041fe1c7f5bbf32fa039a6d8245ccb) --- render/filter.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/render/filter.c b/render/filter.c index 8c401ee5d..019ea7f94 100644 --- a/render/filter.c +++ b/render/filter.c @@ -273,7 +273,10 @@ PictureResetFilters(ScreenPtr pScreen) free(ps->filters); free(ps->filterAliases); - PictureFreeFilterIds(); + + /* Free the filters when the last screen is closed */ + if (pScreen->myNum == 0) + PictureFreeFilterIds(); } int -- cgit v1.2.3 From 2141f21d51b0787c8d287bb50d01a6a81e61a634 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Thu, 16 Aug 2012 15:43:34 -0700 Subject: XQuartz: console_redirect: Set the correct location for reading into the buffer Prior to this change, it was possible that a large message would have some of its data prepended to subsequent messages due to our not incorrectly setting the location to write into the buffer. Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit a32e01802ff1c938c0afe0cc007a273b9ada8610) --- hw/xquartz/console_redirect.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/hw/xquartz/console_redirect.c b/hw/xquartz/console_redirect.c index 91d693b67..30e397a6b 100644 --- a/hw/xquartz/console_redirect.c +++ b/hw/xquartz/console_redirect.c @@ -110,27 +110,33 @@ _read_redirect(int fd, int flush) /* Increment our returned number read */ total_read += nbytes; - nbytes += (aslr->w - aslr->buf); - aslr->buf[nbytes] = '\0'; + /* Increment our write location */ + aslr->w += nbytes; + aslr->w[0] = '\0'; /* One line at a time */ - for (p = aslr->buf; *p && (p - aslr->buf) < nbytes; p = s + 1) { + for (p = aslr->buf; p < aslr->w; p = s + 1) { // Find null or \n for (s = p; *s && *s != '\n'; s++) ; if (*s == '\n') { *s = '\0'; + } + + if (s < aslr->w || aslr->buf == p) { + /* Either the first of multiple messages or one message which is larger than our buffer */ asl_log(aslr->asl, aslr->msg, aslr->level, "%s", p); } - else if (aslr->buf != p) { + else { + /* We reached the end of the buffer, move this chunk to the start. */ memmove(aslr->buf, p, BUF_SIZE - (p - aslr->buf)); aslr->w = aslr->buf + (s - p); break; } - else if (nbytes == BUF_SIZE - 1) { - asl_log(aslr->asl, aslr->msg, aslr->level, "%s", p); - aslr->w = aslr->buf; - break; - } + } + + if (p == aslr->w) { + /* Start writing at the beginning in the case where we flushed */ + aslr->w = aslr->buf; } } -- cgit v1.2.3 From 0754f74a538ca59e45a39fefa2d90b9d3bc822dd Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Thu, 16 Aug 2012 19:42:54 -0700 Subject: XQuartz: console_redirect: Properly zero-out the tail of the array on realloc() We forgot to multiply by sizeof(), so it wasn't fully zeroed out. Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 7c3d2e4828deb4e8ec38e8ef88d6f92b2d931033) --- hw/xquartz/console_redirect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xquartz/console_redirect.c b/hw/xquartz/console_redirect.c index 30e397a6b..8fdce4699 100644 --- a/hw/xquartz/console_redirect.c +++ b/hw/xquartz/console_redirect.c @@ -365,8 +365,8 @@ xq_asl_log_fd(aslclient asl, aslmsg msg, int level, int fd) BLOCK_DONE; } redirect_fds = new_array; - memset(redirect_fds + n_redirect_fds, 0, new_n - - n_redirect_fds); + memset(redirect_fds + n_redirect_fds, 0, (new_n - + n_redirect_fds) * sizeof(*redirect_fds)); n_redirect_fds = new_n; } -- cgit v1.2.3 From a6d7400507f220d6f98b853def7904586fb1eadd Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Sun, 19 Aug 2012 09:07:33 -0700 Subject: configure.ac: Version bump to 1.12.3.902 (1.12.4 RC2) Signed-off-by: Jeremy Huddleston Sequoia --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index aece8198a..28c9cf823 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,8 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.60) -AC_INIT([xorg-server], 1.12.3.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2012-08-03" +AC_INIT([xorg-server], 1.12.3.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2012-08-19" AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE -- cgit v1.2.3 From 8995fcf260895ad288146b78d4c42b6f3b838d4f Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Sun, 26 Aug 2012 22:09:49 -0700 Subject: XQuartz: Bump version to 2.7.3 Signed-off-by: Jeremy Huddleston Sequoia --- hw/xquartz/bundle/Info.plist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xquartz/bundle/Info.plist.cpp b/hw/xquartz/bundle/Info.plist.cpp index 4b6d9d182..460047cc2 100644 --- a/hw/xquartz/bundle/Info.plist.cpp +++ b/hw/xquartz/bundle/Info.plist.cpp @@ -19,9 +19,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.7.2 + 2.7.3 CFBundleVersion - 2.7.2 + 2.7.3 CFBundleSignature x11a CSResourcesFileMapped -- cgit v1.2.3 From dfc03ef3fda3572db590c2096272c990d434163e Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Sun, 26 Aug 2012 22:11:00 -0700 Subject: configure.ac: Version bump to 1.12.4 Signed-off-by: Jeremy Huddleston Sequoia --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 28c9cf823..7c7e69e78 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,8 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.60) -AC_INIT([xorg-server], 1.12.3.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2012-08-19" +AC_INIT([xorg-server], 1.12.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2012-08-27" AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE -- cgit v1.2.3