From 242f56f722243938e908d1957781ee53c2999783 Mon Sep 17 00:00:00 2001 From: Naoki Hamada Date: Thu, 25 Oct 2007 18:45:50 +0300 Subject: [PATCH 01/74] Input: Fix key down test (bug #12858) Fix the botched previous key_is_down test, which would give false positives. Also move key_autorepeats to a separate inline function. --- dix/getevents.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/dix/getevents.c b/dix/getevents.c index a6e246ac7..ffcdf174e 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -95,7 +95,14 @@ set_key_up(DeviceIntPtr pDev, int key_code) static Bool key_is_down(DeviceIntPtr pDev, int key_code) { - return pDev->key->postdown[key_code >> 3] >> (key_code & 7); + return !!(pDev->key->postdown[key_code >> 3] & (1 << (key_code & 7))); +} + +static Bool +key_autorepeats(DeviceIntPtr pDev, int key_code) +{ + return !!(pDev->kbdfeed->ctrl.autoRepeats[key_code >> 3] & + (1 << (key_code & 7))); } /** @@ -444,10 +451,11 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type, * FIXME: In theory, if you're repeating with two keyboards in non-XKB, * you could get unbalanced events here. */ if (type == KeyPress && key_is_down(pDev, key_code)) { + /* If autorepeating is disabled either globally or just for that key, + * or we have a modifier, don't generate a repeat event. */ if (!pDev->kbdfeed->ctrl.autoRepeat || - pDev->key->modifierMap[key_code] || - !(pDev->kbdfeed->ctrl.autoRepeats[key_code >> 3] - & (1 << (key_code & 7)))) + !key_autorepeats(pDev, key_code) || + pDev->key->modifierMap[key_code]) return 0; #ifdef XKB From 30bcaa966d6b00f1630609a78db18dee683cc43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Thu, 25 Oct 2007 18:48:06 -0400 Subject: [PATCH 02/74] Make glx destroy path handle cases where the X window goes away first. --- GL/glx/glxdri.c | 19 ++++++++++++++----- GL/glx/glxext.c | 2 ++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c index 3688d50a8..5c45cd190 100644 --- a/GL/glx/glxdri.c +++ b/GL/glx/glxdri.c @@ -185,10 +185,14 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable) (*private->driDrawable.destroyDrawable)(&private->driDrawable); - __glXenterServer(GL_FALSE); - DRIDestroyDrawable(drawable->pDraw->pScreen, - serverClient, drawable->pDraw); - __glXleaveServer(GL_FALSE); + /* If the X window was destroyed, the dri DestroyWindow hook will + * aready have taken care of this, so only call if pDraw isn't NULL. */ + if (drawable->pDraw != NULL) { + __glXenterServer(GL_FALSE); + DRIDestroyDrawable(drawable->pDraw->pScreen, + serverClient, drawable->pDraw); + __glXleaveServer(GL_FALSE); + } xfree(private); } @@ -668,11 +672,16 @@ getDrawableInfo(__DRIdrawable *driDrawable, { __GLXDRIdrawable *drawable = containerOf(driDrawable, __GLXDRIdrawable, driDrawable); - ScreenPtr pScreen = drawable->base.pDraw->pScreen; + ScreenPtr pScreen; drm_clip_rect_t *pClipRects, *pBackClipRects; GLboolean retval; size_t size; + /* If the X window has been destroyed, give up here. */ + if (drawable->base.pDraw == NULL) + return GL_FALSE; + + pScreen = drawable->base.pDraw->pScreen; __glXenterServer(GL_FALSE); retval = DRIGetDrawableInfo(pScreen, drawable->base.pDraw, index, stamp, x, y, width, height, diff --git a/GL/glx/glxext.c b/GL/glx/glxext.c index 546d87f01..772538940 100644 --- a/GL/glx/glxext.c +++ b/GL/glx/glxext.c @@ -122,6 +122,8 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid) cx->pendingState |= __GLX_PENDING_DESTROY; } + glxPriv->pDraw = NULL; + glxPriv->drawId = 0; __glXUnrefDrawable(glxPriv); return True; From f62277d421023b3150d3a1accb00a8206ab2bde3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Thu, 25 Oct 2007 18:48:39 -0400 Subject: [PATCH 03/74] Clean up unused pVisual part of __GLXcontext. --- GL/glx/glxcmds.c | 4 +--- GL/glx/glxcontext.h | 5 ----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c index 992ddbce5..4a77b3ee6 100644 --- a/GL/glx/glxcmds.c +++ b/GL/glx/glxcmds.c @@ -190,7 +190,6 @@ DoCreateContext(__GLXclientState *cl, GLXContextID gcId, __GLXscreen *pGlxScreen, GLboolean isDirect) { ClientPtr client = cl->client; - VisualPtr pVisual; __GLXcontext *glxc, *shareglxc; LEGAL_NEW_RESOURCE(gcId, client); @@ -250,7 +249,6 @@ DoCreateContext(__GLXclientState *cl, GLXContextID gcId, */ glxc->pScreen = pGlxScreen->pScreen; glxc->pGlxScreen = pGlxScreen; - glxc->pVisual = pVisual; glxc->modes = config; /* @@ -1470,7 +1468,7 @@ DoQueryContext(__GLXclientState *cl, GLXContextID gcId) *pSendBuf++ = GLX_SHARE_CONTEXT_EXT; *pSendBuf++ = (int)(ctx->share_id); *pSendBuf++ = GLX_VISUAL_ID_EXT; - *pSendBuf++ = (int)(ctx->pVisual->vid); + *pSendBuf++ = (int)(ctx->modes->visualID); *pSendBuf++ = GLX_SCREEN_EXT; *pSendBuf++ = (int)(ctx->pScreen->myNum); diff --git a/GL/glx/glxcontext.h b/GL/glx/glxcontext.h index 712264729..cf944a174 100644 --- a/GL/glx/glxcontext.h +++ b/GL/glx/glxcontext.h @@ -88,11 +88,6 @@ struct __GLXcontext { ScreenPtr pScreen; __GLXscreen *pGlxScreen; - /* - ** This context is created with respect to this visual. - */ - VisualRec *pVisual; - /* ** The XID of this context. */ From 6d59bb5709a99ab60b482bbf3393ebffda7f9407 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Fri, 26 Oct 2007 09:12:15 +0300 Subject: [PATCH 04/74] XFree86 Misc/VidMode: Remove ridiculous debug ErrorFs When we're building with --enable-debug, don't emit an ErrorF every time a function gets called. --- hw/xfree86/common/xf86MiscExt.c | 20 -------------- hw/xfree86/common/xf86VidMode.c | 46 --------------------------------- 2 files changed, 66 deletions(-) diff --git a/hw/xfree86/common/xf86MiscExt.c b/hw/xfree86/common/xf86MiscExt.c index 655304e8b..c1b9c60fc 100644 --- a/hw/xfree86/common/xf86MiscExt.c +++ b/hw/xfree86/common/xf86MiscExt.c @@ -152,8 +152,6 @@ MiscExtGetMouseSettings(pointer *mouse, char **devname) { mseParamsPtr mseptr; - DEBUG_P("MiscExtGetMouseSettings"); - mseptr = MiscExtCreateStruct(MISC_POINTER); if (!mseptr) return FALSE; @@ -184,8 +182,6 @@ MiscExtGetMouseValue(pointer mouse, MiscExtMseValType valtype) { mseParamsPtr mse = mouse; - DEBUG_P("MiscExtGetMouseValue"); - switch (valtype) { case MISC_MSE_PROTO: return mse->type; case MISC_MSE_BAUDRATE: return mse->baudrate; @@ -205,8 +201,6 @@ MiscExtSetMouseValue(pointer mouse, MiscExtMseValType valtype, int value) { mseParamsPtr mse = mouse; - DEBUG_P("MiscExtSetMouseValue"); - switch (valtype) { case MISC_MSE_PROTO: mse->type = value; @@ -251,8 +245,6 @@ MiscExtSetMouseDevice(pointer mouse, char* device) _X_EXPORT Bool MiscExtGetKbdSettings(pointer *kbd) { - DEBUG_P("MiscExtGetKbdSettings"); - return FALSE; } @@ -290,8 +282,6 @@ MiscExtClientStateCallback(CallbackListPtr *callbacks, _X_EXPORT int MiscExtSetGrabKeysState(ClientPtr client, int state) { - DEBUG_P("MiscExtSetGrabKeysState"); - if (xf86Info.grabInfo.override == NULL || xf86Info.grabInfo.override == client) { if (state == 0 && xf86Info.grabInfo.disabled == 0) { @@ -318,8 +308,6 @@ MiscExtSetGrabKeysState(ClientPtr client, int state) _X_EXPORT pointer MiscExtCreateStruct(MiscExtStructType mse_or_kbd) { - DEBUG_P("MiscExtCreateStruct"); - switch (mse_or_kbd) { case MISC_POINTER: { @@ -348,8 +336,6 @@ MiscExtCreateStruct(MiscExtStructType mse_or_kbd) _X_EXPORT void MiscExtDestroyStruct(pointer structure, MiscExtStructType mse_or_kbd) { - DEBUG_P("MiscExtDestroyStruct"); - switch (mse_or_kbd) { case MISC_POINTER: case MISC_KEYBOARD: @@ -410,8 +396,6 @@ MiscExtAuthorizeDevice(InputInfoPtr pInfo, char *device) _X_EXPORT MiscExtReturn MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd) { - DEBUG_P("MiscExtApply"); - if (mse_or_kbd == MISC_POINTER) { Bool protoChanged = FALSE; int oldflags; @@ -551,8 +535,6 @@ _X_EXPORT Bool MiscExtGetFilePaths(const char **configfile, const char **modulepath, const char **logfile) { - DEBUG_P("MiscExtGetFilePaths"); - *configfile = xf86ConfigFile; *modulepath = xf86ModulePath; *logfile = xf86LogFile; @@ -566,8 +548,6 @@ MiscExtPassMessage(int scrnIndex, const char *msgtype, const char *msgval, { ScrnInfoPtr pScr = xf86Screens[scrnIndex]; - DEBUG_P("MiscExtPassMessage"); - if (*pScr->HandleMessage == NULL) return BadImplementation; return (*pScr->HandleMessage)(scrnIndex, msgtype, msgval, retstr); diff --git a/hw/xfree86/common/xf86VidMode.c b/hw/xfree86/common/xf86VidMode.c index fb9151346..16a4d824c 100644 --- a/hw/xfree86/common/xf86VidMode.c +++ b/hw/xfree86/common/xf86VidMode.c @@ -68,8 +68,6 @@ VidModeExtensionInit(ScreenPtr pScreen) #ifdef XF86VIDMODE VidModePtr pVidMode; - DEBUG_P("VidModeExtensionInit"); - if (!xf86GetVidModeEnabled()) { DEBUG_P("!xf86GetVidModeEnabled()"); return FALSE; @@ -109,8 +107,6 @@ VidModeClose(int i, ScreenPtr pScreen) { VidModePtr pVidMode = VMPTR(pScreen); - DEBUG_P("VidModeClose"); - /* This shouldn't happen */ if (!pVidMode) return FALSE; @@ -132,8 +128,6 @@ VidModeAvailable(int scrnIndex) ScrnInfoPtr pScrn; VidModePtr pVidMode; - DEBUG_P("VidModeAvailable"); - if (VidModeIndex < 0) { DEBUG_P("VidModeIndex < 0"); return FALSE; @@ -159,8 +153,6 @@ VidModeGetCurrentModeline(int scrnIndex, pointer *mode, int *dotClock) { ScrnInfoPtr pScrn; - DEBUG_P("VidModeGetCurrentModeline"); - if (!VidModeAvailable(scrnIndex)) return FALSE; @@ -176,8 +168,6 @@ VidModeGetDotClock(int scrnIndex, int Clock) { ScrnInfoPtr pScrn; - DEBUG_P("VidModeGetDotClock"); - if (!VidModeAvailable(scrnIndex)) return 0; @@ -193,8 +183,6 @@ VidModeGetNumOfClocks(int scrnIndex, Bool *progClock) { ScrnInfoPtr pScrn; - DEBUG_P("VidModeGetNumOfClocks"); - if (!VidModeAvailable(scrnIndex)) return 0; @@ -214,8 +202,6 @@ VidModeGetClocks(int scrnIndex, int *Clocks) ScrnInfoPtr pScrn; int i; - DEBUG_P("VidModeGetClocks"); - if (!VidModeAvailable(scrnIndex)) return FALSE; @@ -237,8 +223,6 @@ VidModeGetFirstModeline(int scrnIndex, pointer *mode, int *dotClock) ScrnInfoPtr pScrn; VidModePtr pVidMode; - DEBUG_P("VidModeGetFirstModeline"); - if (!VidModeAvailable(scrnIndex)) return FALSE; @@ -263,8 +247,6 @@ VidModeGetNextModeline(int scrnIndex, pointer *mode, int *dotClock) VidModePtr pVidMode; DisplayModePtr p; - DEBUG_P("VidModeGetNextModeline"); - if (!VidModeAvailable(scrnIndex)) return FALSE; @@ -288,8 +270,6 @@ VidModeDeleteModeline(int scrnIndex, pointer mode) { ScrnInfoPtr pScrn; - DEBUG_P("VidModeDeleteModeline"); - if ((mode == NULL) || (!VidModeAvailable(scrnIndex))) return FALSE; @@ -303,8 +283,6 @@ VidModeZoomViewport(int scrnIndex, int zoom) { ScrnInfoPtr pScrn; - DEBUG_P("VidModeZoomViewPort"); - if (!VidModeAvailable(scrnIndex)) return FALSE; @@ -318,8 +296,6 @@ VidModeSetViewPort(int scrnIndex, int x, int y) { ScrnInfoPtr pScrn; - DEBUG_P("VidModeSetViewPort"); - if (!VidModeAvailable(scrnIndex)) return FALSE; @@ -341,8 +317,6 @@ VidModeGetViewPort(int scrnIndex, int *x, int *y) { ScrnInfoPtr pScrn; - DEBUG_P("VidModeGetViewPort"); - if (!VidModeAvailable(scrnIndex)) return FALSE; @@ -359,8 +333,6 @@ VidModeSwitchMode(int scrnIndex, pointer mode) DisplayModePtr pTmpMode; Bool retval; - DEBUG_P("VidModeSwitchMode"); - if (!VidModeAvailable(scrnIndex)) return FALSE; @@ -381,8 +353,6 @@ VidModeLockZoom(int scrnIndex, Bool lock) { ScrnInfoPtr pScrn; - DEBUG_P("VidModeLockZoom"); - if (!VidModeAvailable(scrnIndex)) return FALSE; @@ -400,8 +370,6 @@ VidModeGetMonitor(int scrnIndex, pointer *monitor) { ScrnInfoPtr pScrn; - DEBUG_P("VidModeGetMonitor"); - if (!VidModeAvailable(scrnIndex)) return FALSE; @@ -416,8 +384,6 @@ VidModeCheckModeForMonitor(int scrnIndex, pointer mode) { ScrnInfoPtr pScrn; - DEBUG_P("VidModeCheckModeForMonitor"); - if ((mode == NULL) || (!VidModeAvailable(scrnIndex))) return MODE_ERROR; @@ -431,8 +397,6 @@ VidModeCheckModeForDriver(int scrnIndex, pointer mode) { ScrnInfoPtr pScrn; - DEBUG_P("VidModeCheckModeForDriver"); - if ((mode == NULL) || (!VidModeAvailable(scrnIndex))) return MODE_ERROR; @@ -447,8 +411,6 @@ VidModeSetCrtcForMode(int scrnIndex, pointer mode) ScrnInfoPtr pScrn; DisplayModePtr ScreenModes; - DEBUG_P("VidModeSetCrtcForMode"); - if ((mode == NULL) || (!VidModeAvailable(scrnIndex))) return; @@ -467,8 +429,6 @@ VidModeAddModeline(int scrnIndex, pointer mode) { ScrnInfoPtr pScrn; - DEBUG_P("VidModeAddModeline"); - if ((mode == NULL) || (!VidModeAvailable(scrnIndex))) return FALSE; @@ -491,8 +451,6 @@ VidModeGetNumOfModes(int scrnIndex) pointer mode = NULL; int dotClock= 0, nummodes = 0; - DEBUG_P("VidModeGetNumOfModes"); - if (!VidModeGetFirstModeline(scrnIndex, &mode, &dotClock)) return nummodes; @@ -509,8 +467,6 @@ VidModeSetGamma(int scrnIndex, float red, float green, float blue) ScrnInfoPtr pScrn; Gamma gamma; - DEBUG_P("VidModeSetGamma"); - if (!VidModeAvailable(scrnIndex)) return FALSE; @@ -529,8 +485,6 @@ VidModeGetGamma(int scrnIndex, float *red, float *green, float *blue) { ScrnInfoPtr pScrn; - DEBUG_P("VidModeGetGamma"); - if (!VidModeAvailable(scrnIndex)) return FALSE; From 27b13eeb56a5cbac00b381309604505002e77228 Mon Sep 17 00:00:00 2001 From: Matthias Hopf Date: Fri, 26 Oct 2007 13:15:07 +0200 Subject: [PATCH 05/74] Nuke superfluous ",", added missing include for xf86i2c.h. --- hw/xfree86/modes/xf86Crtc.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index 4c843cd83..f312b30cb 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -29,6 +29,7 @@ #endif #include "xf86Modes.h" #include "xf86Cursor.h" +#include "xf86i2c.h" #include "damage.h" #include "picturestr.h" @@ -60,13 +61,13 @@ typedef enum _xf86ConnectorType { XF86ConnectorSvideo, XF86ConnectorComponent, XF86ConnectorLFP, - XF86ConnectorProprietary, + XF86ConnectorProprietary } xf86ConnectorType; typedef enum _xf86OutputStatus { XF86OutputStatusConnected, XF86OutputStatusDisconnected, - XF86OutputStatusUnknown, + XF86OutputStatusUnknown } xf86OutputStatus; typedef struct _xf86CrtcFuncs { From 80d8a3e1767609a92b0b85a7e92cea5f0748038a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 26 Oct 2007 10:19:57 -0400 Subject: [PATCH 06/74] Quiet glx visual debug info. --- GL/glx/glxscreens.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c index 2c8f810e6..bf6ad42bf 100644 --- a/GL/glx/glxscreens.c +++ b/GL/glx/glxscreens.c @@ -514,8 +514,6 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen) for (m = pGlxScreen->fbconfigs; m != NULL; m = m->next) { m->fbconfigID = FakeClientID(0); m->visualID = findVisualForConfig(pScreen, m); - ErrorF("mapping fbconfig id 0x%02lx to visual id 0x%02lx\n", - m->fbconfigID, m->visualID); i++; } pGlxScreen->numFBConfigs = i; From 0e749ceab421d72b48e18292c5ca0e337baf5ce8 Mon Sep 17 00:00:00 2001 From: Bernardo Innocenti Date: Sat, 20 Oct 2007 20:31:57 -0400 Subject: [PATCH 07/74] Include stddef.h for size_t. This is required by a buggy version of the openssl/sha.h header which is distributed with Fedora 7. --- render/glyph.c | 1 + 1 file changed, 1 insertion(+) diff --git a/render/glyph.c b/render/glyph.c index 5cd799226..78b49b9c6 100644 --- a/render/glyph.c +++ b/render/glyph.c @@ -26,6 +26,7 @@ #include #endif +#include /* buggy openssl/sha.h wants size_t */ #include #include "misc.h" From 497aba894904b08b15bb19916e2a163f96212a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 26 Oct 2007 11:25:57 -0400 Subject: [PATCH 08/74] Weed out some unused fluff from __GLXcontext. --- GL/glx/glxcmds.c | 5 ++--- GL/glx/glxcontext.h | 11 ----------- GL/glx/glxdri.c | 3 +-- GL/glx/glxext.c | 16 ---------------- GL/glx/glxglcore.c | 2 +- GL/glx/glxscreens.c | 11 ----------- 6 files changed, 4 insertions(+), 44 deletions(-) diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c index 4a77b3ee6..7d352ce36 100644 --- a/GL/glx/glxcmds.c +++ b/GL/glx/glxcmds.c @@ -247,7 +247,6 @@ DoCreateContext(__GLXclientState *cl, GLXContextID gcId, ** Initially, setup the part of the context that could be used by ** a GL core that needs windowing information (e.g., Mesa). */ - glxc->pScreen = pGlxScreen->pScreen; glxc->pGlxScreen = pGlxScreen; glxc->modes = config; @@ -497,7 +496,7 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client, * a GLX drawable for it. Check that the drawable screen matches * the context screen and that the context fbconfig is compatible * with the window visual. */ - if (pDraw->pScreen != glxc->pScreen || + if (pDraw->pScreen != glxc->pGlxScreen->pScreen || !validGlxFBConfigForWindow(client, glxc->modes, pDraw, error)) return NULL; @@ -1470,7 +1469,7 @@ DoQueryContext(__GLXclientState *cl, GLXContextID gcId) *pSendBuf++ = GLX_VISUAL_ID_EXT; *pSendBuf++ = (int)(ctx->modes->visualID); *pSendBuf++ = GLX_SCREEN_EXT; - *pSendBuf++ = (int)(ctx->pScreen->myNum); + *pSendBuf++ = (int)(ctx->pGlxScreen->pScreen->myNum); if (client->swapped) { __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf); diff --git a/GL/glx/glxcontext.h b/GL/glx/glxcontext.h index cf944a174..4c36801c1 100644 --- a/GL/glx/glxcontext.h +++ b/GL/glx/glxcontext.h @@ -85,7 +85,6 @@ struct __GLXcontext { ** Pointer to screen info data for this context. This is set ** when the context is created. */ - ScreenPtr pScreen; __GLXscreen *pGlxScreen; /* @@ -98,11 +97,6 @@ struct __GLXcontext { */ XID share_id; - /* - ** Visual id. - */ - VisualID vid; - /* ** screen number. */ @@ -123,11 +117,6 @@ struct __GLXcontext { */ GLboolean isDirect; - /* - ** Window pending state - */ - GLuint pendingState; - /* ** This flag keeps track of whether there are unflushed GL commands. */ diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c index 5c45cd190..c0da07b68 100644 --- a/GL/glx/glxdri.c +++ b/GL/glx/glxdri.c @@ -253,7 +253,7 @@ __glXDRIcontextDestroy(__GLXcontext *baseContext) context->driContext.destroyContext(&context->driContext); __glXenterServer(GL_FALSE); - retval = DRIDestroyContext(baseContext->pScreen, context->hwContextID); + retval = DRIDestroyContext(baseContext->pGlxScreen->pScreen, context->hwContextID); __glXleaveServer(GL_FALSE); __glXContextDestroy(&context->base); @@ -587,7 +587,6 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen, context->base.loseCurrent = __glXDRIcontextLoseCurrent; context->base.copy = __glXDRIcontextCopy; context->base.forceCurrent = __glXDRIcontextForceCurrent; - context->base.pScreen = screen->base.pScreen; context->base.textureFromPixmap = &__glXDRItextureFromPixmap; /* Find the requested X visual */ diff --git a/GL/glx/glxext.c b/GL/glx/glxext.c index 772538940..f9b872c41 100644 --- a/GL/glx/glxext.c +++ b/GL/glx/glxext.c @@ -106,22 +106,6 @@ static int ContextGone(__GLXcontext* cx, XID id) */ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid) { - __GLXcontext *cx, *cx1; - - /* - ** When a drawable is destroyed, notify all context bound to - ** it, that there are no longer bound to anything. - */ - for (cx = glxPriv->drawGlxc; cx; cx = cx1) { - cx1 = cx->nextDrawPriv; - cx->pendingState |= __GLX_PENDING_DESTROY; - } - - for (cx = glxPriv->readGlxc; cx; cx = cx1) { - cx1 = cx->nextReadPriv; - cx->pendingState |= __GLX_PENDING_DESTROY; - } - glxPriv->pDraw = NULL; glxPriv->drawId = 0; __glXUnrefDrawable(glxPriv); diff --git a/GL/glx/glxglcore.c b/GL/glx/glxglcore.c index 6aa4e7f5c..4cc00a360 100644 --- a/GL/glx/glxglcore.c +++ b/GL/glx/glxglcore.c @@ -363,7 +363,7 @@ createMesaVisuals(__GLXMESAscreen *pMesaScreen) { __GLcontextModes *config; ScreenPtr pScreen; - VisualPtr visual; + VisualPtr visual = NULL; int i, j; i = 0; diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c index bf6ad42bf..31514002b 100644 --- a/GL/glx/glxscreens.c +++ b/GL/glx/glxscreens.c @@ -189,7 +189,6 @@ static char GLXServerExtensions[] = static Bool glxPositionWindow(WindowPtr pWin, int x, int y) { ScreenPtr pScreen; - __GLXcontext *glxc; __GLXdrawable *glxPriv; Bool ret; __GLXscreen *pGlxScreen; @@ -226,16 +225,6 @@ static Bool glxPositionWindow(WindowPtr pWin, int x, int y) ret = False; } - /* mark contexts as needing resize */ - - for (glxc = glxPriv->drawGlxc; glxc; glxc = glxc->nextDrawPriv) { - glxc->pendingState |= __GLX_PENDING_RESIZE; - } - - for (glxc = glxPriv->readGlxc; glxc; glxc = glxc->nextReadPriv) { - glxc->pendingState |= __GLX_PENDING_RESIZE; - } - return ret; } From 2251572062b2c25643671b8d5070de1c3f7ae976 Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Fri, 26 Oct 2007 15:13:50 -0700 Subject: [PATCH 09/74] Restore the CompositeGlyphs -> ps->Glyphs -> miGlyphs callchain to allow acceleration architectures to wrap above miGlyphs. --- render/glyph.c | 47 +++++++++++++++++++++++------------------------ render/mipict.c | 2 +- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/render/glyph.c b/render/glyph.c index 78b49b9c6..f3e3917b1 100644 --- a/render/glyph.c +++ b/render/glyph.c @@ -902,20 +902,22 @@ GlyphExtents (int nlist, #define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) -/* Stub ABI compatibility for mi*Glyph, should go away */ _X_EXPORT void -miGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr list, - GlyphPtr *glyphs) +CompositeGlyphs (CARD8 op, + PicturePtr pSrc, + PicturePtr pDst, + PictFormatPtr maskFormat, + INT16 xSrc, + INT16 ySrc, + int nlist, + GlyphListPtr lists, + GlyphPtr *glyphs) { - CompositeGlyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, - glyphs); + PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); + + ValidatePicture (pSrc); + ValidatePicture (pDst); + (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, lists, glyphs); } Bool @@ -932,15 +934,15 @@ miUnrealizeGlyph (ScreenPtr pScreen, } _X_EXPORT void -CompositeGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr list, - GlyphPtr *glyphs) +miGlyphs (CARD8 op, + PicturePtr pSrc, + PicturePtr pDst, + PictFormatPtr maskFormat, + INT16 xSrc, + INT16 ySrc, + int nlist, + GlyphListPtr list, + GlyphPtr *glyphs) { PicturePtr pPicture; PixmapPtr pMaskPixmap = 0; @@ -955,9 +957,6 @@ CompositeGlyphs (CARD8 op, BoxRec extents = {0, 0, 0, 0}; CARD32 component_alpha; - ValidatePicture (pSrc); - ValidatePicture (pDst); - if (maskFormat) { GCPtr pGC; diff --git a/render/mipict.c b/render/mipict.c index 5aad676f5..87dccbbda 100644 --- a/render/mipict.c +++ b/render/mipict.c @@ -636,7 +636,7 @@ miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) /* MI rendering routines */ ps->Composite = 0; /* requires DDX support */ - ps->Glyphs = NULL; + ps->Glyphs = miGlyphs; ps->CompositeRects = miCompositeRects; ps->Trapezoids = miTrapezoids; ps->Triangles = miTriangles; From df57ae1639ba4f1719883c5bf868394e4748a022 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Sun, 28 Oct 2007 15:46:26 +0200 Subject: [PATCH 10/74] configure.ac/XFree86: Only build XF86Misc and XF86VidMode when appropriate Don't build XF86Misc or XF86Vidmode in hw/xfree86/dixmod when it's been explicitly disabled in configure, or we don't have the proto modules installed. --- configure.ac | 4 +++- hw/xfree86/dixmods/extmod/Makefile.am | 14 ++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index c8b2b7838..57132b090 100644 --- a/configure.ac +++ b/configure.ac @@ -1560,7 +1560,9 @@ AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes]) AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes]) AM_CONDITIONAL([SOLARIS_USL_CONSOLE], [test "x$solaris_usl_console" = xyes]) AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes]) -AM_CONDITIONAL(DGA, [test "x$DGA" = xyes]) +AM_CONDITIONAL([DGA], [test "x$DGA" = xyes]) +AM_CONDITIONAL([XF86MISC], [test "x$XF86MISC" = xyes]) +AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes]) dnl legacy fb support test "x$MFB" = xauto && MFB="$XORG" diff --git a/hw/xfree86/dixmods/extmod/Makefile.am b/hw/xfree86/dixmods/extmod/Makefile.am index 9f6c4081b..f90e144ea 100644 --- a/hw/xfree86/dixmods/extmod/Makefile.am +++ b/hw/xfree86/dixmods/extmod/Makefile.am @@ -11,6 +11,14 @@ if XV XV_SRCS = xvmod.c xvmodproc.h endif +if XF86MISC +XF86MISC_SRCS = xf86misc.c xf86miscproc.h +endif + +if XF86VIDMODE +XF86VMODE_SRCS = xf86vmode.c vidmodeproc.h +endif + AM_CFLAGS = @DIX_CFLAGS@ @XORG_CFLAGS@ INCLUDES = @XORG_INCS@ \ -I$(top_srcdir)/afb \ @@ -24,9 +32,7 @@ libextmod_la_LDFLAGS = -avoid-version libextmod_la_SOURCES = modinit.c \ modinit.h \ $(DGA_SRCS) \ - xf86misc.c \ - xf86miscproc.h \ - xf86vmode.c \ - vidmodeproc.h \ + $(XF86MISC_SRCS) \ + $(XF86VMODE_SRCS) \ $(XV_SRCS) libextmod_la_LIBADD = $(top_builddir)/Xext/libXextmodule.la From e29e69960d67aa4b7a4d1551af509dbac193f438 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Sat, 27 Oct 2007 21:34:22 +0300 Subject: [PATCH 11/74] Xi: Include XI protocol header in exevents.h Make sure we have all the types we need to use this header. --- include/exevents.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/exevents.h b/include/exevents.h index cf7d71aca..0892f4d0a 100644 --- a/include/exevents.h +++ b/include/exevents.h @@ -30,6 +30,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef EXEVENTS_H #define EXEVENTS_H +#include + extern void RegisterOtherDevice ( DeviceIntPtr /* device */); From a3d48de5f2b7eacf3193c60f0fb461912201210b Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Sat, 27 Oct 2007 21:35:31 +0300 Subject: [PATCH 12/74] XKB: Add more bits to xkbsrv.h Add the device private index, given we use that in a macro here, and also the prototype for xkbUnwrapProc, since that's also useful. --- include/xkbsrv.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/xkbsrv.h b/include/xkbsrv.h index 5edee539b..e43e8fde4 100644 --- a/include/xkbsrv.h +++ b/include/xkbsrv.h @@ -246,8 +246,11 @@ typedef struct device->public.realInputProc = oldprocs->realInputProc; \ device->unwrapProc = oldprocs->unwrapProc; +extern int xkbDevicePrivateIndex; #define XKBDEVICEINFO(dev) ((xkbDeviceInfoPtr) (dev)->devPrivates[xkbDevicePrivateIndex].ptr) +extern void xkbUnwrapProc(DeviceIntPtr, DeviceHandleProc, pointer); + /***====================================================================***/ From 493b83bd097372ae0023da9919da83af39e3fc1c Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Sat, 27 Oct 2007 21:33:52 +0300 Subject: [PATCH 13/74] XFree86: Remove ridiculous SIGIO debugging YOU PRESSED A KEY AND AGAIN YOU RELEASED A KEY AND AGAIN YOU PRESSED A KEY AND AGAIN ... not so much. --- hw/xfree86/os-support/shared/sigio.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c index f6c15c28f..c97f50302 100644 --- a/hw/xfree86/os-support/shared/sigio.c +++ b/hw/xfree86/os-support/shared/sigio.c @@ -243,9 +243,6 @@ xf86BlockSIGIO (void) sigaddset (&set, SIGIO); sigprocmask (SIG_BLOCK, &set, &old); ret = sigismember (&old, SIGIO); -#ifdef DEBUG - ErrorF("%i = xf86BlockSIGIO()\n",ret); -#endif return ret; } @@ -253,9 +250,6 @@ _X_EXPORT void xf86UnblockSIGIO (int wasset) { sigset_t set; -#ifdef DEBUG - ErrorF("xf86UnblockSIGIO(%i)\n",wasset); -#endif if (!wasset) { From 8b9481a113b56078191e2298bf590905978f6289 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 4 Sep 2007 17:44:51 +0930 Subject: [PATCH 14/74] xkb: Store the action filters per device in the XkbSrvInfoRec. Using a global array for action filters is bad. If two keyboard hit a modifier at the same time, releaseing the first one will deactivate the filter and thus the second keyboard can never release the modifier again. (cherry picked from commit bfe6b4d2d9952a80f8dbc63eec974ef894e5c226) --- include/xkbsrv.h | 21 ++++++++++++ xkb/xkbActions.c | 85 ++++++++++++++++++++---------------------------- 2 files changed, 57 insertions(+), 49 deletions(-) diff --git a/include/xkbsrv.h b/include/xkbsrv.h index e43e8fde4..bb2316de6 100644 --- a/include/xkbsrv.h +++ b/include/xkbsrv.h @@ -126,6 +126,24 @@ typedef struct _XkbEventCause { #define _BEEP_LED_CHANGE 14 #define _BEEP_BOUNCE_REJECT 15 +struct _XkbSrvInfo; /* definition see below */ + +typedef struct _XkbFilter { + CARD16 keycode; + CARD8 what; + CARD8 active; + CARD8 filterOthers; + CARD32 priv; + XkbAction upAction; + int (*filter)( + struct _XkbSrvInfo* /* xkbi */, + struct _XkbFilter * /* filter */, + unsigned /* keycode */, + XkbAction * /* action */ + ); + struct _XkbFilter *next; +} XkbFilterRec,*XkbFilterPtr; + typedef struct _XkbSrvInfo { XkbStateRec prev_state; XkbStateRec state; @@ -169,6 +187,9 @@ typedef struct _XkbSrvInfo { OsTimerPtr bounceKeysTimer; OsTimerPtr repeatKeyTimer; OsTimerPtr krgTimer; + + int szFilters; + XkbFilterPtr filters; } XkbSrvInfoRec, *XkbSrvInfoPtr; #define XkbSLI_IsDefault (1L<<0) diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c index 2e0c89fc2..ef67d64e8 100644 --- a/xkb/xkbActions.c +++ b/xkb/xkbActions.c @@ -72,7 +72,7 @@ XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc) if (!AllocateDevicePrivate(device, xkbDevicePrivateIndex)) return; - xkbPrivPtr = (xkbDeviceInfoPtr) xalloc(sizeof(xkbDeviceInfoRec)); + xkbPrivPtr = (xkbDeviceInfoPtr) xcalloc(1, sizeof(xkbDeviceInfoRec)); if (!xkbPrivPtr) return; xkbPrivPtr->unwrapProc = NULL; @@ -236,22 +236,6 @@ XkbAction fake; #define SYNTHETIC_KEYCODE 1 #define BTN_ACT_FLAG 0x100 -typedef struct _XkbFilter { - CARD16 keycode; - CARD8 what; - CARD8 active; - CARD8 filterOthers; - CARD32 priv; - XkbAction upAction; - int (*filter)( - XkbSrvInfoPtr /* xkbi */, - struct _XkbFilter * /* filter */, - unsigned /* keycode */, - XkbAction * /* action */ - ); - struct _XkbFilter *next; -} XkbFilterRec,*XkbFilterPtr; - static int _XkbFilterSetState( XkbSrvInfoPtr xkbi, XkbFilterPtr filter, @@ -1097,32 +1081,32 @@ int button; } #endif -static int szFilters = 0; -static XkbFilterPtr filters = NULL; - static XkbFilterPtr _XkbNextFreeFilter( - void + XkbSrvInfoPtr xkbi ) { register int i; - if (szFilters==0) { - szFilters = 4; - filters = _XkbTypedCalloc(szFilters,XkbFilterRec); + if (xkbi->szFilters==0) { + xkbi->szFilters = 4; + xkbi->filters = _XkbTypedCalloc(xkbi->szFilters,XkbFilterRec); /* 6/21/93 (ef) -- XXX! deal with allocation failure */ } - for (i=0;iszFilters;i++) { + if (!xkbi->filters[i].active) { + xkbi->filters[i].keycode = 0; + return &xkbi->filters[i]; } } - szFilters*=2; - filters= _XkbTypedRealloc(filters,szFilters,XkbFilterRec); + xkbi->szFilters*=2; + xkbi->filters= _XkbTypedRealloc(xkbi->filters, + xkbi->szFilters, + XkbFilterRec); /* 6/21/93 (ef) -- XXX! deal with allocation failure */ - bzero(&filters[szFilters/2],(szFilters/2)*sizeof(XkbFilterRec)); - return &filters[szFilters/2]; + bzero(&xkbi->filters[xkbi->szFilters/2], + (xkbi->szFilters/2)*sizeof(XkbFilterRec)); + return &xkbi->filters[xkbi->szFilters/2]; } static int @@ -1131,9 +1115,10 @@ _XkbApplyFilters(XkbSrvInfoPtr xkbi,unsigned kc,XkbAction *pAction) register int i,send; send= 1; - for (i=0;iszFilters;i++) { + if ((xkbi->filters[i].active)&&(xkbi->filters[i].filter)) + send= ((*xkbi->filters[i].filter)(xkbi,&xkbi->filters[i],kc,pAction) + && send); } return send; } @@ -1161,6 +1146,8 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); keyc= kbd->key; xkbi= keyc->xkbInfo; key= xE->u.u.detail; + /* The state may change, so if we're not in the middle of sending a state + * notify, prepare for it */ if ((xkbi->flags&_XkbStateNotifyInProgress)==0) { oldState= xkbi->state; xkbi->flags|= _XkbStateNotifyInProgress; @@ -1197,62 +1184,62 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); switch (act.type) { case XkbSA_SetMods: case XkbSA_SetGroup: - filter = _XkbNextFreeFilter(); + filter = _XkbNextFreeFilter(xkbi); sendEvent = _XkbFilterSetState(xkbi,filter,key,&act); break; case XkbSA_LatchMods: case XkbSA_LatchGroup: - filter = _XkbNextFreeFilter(); + filter = _XkbNextFreeFilter(xkbi); sendEvent=_XkbFilterLatchState(xkbi,filter,key,&act); break; case XkbSA_LockMods: case XkbSA_LockGroup: - filter = _XkbNextFreeFilter(); + filter = _XkbNextFreeFilter(xkbi); sendEvent=_XkbFilterLockState(xkbi,filter,key,&act); break; case XkbSA_ISOLock: - filter = _XkbNextFreeFilter(); + filter = _XkbNextFreeFilter(xkbi); sendEvent=_XkbFilterISOLock(xkbi,filter,key,&act); break; case XkbSA_MovePtr: - filter = _XkbNextFreeFilter(); + filter = _XkbNextFreeFilter(xkbi); sendEvent= _XkbFilterPointerMove(xkbi,filter,key,&act); break; case XkbSA_PtrBtn: case XkbSA_LockPtrBtn: case XkbSA_SetPtrDflt: - filter = _XkbNextFreeFilter(); + filter = _XkbNextFreeFilter(xkbi); sendEvent= _XkbFilterPointerBtn(xkbi,filter,key,&act); break; case XkbSA_Terminate: sendEvent= XkbDDXTerminateServer(dev,key,&act); break; case XkbSA_SwitchScreen: - filter = _XkbNextFreeFilter(); + filter = _XkbNextFreeFilter(xkbi); sendEvent=_XkbFilterSwitchScreen(xkbi,filter,key,&act); break; case XkbSA_SetControls: case XkbSA_LockControls: - filter = _XkbNextFreeFilter(); + filter = _XkbNextFreeFilter(xkbi); sendEvent=_XkbFilterControls(xkbi,filter,key,&act); break; case XkbSA_ActionMessage: - filter = _XkbNextFreeFilter(); + filter = _XkbNextFreeFilter(xkbi); sendEvent=_XkbFilterActionMessage(xkbi,filter,key,&act); break; case XkbSA_RedirectKey: - filter = _XkbNextFreeFilter(); + filter = _XkbNextFreeFilter(xkbi); sendEvent= _XkbFilterRedirectKey(xkbi,filter,key,&act); break; #ifdef XINPUT case XkbSA_DeviceBtn: case XkbSA_LockDeviceBtn: - filter = _XkbNextFreeFilter(); + filter = _XkbNextFreeFilter(xkbi); sendEvent= _XkbFilterDeviceBtn(xkbi,filter,key,&act); break; #endif case XkbSA_XFree86Private: - filter = _XkbNextFreeFilter(); + filter = _XkbNextFreeFilter(xkbi); sendEvent= _XkbFilterXF86Private(xkbi,filter,key,&act); break; } @@ -1352,7 +1339,7 @@ unsigned clear; act.type = XkbSA_LatchMods; act.mods.flags = 0; act.mods.mask = mask&latches; - filter = _XkbNextFreeFilter(); + filter = _XkbNextFreeFilter(xkbi); _XkbFilterLatchState(xkbi,filter,SYNTHETIC_KEYCODE,&act); _XkbFilterLatchState(xkbi,filter,SYNTHETIC_KEYCODE,(XkbAction *)NULL); return Success; @@ -1372,7 +1359,7 @@ XkbAction act; act.type = XkbSA_LatchGroup; act.group.flags = 0; XkbSASetGroup(&act.group,group); - filter = _XkbNextFreeFilter(); + filter = _XkbNextFreeFilter(xkbi); _XkbFilterLatchState(xkbi,filter,SYNTHETIC_KEYCODE,&act); _XkbFilterLatchState(xkbi,filter,SYNTHETIC_KEYCODE,(XkbAction *)NULL); return Success; From 91077bfc50d54be37c217e377c55b6bf886a2fab Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 21 Jun 2007 18:24:30 +0930 Subject: [PATCH 15/74] Save processInputProc before wrapping it and restore it later, instead of using a hardcoded ProcessKeyboardEvent. Otherwise we lose the ability to process DeviceKeyEvents after the first key press. This should be the correct fix now. (cherry picked from commit 4d5df14f2c4a3108a8c8adfcf4766c0d1a9daad2) --- include/xkbsrv.h | 3 ++- xkb/xkbActions.c | 17 ++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/xkbsrv.h b/include/xkbsrv.h index bb2316de6..d78a68adf 100644 --- a/include/xkbsrv.h +++ b/include/xkbsrv.h @@ -262,7 +262,8 @@ typedef struct oldprocs->unwrapProc = device->unwrapProc; \ device->unwrapProc = unwrapproc; -#define UNWRAP_PROCESS_INPUT_PROC(device, oldprocs) \ +#define UNWRAP_PROCESS_INPUT_PROC(device, oldprocs, backupproc) \ + backupproc = device->public.processInputProc; \ device->public.processInputProc = oldprocs->processInputProc; \ device->public.realInputProc = oldprocs->realInputProc; \ device->unwrapProc = oldprocs->unwrapProc; diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c index ef67d64e8..2c7c2cd6f 100644 --- a/xkb/xkbActions.c +++ b/xkb/xkbActions.c @@ -49,10 +49,11 @@ xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc, { xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(device); ProcessInputProc tmp = device->public.processInputProc; + ProcessInputProc dummy; /* unused, but neede for macro */ if(xkbPrivPtr->unwrapProc) xkbPrivPtr->unwrapProc = NULL; - UNWRAP_PROCESS_INPUT_PROC(device,xkbPrivPtr); + UNWRAP_PROCESS_INPUT_PROC(device,xkbPrivPtr, dummy); proc(device,data); WRAP_PROCESS_INPUT_PROC(device,xkbPrivPtr, tmp,xkbUnwrapProc); @@ -851,6 +852,7 @@ int x,y; XkbStateRec old; unsigned mods,mask,oldCoreState = 0,oldCorePrevState = 0; xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(xkbi->device); +ProcessInputProc backupproc; /* never actually used uninitialised, but gcc isn't smart enough * to work that out. */ @@ -903,10 +905,10 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(xkbi->device); realMods = xkbi->device->key->modifierMap[ev.u.u.detail]; xkbi->device->key->modifierMap[ev.u.u.detail] = 0; - UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr); + UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr, backupproc); xkbi->device->public.processInputProc(&ev,xkbi->device,1); COND_WRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr, - ProcessKeyboardEvent,xkbUnwrapProc); + backupproc,xkbUnwrapProc); xkbi->device->key->modifierMap[ev.u.u.detail] = realMods; if ( mask || mods ) { @@ -944,10 +946,10 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(xkbi->device); realMods = xkbi->device->key->modifierMap[ev.u.u.detail]; xkbi->device->key->modifierMap[ev.u.u.detail] = 0; - UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr); + UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr, backupproc); xkbi->device->public.processInputProc(&ev,xkbi->device,1); COND_WRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr, - ProcessKeyboardEvent,xkbUnwrapProc); + backupproc,xkbUnwrapProc); xkbi->device->key->modifierMap[ev.u.u.detail] = realMods; if ( mask || mods ) { @@ -1140,6 +1142,7 @@ Bool pressEvent; #ifdef XINPUT Bool xiEvent; #endif +ProcessInputProc backupproc; xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); @@ -1284,10 +1287,10 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); if (keyEvent) { realMods = keyc->modifierMap[key]; keyc->modifierMap[key] = 0; - UNWRAP_PROCESS_INPUT_PROC(dev,xkbPrivPtr); + UNWRAP_PROCESS_INPUT_PROC(dev,xkbPrivPtr, backupproc); dev->public.processInputProc(xE,dev,count); COND_WRAP_PROCESS_INPUT_PROC(dev, xkbPrivPtr, - ProcessKeyboardEvent,xkbUnwrapProc); + backupproc,xkbUnwrapProc); keyc->modifierMap[key] = realMods; } else CoreProcessPointerEvent(xE,dev,count); From 99e826e867c1c5520153c539ba07a884aec88d0c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 6 Sep 2007 18:49:57 +0930 Subject: [PATCH 16/74] xkb: enable XI event processing for xkb. XI events can now take the same processing paths as core events, and should do the correct state changes etc. There's some cases where XKB will use KeyPress as type for an event to be delivered to the client. Stuck warnings in, not sure what the correct solution is yet. (cherry picked from commit 6334d4e7be18de5f237c12a6dc20f75aa23477d0 with some additional compile fixes and non-MPX adaptations) --- include/xkbsrv.h | 3 ++- xkb/xkbActions.c | 44 +++++++++++++++++----------------- xkb/xkbEvents.c | 39 ++++++++++++++++++++++++------- xkb/xkbPrKeyEv.c | 61 +++++++++++++++++++++++++++++++++++++----------- 4 files changed, 103 insertions(+), 44 deletions(-) diff --git a/include/xkbsrv.h b/include/xkbsrv.h index d78a68adf..167dbec59 100644 --- a/include/xkbsrv.h +++ b/include/xkbsrv.h @@ -314,8 +314,9 @@ extern CARD32 xkbDebugFlags; #define _XkbErrCode3(a,b,c) _XkbErrCode2(a,(((unsigned int)(b))<<16)|(c)) #define _XkbErrCode4(a,b,c,d) _XkbErrCode3(a,b,((((unsigned int)(c))<<8)|(d))) -extern int DeviceKeyPress,DeviceKeyRelease; +extern int DeviceKeyPress,DeviceKeyRelease,DeviceMotionNotify; extern int DeviceButtonPress,DeviceButtonRelease; +extern int DeviceEnterNotify,DeviceLeaveNotify; #ifdef XINPUT #define _XkbIsPressEvent(t) (((t)==KeyPress)||((t)==DeviceKeyPress)) diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c index 2c7c2cd6f..c62910f6b 100644 --- a/xkb/xkbActions.c +++ b/xkb/xkbActions.c @@ -39,11 +39,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "xkb.h" #include +#define EXTENSION_EVENT_BASE 64 static unsigned int _xkbServerGeneration; -static int xkbDevicePrivateIndex = -1; +int xkbDevicePrivateIndex = -1; -static void +void xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc, pointer data) { @@ -83,13 +84,11 @@ XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc) proc,xkbUnwrapProc); } -#ifdef XINPUT extern void ProcessOtherEvent( xEvent * /* xE */, DeviceIntPtr /* dev */, int /* count */ ); -#endif /***====================================================================***/ @@ -673,6 +672,7 @@ _XkbFilterPointerBtn( XkbSrvInfoPtr xkbi, &old,xkbi->desc->ctrls, &cn,False)) { cn.keycode = keycode; + /* XXX: what about DeviceKeyPress? */ cn.eventType = KeyPress; cn.requestMajor = 0; cn.requestMinor = 0; @@ -737,6 +737,7 @@ XkbEventCauseRec cause; ctrls->enabled_ctrls|= change; if (XkbComputeControlsNotify(kbd,&old,ctrls,&cn,False)) { cn.keycode = keycode; + /* XXX: what about DeviceKeyPress? */ cn.eventType = KeyPress; cn.requestMajor = 0; cn.requestMinor = 0; @@ -878,6 +879,7 @@ ProcessInputProc backupproc; filter->filter = _XkbFilterRedirectKey; filter->upAction = *pAction; + /* XXX: what about DeviceKeyPress */ ev.u.u.type = KeyPress; ev.u.u.detail = pAction->redirect.new_key; @@ -905,6 +907,10 @@ ProcessInputProc backupproc; realMods = xkbi->device->key->modifierMap[ev.u.u.detail]; xkbi->device->key->modifierMap[ev.u.u.detail] = 0; + /* XXX: Bad! Since the switch to XI devices xkbi->device will be the + * XI device. Sending a core event through ProcessOtherEvent will + * cause trouble. Somebody should fix this. + */ UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr, backupproc); xkbi->device->public.processInputProc(&ev,xkbi->device,1); COND_WRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr, @@ -919,6 +925,7 @@ ProcessInputProc backupproc; } else if (filter->keycode==keycode) { + /* XXX: what about DeviceKeyRelease */ ev.u.u.type = KeyRelease; ev.u.u.detail = filter->upAction.redirect.new_key; @@ -946,6 +953,10 @@ ProcessInputProc backupproc; realMods = xkbi->device->key->modifierMap[ev.u.u.detail]; xkbi->device->key->modifierMap[ev.u.u.detail] = 0; + /* XXX: Bad! Since the switch to XI devices xkbi->device will be the + * XI device. Sending a core event through ProcessOtherEvent will + * cause trouble. Somebody should fix this. + */ UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr, backupproc); xkbi->device->public.processInputProc(&ev,xkbi->device,1); COND_WRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr, @@ -1009,7 +1020,6 @@ _XkbFilterXF86Private( XkbSrvInfoPtr xkbi, return 1; } -#ifdef XINPUT static int _XkbFilterDeviceBtn( XkbSrvInfoPtr xkbi, @@ -1081,7 +1091,6 @@ int button; } return 0; } -#endif static XkbFilterPtr _XkbNextFreeFilter( @@ -1139,9 +1148,7 @@ XkbAction act; XkbFilterPtr filter; Bool keyEvent; Bool pressEvent; -#ifdef XINPUT Bool xiEvent; -#endif ProcessInputProc backupproc; xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); @@ -1162,7 +1169,6 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); xkbi->groupChange = 0; sendEvent = 1; -#ifdef XINPUT keyEvent= ((xE->u.u.type==KeyPress)||(xE->u.u.type==DeviceKeyPress)|| (xE->u.u.type==KeyRelease)||(xE->u.u.type==DeviceKeyRelease)); pressEvent= (xE->u.u.type==KeyPress)||(xE->u.u.type==DeviceKeyPress)|| @@ -1170,10 +1176,6 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); xiEvent= (xE->u.u.type==DeviceKeyPress)||(xE->u.u.type==DeviceKeyRelease)|| (xE->u.u.type==DeviceButtonPress)|| (xE->u.u.type==DeviceButtonRelease); -#else - keyEvent= (xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease); - pressEvent= (xE->u.u.type==KeyPress)||(xE->u.u.type==ButtonPress); -#endif if (pressEvent) { if (keyEvent) @@ -1234,13 +1236,11 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); filter = _XkbNextFreeFilter(xkbi); sendEvent= _XkbFilterRedirectKey(xkbi,filter,key,&act); break; -#ifdef XINPUT case XkbSA_DeviceBtn: case XkbSA_LockDeviceBtn: filter = _XkbNextFreeFilter(xkbi); sendEvent= _XkbFilterDeviceBtn(xkbi,filter,key,&act); break; -#endif case XkbSA_XFree86Private: filter = _XkbNextFreeFilter(xkbi); sendEvent= _XkbFilterXF86Private(xkbi,filter,key,&act); @@ -1279,11 +1279,6 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); } if (sendEvent) { -#ifdef XINPUT - if (xiEvent) - ProcessOtherEvent(xE,dev,count); - else -#endif if (keyEvent) { realMods = keyc->modifierMap[key]; keyc->modifierMap[key] = 0; @@ -1293,7 +1288,14 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); backupproc,xkbUnwrapProc); keyc->modifierMap[key] = realMods; } - else CoreProcessPointerEvent(xE,dev,count); + else + { + if (xE->u.u.type & EXTENSION_EVENT_BASE) + ProcessOtherEvent(xE, dev, count); + else + CoreProcessPointerEvent(xE,dev,count); + + } } else if (keyEvent) FixKeyState(xE,dev); diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c index 11dc17ad3..e11b60918 100644 --- a/xkb/xkbEvents.c +++ b/xkb/xkbEvents.c @@ -34,6 +34,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include +#include #include "inputstr.h" #include "windowstr.h" #include @@ -813,7 +814,9 @@ XkbSrvInfoPtr xkbi; if ( pClient->xkbClientFlags & _XkbClientInitialized ) { #ifdef DEBUG if ((xkbDebugFlags&0x10)&& - ((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease))) { + ((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease)|| + (xE[0].u.u.type==DeviceKeyPress)|| + (xE[0].u.u.type == DeviceKeyRelease))) { ErrorF("XKbFilterWriteEvents:\n"); ErrorF(" Event state= 0x%04x\n",xE[0].u.keyButtonPointer.state); ErrorF(" XkbLastRepeatEvent!=xE (0x%p!=0x%p) %s\n", @@ -832,7 +835,9 @@ XkbSrvInfoPtr xkbi; return False; } if ((pXDev->grab != NullGrab) && pXDev->fromPassiveGrab && - ((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease))) { + ((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease)|| + (xE[0].u.u.type==DeviceKeyPress)|| + (xE[0].u.u.type == DeviceKeyRelease))) { register unsigned state,flags; flags= pClient->xkbClientFlags; @@ -877,10 +882,12 @@ XkbSrvInfoPtr xkbi; type= xE[i].u.u.type; #ifdef DEBUG if ((xkbDebugFlags&0x4)&& - ((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease))) { + ((xE[i].u.u.type==KeyPress)||(xE[i].u.u.type==KeyRelease)|| + (xE[i].u.u.type==DeviceKeyPress)|| + (xE[i].u.u.type == DeviceKeyRelease))) { XkbStatePtr s= &xkbi->state; ErrorF("XKbFilterWriteEvents (non-XKB):\n"); - ErrorF("event= 0x%04x\n",xE[0].u.keyButtonPointer.state); + ErrorF("event= 0x%04x\n",xE[i].u.keyButtonPointer.state); ErrorF("lookup= 0x%02x, grab= 0x%02x\n",s->lookup_mods, s->grab_mods); ErrorF("compat lookup= 0x%02x, grab= 0x%02x\n", @@ -900,9 +907,18 @@ XkbSrvInfoPtr xkbi; xE[i].u.keyButtonPointer.state= new; } else if ((type==EnterNotify)||(type==LeaveNotify)) { - xE->u.enterLeave.state&= 0x1F00; - xE->u.enterLeave.state|= xkbi->state.compat_grab_mods; - } + xE[i].u.enterLeave.state&= 0x1F00; + xE[i].u.enterLeave.state|= xkbi->state.compat_grab_mods; + } else if ((type>=DeviceKeyPress)&&(type<=DeviceMotionNotify)) { + CARD16 old, new; + deviceKeyButtonPointer *kbp = (deviceKeyButtonPointer*)&xE[i]; + old= kbp->state&(~0x1F00); + new= kbp->state&0x1F00; + if (old==XkbStateFieldFromRec(&xkbi->state)) + new|= xkbi->state.compat_lookup_mods; + else new|= xkbi->state.compat_grab_mods; + kbp->state= new; + } button_mask = 1 << xE[i].u.u.detail; if (type == ButtonPress && ((xE[i].u.keyButtonPointer.state >> 7) & button_mask) == button_mask && @@ -911,7 +927,14 @@ XkbSrvInfoPtr xkbi; ErrorF("Faking release of button %d\n", xE[i].u.u.detail); #endif XkbDDXFakePointerButton(ButtonRelease, xE[i].u.u.detail); - } + } else if (type == DeviceButtonPress && + ((((deviceKeyButtonPointer*)&xE[i])->state >> 7) & button_mask) == button_mask && + (xkbi->lockedPtrButtons & button_mask) == button_mask) { +#ifdef DEBUG + ErrorF("Faking release of button %d\n", ((deviceKeyButtonPointer*)&xE[i])->state); +#endif + XkbDDXFakePointerButton(DeviceButtonRelease, ((deviceKeyButtonPointer*)&xE[i])->state); + } } } return True; diff --git a/xkb/xkbPrKeyEv.c b/xkb/xkbPrKeyEv.c index 81124bcfb..ba3fcc06c 100644 --- a/xkb/xkbPrKeyEv.c +++ b/xkb/xkbPrKeyEv.c @@ -38,6 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #include #include +#define EXTENSION_EVENT_BASE 64 /***====================================================================***/ @@ -50,9 +51,11 @@ XkbSrvInfoPtr xkbi; int key; XkbBehavior behavior; unsigned ndx; +int xiEvent; xkbi= keyc->xkbInfo; key= xE->u.u.detail; + xiEvent= (xE->u.u.type & EXTENSION_EVENT_BASE); #ifdef DEBUG if (xkbDebugFlags&0x8) { ErrorF("XkbPKE: Key %d %s\n",key,(xE->u.u.type==KeyPress?"down":"up")); @@ -69,45 +72,69 @@ unsigned ndx; /* below XKB, such as a key that physically locks. XKB does not */ /* do anything to implement the behavior, but it *does* report that */ /* key is hardwired */ + if ((behavior.type&XkbKB_Permanent)==0) { switch (behavior.type) { case XkbKB_Default: - if (( xE->u.u.type == KeyPress ) && + if (( xE->u.u.type == KeyPress || + xE->u.u.type == DeviceKeyPress) && (keyc->down[key>>3] & (1<<(key&7)))) { XkbLastRepeatEvent= (pointer)xE; - xE->u.u.type = KeyRelease; + + if (xiEvent) + xE->u.u.type = DeviceKeyRelease; + else + xE->u.u.type = KeyRelease; XkbHandleActions(keybd,keybd,xE,count); - xE->u.u.type = KeyPress; + + if (xiEvent) + xE->u.u.type = DeviceKeyPress; + else + xE->u.u.type = KeyPress; XkbHandleActions(keybd,keybd,xE,count); XkbLastRepeatEvent= NULL; return; } - else if ((xE->u.u.type==KeyRelease) && + else if ((xE->u.u.type==KeyRelease || + xE->u.u.type == DeviceKeyRelease) && (!(keyc->down[key>>3]&(1<<(key&7))))) { XkbLastRepeatEvent= (pointer)&xE; - xE->u.u.type = KeyPress; + if (xiEvent) + xE->u.u.type = DeviceKeyPress; + else + xE->u.u.type = KeyPress; XkbHandleActions(keybd,keybd,xE,count); - xE->u.u.type = KeyRelease; + if (xiEvent) + xE->u.u.type = DeviceKeyRelease; + else + xE->u.u.type = KeyRelease; XkbHandleActions(keybd,keybd,xE,count); XkbLastRepeatEvent= NULL; return; } break; case XkbKB_Lock: - if ( xE->u.u.type == KeyRelease ) + if ( xE->u.u.type == KeyRelease || + xE->u.u.type == DeviceKeyRelease) return; else { int bit= 1<<(key&7); if ( keyc->down[key>>3]&bit ) - xE->u.u.type= KeyRelease; - } + { + if (xiEvent) + xE->u.u.type = DeviceKeyRelease; + else + xE->u.u.type= KeyRelease; + } + } break; case XkbKB_RadioGroup: ndx= (behavior.data&(~XkbKB_RGAllowNone)); if ( ndxnRadioGroups ) { XkbRadioGroupPtr rg; - if ( xE->u.u.type == KeyRelease ) + if ( xE->u.u.type == KeyRelease || + xE->u.u.type == DeviceKeyRelease) return; rg = &xkbi->radioGroups[ndx]; @@ -121,10 +148,16 @@ unsigned ndx; } if ( rg->currentDown!=0 ) { int key = xE->u.u.detail; - xE->u.u.type= KeyRelease; + if (xiEvent) + xE->u.u.type = DeviceKeyRelease; + else + xE->u.u.type= KeyRelease; xE->u.u.detail= rg->currentDown; XkbHandleActions(keybd,keybd,xE,count); - xE->u.u.type= KeyPress; + if (xiEvent) + xE->u.u.type = DeviceKeyPress; + else + xE->u.u.type= KeyPress; xE->u.u.detail= key; } rg->currentDown= key; @@ -173,9 +206,9 @@ XkbSrvInfoPtr xkbi; #endif if ((xkbi->desc->ctrls->enabled_ctrls&XkbAllFilteredEventsMask)==0) XkbProcessKeyboardEvent(xE,keybd,count); - else if (xE->u.u.type==KeyPress) + else if (xE->u.u.type==KeyPress || xE->u.u.type==DeviceKeyPress) AccessXFilterPressEvent(xE,keybd,count); - else if (xE->u.u.type==KeyRelease) + else if (xE->u.u.type==KeyRelease || xE->u.u.type==DeviceKeyRelease) AccessXFilterReleaseEvent(xE,keybd,count); return; } From 8d3d027062c105b50863dce43b8070ec560bc12e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 6 Sep 2007 18:52:02 +0930 Subject: [PATCH 17/74] dix: add XI event support to FixKeyState. FixKeyState needs to be able to handle XI events, otherwise we get "impossible keyboard events" on server zaps and other special key combos. (cherry picked from commit 5ee409794ee604fcf84886f70429fc2d6b1ff4f1) --- dix/events.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/dix/events.c b/dix/events.c index 61dd53417..d454b8f3b 100644 --- a/dix/events.c +++ b/dix/events.c @@ -3150,7 +3150,7 @@ drawable.id:0; #ifdef XKB /* This function is used to set the key pressed or key released state - this is only used when the pressing of keys does not cause - CoreProcessKeyEvent to be called, as in for example Mouse Keys. + the device's processInputProc to be called, as in for example Mouse Keys. */ void FixKeyState (xEvent *xE, DeviceIntPtr keybd) @@ -3163,22 +3163,19 @@ FixKeyState (xEvent *xE, DeviceIntPtr keybd) kptr = &keyc->down[key >> 3]; bit = 1 << (key & 7); - if (((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease))) { + if (((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease)|| + (xE->u.u.type==DeviceKeyPress)||(xE->u.u.type==DeviceKeyRelease)) + ) { DebugF("FixKeyState: Key %d %s\n",key, - (xE->u.u.type==KeyPress?"down":"up")); + (((xE->u.u.type==KeyPress)||(xE->u.u.type==DeviceKeyPress))?"down":"up")); } - switch (xE->u.u.type) - { - case KeyPress: + if (xE->u.u.type == KeyPress || xE->u.u.type == DeviceKeyPress) *kptr |= bit; - break; - case KeyRelease: + else if (xE->u.u.type == KeyRelease || xE->u.u.type == DeviceKeyRelease) *kptr &= ~bit; - break; - default: - FatalError("Impossible keyboard event"); - } + else + FatalError("Impossible keyboard event"); } #endif From 352c5a311200bf491153fe9ef16126c5877a57bb Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 12 Sep 2007 17:40:11 +0930 Subject: [PATCH 18/74] dix: don't compress motion events from different devices (EventEnqueue) (cherry picked from commit 8840829ab93c4eb62eb58753c015da5307133fe5) --- dix/events.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dix/events.c b/dix/events.c index d454b8f3b..12c299a3b 100644 --- a/dix/events.c +++ b/dix/events.c @@ -1098,9 +1098,10 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count) #endif sprite.hotPhys.x = XE_KBPTR.rootX; sprite.hotPhys.y = XE_KBPTR.rootY; - /* do motion compression */ + /* do motion compression, but not if from different devices */ if (tail && (tail->event->u.u.type == MotionNotify) && + (tail->device == device) && (tail->pScreen == sprite.hotPhys.pScreen)) { tail->event->u.keyButtonPointer.rootX = sprite.hotPhys.x; From d3588a0aee33fbd233082f881c0d37152c6d4d8b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 27 Sep 2007 11:44:03 +0930 Subject: [PATCH 19/74] xkb: xkbHandleActions: let wrapping take care of event delivery. This is hopefully better than hardcodey calling CoreProcessPointerEvent. (cherry picked from commit 32d0440c7f6e604807cb14dd32349df6f22c903b) --- xkb/xkbActions.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c index c62910f6b..e50dbfe60 100644 --- a/xkb/xkbActions.c +++ b/xkb/xkbActions.c @@ -1148,7 +1148,6 @@ XkbAction act; XkbFilterPtr filter; Bool keyEvent; Bool pressEvent; -Bool xiEvent; ProcessInputProc backupproc; xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); @@ -1173,9 +1172,6 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); (xE->u.u.type==KeyRelease)||(xE->u.u.type==DeviceKeyRelease)); pressEvent= (xE->u.u.type==KeyPress)||(xE->u.u.type==DeviceKeyPress)|| (xE->u.u.type==ButtonPress)||(xE->u.u.type==DeviceButtonPress); - xiEvent= (xE->u.u.type==DeviceKeyPress)||(xE->u.u.type==DeviceKeyRelease)|| - (xE->u.u.type==DeviceButtonPress)|| - (xE->u.u.type==DeviceButtonRelease); if (pressEvent) { if (keyEvent) @@ -1282,20 +1278,14 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); if (keyEvent) { realMods = keyc->modifierMap[key]; keyc->modifierMap[key] = 0; - UNWRAP_PROCESS_INPUT_PROC(dev,xkbPrivPtr, backupproc); - dev->public.processInputProc(xE,dev,count); - COND_WRAP_PROCESS_INPUT_PROC(dev, xkbPrivPtr, - backupproc,xkbUnwrapProc); - keyc->modifierMap[key] = realMods; - } - else - { - if (xE->u.u.type & EXTENSION_EVENT_BASE) - ProcessOtherEvent(xE, dev, count); - else - CoreProcessPointerEvent(xE,dev,count); - } + + UNWRAP_PROCESS_INPUT_PROC(dev,xkbPrivPtr, backupproc); + dev->public.processInputProc(xE,dev,count); + COND_WRAP_PROCESS_INPUT_PROC(dev, xkbPrivPtr, + backupproc,xkbUnwrapProc); + if (keyEvent) + keyc->modifierMap[key] = realMods; } else if (keyEvent) FixKeyState(xE,dev); From ee3aa948eb8ed181d037294ed87df6ceec81684e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 26 Sep 2007 18:04:59 +0930 Subject: [PATCH 20/74] xkb: Unwrap properly in ProcessPointerEvent. Instead of hardcoding CoreProcessPointerEvent, actually try to unwrap properly and then call the unwrapped processInputProc. Seems to be a better idea, especially since it makes stuff actually work... (cherry picked from commit 8f9bf927e1beecf9b9ec8877131ec12c765e4d84) --- xkb/xkbAccessX.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index 2954a0c0e..4c6e3d45b 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -692,6 +692,8 @@ ProcessPointerEvent( register xEvent * xE, DeviceIntPtr dev = (DeviceIntPtr)LookupKeyboardDevice(); XkbSrvInfoPtr xkbi = dev->key->xkbInfo; unsigned changed = 0; +ProcessInputProc backupproc; +xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(mouse); xkbi->shiftKeyCount = 0; xkbi->lastPtrEventTime= xE->u.keyButtonPointer.time; @@ -703,7 +705,26 @@ unsigned changed = 0; xkbi->lockedPtrButtons&= ~(1<<(xE->u.u.detail&0x7)); changed |= XkbPointerButtonMask; } - CoreProcessPointerEvent(xE,mouse,count); + + /* Guesswork. mostly. + * xkb actuall goes through some effort to transparently wrap the + * processInputProcs (see XkbSetExtension). But we all love fun, so the + * previous XKB implementation just hardcoded the CPPE call here instead + * of unwrapping like anybody with any sense of decency would do. + * I got no clue what the correct thing to do is, but my guess is that + * it's not hardcoding. I may be wrong. whatever it is, don't come whining + * to me. I just work here. + * + * Anyway. here's the old call, if you don't like the wrapping, revert it. + * + * CoreProcessPointerEvent(xE,mouse,count); + * + * see. it's still steaming. told you. (whot) + */ + UNWRAP_PROCESS_INPUT_PROC(mouse, xkbPrivPtr, backupproc); + mouse->public.processInputProc(xE, mouse, count); + COND_WRAP_PROCESS_INPUT_PROC(mouse, xkbPrivPtr, + backupproc, xkbUnwrapProc); xkbi->state.ptr_buttons = mouse->button->state; From 9db8846fa53d91193bbfe541b244e2326440011d Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Sat, 27 Oct 2007 21:31:39 +0300 Subject: [PATCH 21/74] XKB: Don't update indicators on all devices, add missing include file Don't get XkbUpdateIndicators to update the indicators on all our devices: we already deal with that ourselves. Add exevents.h include to get more (proto)types. --- xkb/xkbActions.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c index e50dbfe60..8ddbdba3d 100644 --- a/xkb/xkbActions.c +++ b/xkb/xkbActions.c @@ -36,6 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "misc.h" #include "inputstr.h" +#include "exevents.h" #include #include "xkb.h" #include @@ -80,8 +81,7 @@ XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc) xkbPrivPtr->unwrapProc = NULL; device->devPrivates[xkbDevicePrivateIndex].ptr = xkbPrivPtr; - WRAP_PROCESS_INPUT_PROC(device,xkbPrivPtr, - proc,xkbUnwrapProc); + WRAP_PROCESS_INPUT_PROC(device, xkbPrivPtr, proc, xkbUnwrapProc); } extern void ProcessOtherEvent( @@ -400,7 +400,6 @@ _XkbFilterLockState( XkbSrvInfoPtr xkbi, unsigned keycode, XkbAction * pAction) { - if (pAction&&(pAction->type==XkbSA_LockGroup)) { if (pAction->group.flags&XkbSA_GroupAbsolute) xkbi->state.locked_group= XkbSAGroup(&pAction->group); @@ -1287,8 +1286,9 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); if (keyEvent) keyc->modifierMap[key] = realMods; } - else if (keyEvent) + else if (keyEvent) { FixKeyState(xE,dev); + } xkbi->prev_state= oldState; XkbComputeDerivedState(xkbi); @@ -1310,7 +1310,7 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); if (changed) { XkbEventCauseRec cause; XkbSetCauseKey(&cause,key,xE->u.u.type); - XkbUpdateIndicators(dev,changed,True,NULL,&cause); + XkbUpdateIndicators(dev,changed,False,NULL,&cause); } return; } From e717cf08e99746761d74289c426bbd84176f4435 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Sat, 27 Oct 2007 21:32:47 +0300 Subject: [PATCH 22/74] XKB: Cope with all events in XkbProcessKeyboardEvent Cope with Xi and pointer events in the (now increasingly misnamed) XkbProcessKeyboardEvent. If it's the wrong type, call through the wrapping chain to get out; else, process it. --- xkb/xkbPrKeyEv.c | 57 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 19 deletions(-) diff --git a/xkb/xkbPrKeyEv.c b/xkb/xkbPrKeyEv.c index ba3fcc06c..3fec4f5ca 100644 --- a/xkb/xkbPrKeyEv.c +++ b/xkb/xkbPrKeyEv.c @@ -36,11 +36,11 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "misc.h" #include "inputstr.h" +#include "exevents.h" #include #include #define EXTENSION_EVENT_BASE 64 - /***====================================================================***/ void @@ -115,12 +115,12 @@ int xiEvent; break; case XkbKB_Lock: if ( xE->u.u.type == KeyRelease || - xE->u.u.type == DeviceKeyRelease) + xE->u.u.type == DeviceKeyRelease) { return; + } else { int bit= 1<<(key&7); - if ( keyc->down[key>>3]&bit ) - { + if ( keyc->down[key>>3]&bit ) { if (xiEvent) xE->u.u.type = DeviceKeyRelease; else @@ -193,23 +193,42 @@ int xiEvent; void ProcessKeyboardEvent(xEvent *xE,DeviceIntPtr keybd,int count) { -KeyClassPtr keyc = keybd->key; -XkbSrvInfoPtr xkbi; - xkbi= keyc->xkbInfo; + KeyClassPtr keyc = keybd->key; + XkbSrvInfoPtr xkbi = NULL; + ProcessInputProc backup_proc; + xkbDeviceInfoPtr xkb_priv = XKBDEVICEINFO(keybd); + int is_press = (xE->u.u.type == KeyPress || xE->u.u.type == DeviceKeyPress); + int is_release = (xE->u.u.type == KeyRelease || + xE->u.u.type == DeviceKeyRelease); -#ifdef DEBUG - if (xkbDebugFlags&0x8) { - int key= xE->u.u.detail; - ErrorF("PKE: Key %d %s\n",key,(xE->u.u.type==KeyPress?"down":"up")); + if (keyc) + xkbi = keyc->xkbInfo; + + /* We're only interested in key events. */ + if (!is_press && !is_release) { + UNWRAP_PROCESS_INPUT_PROC(keybd, xkb_priv, backup_proc); + keybd->public.processInputProc(xE, keybd, count); + COND_WRAP_PROCESS_INPUT_PROC(keybd, xkb_priv, backup_proc, + xkbUnwrapProc); + return; } -#endif - if ((xkbi->desc->ctrls->enabled_ctrls&XkbAllFilteredEventsMask)==0) - XkbProcessKeyboardEvent(xE,keybd,count); - else if (xE->u.u.type==KeyPress || xE->u.u.type==DeviceKeyPress) - AccessXFilterPressEvent(xE,keybd,count); - else if (xE->u.u.type==KeyRelease || xE->u.u.type==DeviceKeyRelease) - AccessXFilterReleaseEvent(xE,keybd,count); + + /* If AccessX filters are active, then pass it through to + * AccessXFilter{Press,Release}Event; else, punt to + * XkbProcessKeyboardEvent. + * + * If AXF[PK]E don't intercept anything (which they probably won't), + * they'll punt through XPKE anyway. */ + if ((xkbi->desc->ctrls->enabled_ctrls & XkbAllFilteredEventsMask)) { + if (is_press) + AccessXFilterPressEvent(xE, keybd, count); + else if (is_release) + AccessXFilterReleaseEvent(xE, keybd, count); + } + else { + XkbProcessKeyboardEvent(xE, keybd, count); + } + return; } - From 8ead41388e36e21eea6fa0408c847f174911eab0 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 6 Sep 2007 18:57:00 +0930 Subject: [PATCH 23/74] xfree86: wrap keyboard devices for XKB. Call ProcessOtherEvents first, then for all keyboard devices let them be wrapped by XKB. This way all XI events will go through XKB. Note that the VCK is still not wrapped, so core events will bypass XKB. (cherry picked from commit d627061b48ae06d27b37be209d67a3f4f2388dd3) --- hw/xfree86/common/xf86Xinput.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index e45d44c02..b939fb763 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -165,6 +165,11 @@ xf86ActivateDevice(LocalDevicePtr local) dev->coreEvents = local->flags & XI86_ALWAYS_CORE; RegisterOtherDevice(dev); +#ifdef XKB + if (!noXkbExtension) + XkbSetExtension(dev, ProcessKeyboardEvent); +#endif + if (serverGeneration == 1) xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n", local->name, local->type_name); From a5546a99ac4da61aee0d49c55bcb38bbce9a96aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 29 Oct 2007 18:06:41 -0400 Subject: [PATCH 24/74] Change the GLX module to initialize after COMPOSITE. This changes the module initalization order so that the GLX module initializes after COMPOSITE. The reason for this change is to be able to initialize a GLX visual config for the COMPOSITE ARGB visual. --- hw/xfree86/dixmods/glxmodule.c | 2 +- mi/miinitext.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/xfree86/dixmods/glxmodule.c b/hw/xfree86/dixmods/glxmodule.c index 847f0d4a2..0ff867de0 100644 --- a/hw/xfree86/dixmods/glxmodule.c +++ b/hw/xfree86/dixmods/glxmodule.c @@ -45,7 +45,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. static MODULESETUPPROTO(glxSetup); -static const char *initdeps[] = { "DOUBLE-BUFFER", NULL }; +static const char *initdeps[] = { "DOUBLE-BUFFER", "COMPOSITE", NULL }; static ExtensionModule GLXExt = { diff --git a/mi/miinitext.c b/mi/miinitext.c index 556bfc84b..b40e8bde3 100644 --- a/mi/miinitext.c +++ b/mi/miinitext.c @@ -630,16 +630,6 @@ InitExtensions(argc, argv) if (!noXFree86DRIExtension) XFree86DRIExtensionInit(); #endif #endif - -#ifdef GLXEXT -#ifdef INXDARWINAPP - DarwinGlxPushProvider(__DarwinglXMesaProvider); - if (!noGlxExtension) DarwinGlxExtensionInit(); -#else - GlxPushProvider(&__glXMesaProvider); - if (!noGlxExtension) GlxExtensionInit(); -#endif // INXDARWINAPP -#endif // GLXEXT #ifdef XFIXES /* must be before Render to layer DisplayCursor correctly */ if (!noXFixesExtension) XFixesExtensionInit(); @@ -665,6 +655,16 @@ InitExtensions(argc, argv) #ifdef DAMAGE if (!noDamageExtension) DamageExtensionInit(); #endif + +#ifdef GLXEXT +#ifdef INXDARWINAPP + DarwinGlxPushProvider(__DarwinglXMesaProvider); + if (!noGlxExtension) DarwinGlxExtensionInit(); +#else + GlxPushProvider(&__glXMesaProvider); + if (!noGlxExtension) GlxExtensionInit(); +#endif +#endif } void From 692654b4300e61a9481e6fa588bcb44a3c3ca150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 29 Oct 2007 18:13:58 -0400 Subject: [PATCH 25/74] Set up visuals for the existing X visuals. This makes the root visual a GLX capable visual again and adds a GLX visual for the COMPOSITE ARGB visual cleanly (as opposed to the hack we had before). --- GL/glx/glxscreens.c | 61 +++++++++++++++++++++++----------- hw/xfree86/common/xf86Config.c | 2 +- hw/xfree86/dri/xf86dri.c | 2 -- 3 files changed, 43 insertions(+), 22 deletions(-) diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c index 31514002b..d6002532d 100644 --- a/GL/glx/glxscreens.c +++ b/GL/glx/glxscreens.c @@ -396,38 +396,61 @@ initGlxVisual(VisualPtr visual, __GLcontextModes *config) visual->offsetBlue = findFirstSet(config->blueMask); } +typedef struct { + GLboolean doubleBuffer; + GLboolean depthBuffer; +} FBConfigTemplateRec, *FBConfigTemplatePtr; + +static __GLcontextModes * +pickFBConfig(__GLXscreen *pGlxScreen, FBConfigTemplatePtr template, int class) +{ + __GLcontextModes *config; + + for (config = pGlxScreen->fbconfigs; config != NULL; config = config->next) { + if (config->visualRating != GLX_NONE) + continue; + if (_gl_convert_to_x_visual_type(config->visualType) != class) + continue; + if ((config->doubleBufferMode > 0) != template->doubleBuffer) + continue; + if ((config->depthBits > 0) != template->depthBuffer) + continue; + + return config; + } + + return NULL; +} + static void addMinimalSet(__GLXscreen *pGlxScreen) { __GLcontextModes *config; VisualPtr visuals; - int depth; + int i; + FBConfigTemplateRec best = { GL_TRUE, GL_TRUE }; + FBConfigTemplateRec minimal = { GL_FALSE, GL_FALSE }; - for (config = pGlxScreen->fbconfigs; config != NULL; config = config->next) { - if (config->visualRating != GLX_NONE) - continue; - if (config->doubleBufferMode && config->depthBits > 0) - break; - } - if (config == NULL) - config = pGlxScreen->fbconfigs; - - pGlxScreen->visuals = xcalloc(1, sizeof (__GLcontextModes *)); + pGlxScreen->visuals = xcalloc(pGlxScreen->pScreen->numVisuals, + sizeof (__GLcontextModes *)); if (pGlxScreen->visuals == NULL) { ErrorF("Failed to allocate for minimal set of GLX visuals\n"); return; } - depth = config->redBits + config->greenBits + config->blueBits; - visuals = AddScreenVisuals(pGlxScreen->pScreen, 1, depth); - if (visuals == NULL) { - xfree(pGlxScreen->visuals); - return; + pGlxScreen->numVisuals = pGlxScreen->pScreen->numVisuals; + visuals = pGlxScreen->pScreen->visuals; + for (i = 0; i < pGlxScreen->numVisuals; i++) { + if (visuals[i].nplanes == 32) + config = pickFBConfig(pGlxScreen, &minimal, visuals[i].class); + else + config = pickFBConfig(pGlxScreen, &best, visuals[i].class); + if (config == NULL) + config = pGlxScreen->fbconfigs; + pGlxScreen->visuals[i] = config; + config->visualID = visuals[i].vid; } - pGlxScreen->numVisuals = 1; - pGlxScreen->visuals[0] = config; - initGlxVisual(&visuals[0], config); } static void diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 35b62a244..b8929c3dd 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -1094,7 +1094,7 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) } #ifdef GLXEXT - xf86Info.glxVisuals = XF86_GlxVisualsAll; + xf86Info.glxVisuals = XF86_GlxVisualsTypical; xf86Info.glxVisualsFrom = X_DEFAULT; if ((s = xf86GetOptValString(FlagOptions, FLAG_GLX_VISUALS))) { if (!xf86NameCmp(s, "minimal")) { diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c index 130afdfa4..ea11b38ee 100644 --- a/hw/xfree86/dri/xf86dri.c +++ b/hw/xfree86/dri/xf86dri.c @@ -322,8 +322,6 @@ ProcXF86DRICreateContext( { xXF86DRICreateContextReply rep; ScreenPtr pScreen; - VisualPtr visual; - int i; REQUEST(xXF86DRICreateContextReq); REQUEST_SIZE_MATCH(xXF86DRICreateContextReq); From 2338d5c9914e2a43c3a4f7ee0f4355ad0a1ad9e7 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Sun, 28 Oct 2007 09:37:52 +0100 Subject: [PATCH 26/74] reduce wakeups from smart scheduler The smart scheduler itimer currently always fires after each request (which in turn causes the CPU to wake out of idle, burning precious power). Rather than doing this, just stop the timer before going into the select() portion of the WaitFor loop. It's a cheap system call, and it will only get called if there's no more commands batched up from the active fd. This change also allows some of the functions to be simplified; setitimer() will only fail if it's passed invalid data, and we don't do that... so make it void and remove all the conditional code that deals with failure. The change also allows us to remove a few variables that were used for housekeeping between the signal handler and the main loop. Signed-off-by: Keith Packard --- include/dixstruct.h | 6 ++---- os/WaitFor.c | 11 +++-------- os/utils.c | 28 +++------------------------- 3 files changed, 8 insertions(+), 37 deletions(-) diff --git a/include/dixstruct.h b/include/dixstruct.h index dd6347f18..bed31dc2a 100644 --- a/include/dixstruct.h +++ b/include/dixstruct.h @@ -150,11 +150,9 @@ extern long SmartScheduleTime; extern long SmartScheduleInterval; extern long SmartScheduleSlice; extern long SmartScheduleMaxSlice; -extern unsigned long SmartScheduleIdleCount; extern Bool SmartScheduleDisable; -extern Bool SmartScheduleIdle; -extern Bool SmartScheduleTimerStopped; -extern Bool SmartScheduleStartTimer(void); +extern void SmartScheduleStartTimer(void); +extern void SmartScheduleStopTimer(void); #define SMART_MAX_PRIORITY (20) #define SMART_MIN_PRIORITY (-20) diff --git a/os/WaitFor.c b/os/WaitFor.c index ec1592c01..7683477e6 100644 --- a/os/WaitFor.c +++ b/os/WaitFor.c @@ -217,7 +217,8 @@ WaitForSomething(int *pClientsReady) XFD_COPYSET(&AllSockets, &LastSelectMask); #ifdef SMART_SCHEDULE } - SmartScheduleIdle = TRUE; + SmartScheduleStopTimer (); + #endif BlockHandler((pointer)&wt, (pointer)&LastSelectMask); if (NewOutputPending) @@ -237,13 +238,7 @@ WaitForSomething(int *pClientsReady) selecterr = GetErrno(); WakeupHandler(i, (pointer)&LastSelectMask); #ifdef SMART_SCHEDULE - if (i >= 0) - { - SmartScheduleIdle = FALSE; - SmartScheduleIdleCount = 0; - if (SmartScheduleTimerStopped) - (void) SmartScheduleStartTimer (); - } + SmartScheduleStartTimer (); #endif if (i <= 0) /* An error or timeout occurred */ { diff --git a/os/utils.c b/os/utils.c index 31cb0af92..6fc1f7d43 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1513,10 +1513,6 @@ XNFstrdup(const char *s) #ifdef SMART_SCHEDULE -unsigned long SmartScheduleIdleCount; -Bool SmartScheduleIdle; -Bool SmartScheduleTimerStopped; - #ifdef SIGVTALRM #define SMART_SCHEDULE_POSSIBLE #endif @@ -1526,7 +1522,7 @@ Bool SmartScheduleTimerStopped; #define SMART_SCHEDULE_TIMER ITIMER_REAL #endif -static void +void SmartScheduleStopTimer (void) { #ifdef SMART_SCHEDULE_POSSIBLE @@ -1537,38 +1533,28 @@ SmartScheduleStopTimer (void) timer.it_value.tv_sec = 0; timer.it_value.tv_usec = 0; (void) setitimer (ITIMER_REAL, &timer, 0); - SmartScheduleTimerStopped = TRUE; #endif } -Bool +void SmartScheduleStartTimer (void) { #ifdef SMART_SCHEDULE_POSSIBLE struct itimerval timer; - SmartScheduleTimerStopped = FALSE; timer.it_interval.tv_sec = 0; timer.it_interval.tv_usec = SmartScheduleInterval * 1000; timer.it_value.tv_sec = 0; timer.it_value.tv_usec = SmartScheduleInterval * 1000; - return setitimer (ITIMER_REAL, &timer, 0) >= 0; + setitimer (ITIMER_REAL, &timer, 0); #endif - return FALSE; } #ifdef SMART_SCHEDULE_POSSIBLE static void SmartScheduleTimer (int sig) { - int olderrno = errno; - SmartScheduleTime += SmartScheduleInterval; - if (SmartScheduleIdle) - { - SmartScheduleStopTimer (); - } - errno = olderrno; } #endif @@ -1592,14 +1578,6 @@ SmartScheduleInit (void) perror ("sigaction for smart scheduler"); return FALSE; } - /* Set up the virtual timer */ - if (!SmartScheduleStartTimer ()) - { - perror ("scheduling timer"); - return FALSE; - } - /* stop the timer and wait for WaitForSomething to start it */ - SmartScheduleStopTimer (); return TRUE; #else return FALSE; From a2ee5fe0c4e863c7ff4f644e5ac86f2793903103 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 1 Nov 2007 13:46:20 -0400 Subject: [PATCH 27/74] Enable MIT-SHM in Xdmx. The extension is entirely DIX-level, no new DDX changes needed. --- hw/dmx/dmx-config.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/dmx/dmx-config.h b/hw/dmx/dmx-config.h index 18a05356b..343fdabf5 100644 --- a/hw/dmx/dmx-config.h +++ b/hw/dmx/dmx-config.h @@ -83,9 +83,7 @@ #undef XF86MISC #undef XFreeXDGA #undef XF86DRI -#undef MITSHM #undef TOGCUP -#undef DPSEXT #undef MITMISC #undef SCREENSAVER #undef RANDR From f01e149d1af14ef9ee0e8a6743ab6a08f3bb677c Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 1 Nov 2007 15:41:11 -0400 Subject: [PATCH 28/74] Move SIGUSR1 notification as late as possible. If we inherited a signal mask from the parent process that ignores SIGUSR1, then we will send SIGUSR1 to the parent to indicate when we're ready to accept connections. Unfortunately, we send this notification way too early, right after creating the sockets rather than just before entering the main loop. Move it to just before Dispatch() so we're not lying quite so much. --- dix/main.c | 2 ++ include/os.h | 2 ++ os/connection.c | 87 ++++++++++++++++++++++++++++--------------------- 3 files changed, 53 insertions(+), 38 deletions(-) diff --git a/dix/main.c b/dix/main.c index 31e291b02..e5c557800 100644 --- a/dix/main.c +++ b/dix/main.c @@ -449,6 +449,8 @@ main(int argc, char *argv[], char *envp[]) } } + NotifyParentProcess(); + Dispatch(); /* Now free up whatever must be freed */ diff --git a/include/os.h b/include/os.h index 597ecd742..a87b739b9 100644 --- a/include/os.h +++ b/include/os.h @@ -124,6 +124,8 @@ extern void ResetOsBuffers(void); extern void InitConnectionLimits(void); +extern void NotifyParentProcess(void); + extern void CreateWellKnownSockets(void); extern void ResetWellKnownSockets(void); diff --git a/os/connection.c b/os/connection.c index 70551a844..860404f6c 100644 --- a/os/connection.c +++ b/os/connection.c @@ -362,6 +362,52 @@ InitConnectionLimits(void) #endif } +/* + * If SIGUSR1 was set to SIG_IGN when the server started, assume that either + * + * a- The parent process is ignoring SIGUSR1 + * + * or + * + * b- The parent process is expecting a SIGUSR1 + * when the server is ready to accept connections + * + * In the first case, the signal will be harmless, in the second case, + * the signal will be quite useful. + */ +static void +InitParentProcess(void) +{ +#if !defined(WIN32) + OsSigHandlerPtr handler; + handler = OsSignal (SIGUSR1, SIG_IGN); + if ( handler == SIG_IGN) + RunFromSmartParent = TRUE; + OsSignal(SIGUSR1, handler); + ParentProcess = getppid (); +#ifdef __UNIXOS2__ + /* + * fg030505: under OS/2, xinit is not the parent process but + * the "grant parent" process of the server because execvpe() + * presents us an additional process number; + * GetPPID(pid) is part of libemxfix + */ + ParentProcess = GetPPID (ParentProcess); +#endif /* __UNIXOS2__ */ +#endif +} + +void +NotifyParentProcess(void) +{ +#if !defined(WIN32) + if (RunFromSmartParent) { + if (ParentProcess > 1) { + kill (ParentProcess, SIGUSR1); + } + } +#endif +} /***************** * CreateWellKnownSockets @@ -374,7 +420,6 @@ CreateWellKnownSockets(void) int i; int partial; char port[20]; - OsSigHandlerPtr handler; FD_ZERO(&AllSockets); FD_ZERO(&AllClients); @@ -428,33 +473,9 @@ CreateWellKnownSockets(void) OsSignal (SIGTERM, GiveUp); XFD_COPYSET (&WellKnownConnections, &AllSockets); ResetHosts(display); - /* - * Magic: If SIGUSR1 was set to SIG_IGN when - * the server started, assume that either - * - * a- The parent process is ignoring SIGUSR1 - * - * or - * - * b- The parent process is expecting a SIGUSR1 - * when the server is ready to accept connections - * - * In the first case, the signal will be harmless, - * in the second case, the signal will be quite - * useful - */ -#if !defined(WIN32) - handler = OsSignal (SIGUSR1, SIG_IGN); - if ( handler == SIG_IGN) - RunFromSmartParent = TRUE; - OsSignal(SIGUSR1, handler); - ParentProcess = getppid (); - if (RunFromSmartParent) { - if (ParentProcess > 1) { - kill (ParentProcess, SIGUSR1); - } - } -#endif + + InitParentProcess(); + #ifdef XDMCP XdmcpInit (); #endif @@ -503,16 +524,6 @@ ResetWellKnownSockets (void) ResetAuthorization (); ResetHosts(display); - /* - * See above in CreateWellKnownSockets about SIGUSR1 - */ -#if !defined(WIN32) - if (RunFromSmartParent) { - if (ParentProcess > 1) { - kill (ParentProcess, SIGUSR1); - } - } -#endif /* * restart XDMCP */ From b97518666dc32710fe69eee33ee56881dcff1bbc Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Sun, 28 Oct 2007 09:37:52 +0100 Subject: [PATCH 29/74] Fix accidental ABI usage in RANDR 1.2 drivers. Due to RANDR 1.2, xf86findOptionValue and xf86nameCompare are now ABI. Make sure they're exported from the server. --- hw/xfree86/parser/Flags.c | 2 +- hw/xfree86/parser/scan.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c index 5b60a5155..730ea0cab 100644 --- a/hw/xfree86/parser/Flags.c +++ b/hw/xfree86/parser/Flags.c @@ -330,7 +330,7 @@ xf86findOption (XF86OptionPtr list, const char *name) * returned. If the option is not found, a NULL is returned. */ -char * +__attribute__((visibility("default"))) char * xf86findOptionValue (XF86OptionPtr list, const char *name) { XF86OptionPtr p = xf86findOption (list, name); diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c index 55c7eb55f..e7989d107 100644 --- a/hw/xfree86/parser/scan.c +++ b/hw/xfree86/parser/scan.c @@ -948,7 +948,7 @@ StringToToken (char *str, xf86ConfigSymTabRec * tab) * Compare two names. The characters '_', ' ', and '\t' are ignored * in the comparison. */ -int +__attribute__((visibility("default"))) int xf86nameCompare (const char *s1, const char *s2) { char c1, c2; From 22f0e3a8b04e574047a51c8f928a007787303294 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Sun, 28 Oct 2007 09:37:52 +0100 Subject: [PATCH 30/74] Avoid PS/2 protocol probing for /dev/input/mice The kernel will always upconvert to ExplorerPS/2 for all readers of /dev/input/mice, so don't waste time on startup trying to figure that out. --- hw/xfree86/os-support/linux/lnx_mouse.c | 32 ++++++++++++++++++------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/hw/xfree86/os-support/linux/lnx_mouse.c b/hw/xfree86/os-support/linux/lnx_mouse.c index 150547ea4..d2822153f 100644 --- a/hw/xfree86/os-support/linux/lnx_mouse.c +++ b/hw/xfree86/os-support/linux/lnx_mouse.c @@ -45,7 +45,8 @@ typedef enum { MOUSE_PROTO_SERIAL, MOUSE_PROTO_PS2, MOUSE_PROTO_MSC, - MOUSE_PROTO_GPM + MOUSE_PROTO_GPM, + MOUSE_PROTO_EXPPS2, } protocolTypes; static struct { @@ -55,7 +56,8 @@ static struct { { MOUSE_PROTO_UNKNOWN, NULL }, { MOUSE_PROTO_PS2, "PS/2" }, { MOUSE_PROTO_MSC, "MouseSystems" }, - { MOUSE_PROTO_GPM, "GPM" } + { MOUSE_PROTO_GPM, "GPM" }, + { MOUSE_PROTO_EXPPS2, "ExplorerPS/2" }, }; static const char * @@ -87,7 +89,7 @@ FindDevice(InputInfoPtr pInfo, const char *protocol, int flags) } static const char * -GuessProtocol(InputInfoPtr pInfo, int flags) +lnxMouseMagic(InputInfoPtr pInfo) { int fd = -1; const char *dev; @@ -137,8 +139,10 @@ GuessProtocol(InputInfoPtr pInfo, int flags) } } - if (strcmp(realdev, DEFAULT_PS2_DEV) == 0) - proto = MOUSE_PROTO_PS2; + if (strcmp(realdev, DEFAULT_MOUSE_DEV) == 0) + proto = MOUSE_PROTO_EXPPS2; + else if (strcmp(realdev, DEFAULT_PS2_DEV) == 0) + proto = MOUSE_PROTO_EXPPS2; else if (strcmp(realdev, DEFAULT_GPM_DATA_DEV) == 0) proto = MOUSE_PROTO_MSC; else if (strcmp(realdev, DEFAULT_GPM_CTL_DEV) == 0) @@ -171,15 +175,14 @@ GuessProtocol(InputInfoPtr pInfo, int flags) close(fd); } if (proto == MOUSE_PROTO_UNKNOWN) { - xf86Msg(X_ERROR, "%s: GuessProtocol: Cannot find mouse protocol.\n", + xf86Msg(X_ERROR, "%s: Cannot find mouse protocol.\n", pInfo->name); return NULL; } else { for (i = 0; i < sizeof(devproto)/sizeof(devproto[0]); i++) { if (devproto[i].proto == proto) { xf86Msg(X_INFO, - "%s: GuessProtocol: " - "setting mouse protocol to \"%s\"\n", + "%s: Setting mouse protocol to \"%s\"\n", pInfo->name, devproto[i].name); return devproto[i].name; } @@ -188,6 +191,18 @@ GuessProtocol(InputInfoPtr pInfo, int flags) return NULL; } +static const char * +GuessProtocol(InputInfoPtr pInfo, int flags) +{ + return lnxMouseMagic(pInfo); +} + +static const char * +SetupAuto(InputInfoPtr pInfo, int *protoPara) +{ + return lnxMouseMagic(pInfo); +} + _X_EXPORT OSMouseInfoPtr xf86OSMouseInit(int flags) { @@ -200,6 +215,7 @@ xf86OSMouseInit(int flags) p->DefaultProtocol = DefaultProtocol; p->FindDevice = FindDevice; p->GuessProtocol = GuessProtocol; + p->SetupAuto = SetupAuto; return p; } From f4fe66f6767d1941317dc0280ac359421a152587 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Sun, 28 Oct 2007 09:37:52 +0100 Subject: [PATCH 31/74] Disable explicit commenting in Monitor section. --- hw/xfree86/parser/Monitor.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/xfree86/parser/Monitor.c b/hw/xfree86/parser/Monitor.c index 4bff4b23b..9d533125e 100644 --- a/hw/xfree86/parser/Monitor.c +++ b/hw/xfree86/parser/Monitor.c @@ -688,8 +688,6 @@ xf86printMonitorSection (FILE * cf, XF86ConfMonitorPtr ptr) fprintf (cf, "\tDisplaySize %d\t%d\n", ptr->mon_width, ptr->mon_height); - if ( ptr->mon_n_hsync || ptr->mon_n_vrefresh ) - fprintf(cf," ### Comment all HorizSync and VertRefresh values to use DDC:\n"); for (i = 0; i < ptr->mon_n_hsync; i++) { fprintf (cf, "\tHorizSync %2.1f - %2.1f\n", From c095da04fe7c73b6503ef5b93549b13796c51b22 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Sun, 28 Oct 2007 09:37:52 +0100 Subject: [PATCH 32/74] Fix magic number in fbdevhw The transformation between fbdev and xfree86 mode timings needs to be invertible, otherwise Xen and other framebuffers that don't have real pixel clocks won't initialize. --- hw/xfree86/fbdevhw/fbdevhw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c index 837d2b12b..13be7858f 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.c +++ b/hw/xfree86/fbdevhw/fbdevhw.c @@ -258,7 +258,7 @@ fbdev_modes_equal(struct fb_var_screeninfo *set, struct fb_var_screeninfo *req) static void fbdev2xfree_timing(struct fb_var_screeninfo *var, DisplayModePtr mode) { - mode->Clock = var->pixclock ? 1000000000/var->pixclock : 28000000; + mode->Clock = var->pixclock ? 1000000000/var->pixclock : 0; mode->HDisplay = var->xres; mode->HSyncStart = mode->HDisplay+var->right_margin; mode->HSyncEnd = mode->HSyncStart+var->hsync_len; From 5b41d4e60be35cfb96bedec0931fd5922823b4b9 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Sun, 28 Oct 2007 09:37:52 +0100 Subject: [PATCH 33/74] Don't filter modes away during VBE mode list construction. Pass all VBE modes back up to the driver, on the assumption that it knows how to filter modes intelligently. --- hw/xfree86/vbe/vbeModes.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/hw/xfree86/vbe/vbeModes.c b/hw/xfree86/vbe/vbeModes.c index ef2c728f4..061d7b695 100644 --- a/hw/xfree86/vbe/vbeModes.c +++ b/hw/xfree86/vbe/vbeModes.c @@ -152,34 +152,6 @@ CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe, int id, xf86ErrorFVerb(DEBUG_VERB, "*"); } - /* - * Check if there's a valid monitor mode that this one can be matched - * up with. The actual matching is done later. - */ - if (modeOK) { - Bool sizeMatch = FALSE; - modeOK = FALSE; - for (p = pScrn->monitor->Modes; p != NULL; p = p->next) { - if ((p->HDisplay != mode->XResolution) || - (p->VDisplay != mode->YResolution) || - (p->Flags & (V_INTERLACE | V_DBLSCAN | V_CLKDIV2))) - continue; - sizeMatch = TRUE; - /* XXX could support the various V_ flags */ - status = xf86CheckModeForMonitor(p, pScrn->monitor); - if (status == MODE_OK) { - modeOK = TRUE; - break; - } - } - if (sizeMatch && !modeOK) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Not using built-in mode \"%dx%d\" (%s)\n", - mode->XResolution, mode->YResolution, - xf86ModeStatusToString(status)); - } - } - xf86ErrorFVerb(DEBUG_VERB, "Mode: %x (%dx%d)\n", id, mode->XResolution, mode->YResolution); xf86ErrorFVerb(DEBUG_VERB, From 7a0555e9bb59d02816803a1100f807d2d29f31d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Sun, 28 Oct 2007 09:37:52 +0100 Subject: [PATCH 34/74] Fix crash in xf86InitOrigins() In a multihead setup, if only the first screen can be initialized, but the second screen is mentioned first in the ServerLayout section, the xf86InitOrigins() function will crash because the screen referred to in the e.g. "RightOf" part is non-existent. --- hw/xfree86/common/xf86Cursor.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c index 9e6e62216..3ea1b4d91 100644 --- a/hw/xfree86/common/xf86Cursor.c +++ b/hw/xfree86/common/xf86Cursor.c @@ -558,6 +558,14 @@ xf86InitOrigins(void) screen = &xf86ConfigLayout.screens[i]; + if (screen->refscreen != NULL && + screen->refscreen->screennum >= xf86NumScreens) { + screensLeft &= ~(1 << i); + xf86Msg(X_WARNING, "Not including screen \"%s\" in origins calculation.\n", + screen->screen->id); + continue; + } + switch(screen->where) { case PosObsolete: OldStyleConfig = TRUE; From dfb1cce28ac07d412598f7b9ab2ee908978b38e7 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 2 Nov 2007 12:51:56 -0400 Subject: [PATCH 35/74] Restore build of xf8_16bpp. It doesn't link against cfb, so don't conditionalize its build against cfb. --- hw/xfree86/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am index 9be022010..627703338 100644 --- a/hw/xfree86/Makefile.am +++ b/hw/xfree86/Makefile.am @@ -13,14 +13,14 @@ MFB_SUBDIR = xf1bpp xf4bpp endif if CFB -CFB_SUBDIR = xf8_16bpp xf8_32bpp +CFB_SUBDIR = xf8_32bpp endif DOC_SUBDIR = doc SUBDIRS = common ddc dummylib i2c x86emu int10 fbdevhw os-support parser rac \ ramdac shadowfb vbe vgahw xaa $(MFB_SUBDIR) $(CFB_SUBDIR) \ - loader dixmods exa modes \ + xf8_16bpp loader dixmods exa modes \ $(DRI_SUBDIR) $(XF86UTILS_SUBDIR) $(DOC_SUBDIR) DIST_SUBDIRS = common ddc dummylib i2c x86emu int10 fbdevhw os-support \ From 4d0f35c81df307609b29c0f12aa1b4c6ee6fd8d2 Mon Sep 17 00:00:00 2001 From: Matthias Hopf Date: Fri, 2 Nov 2007 19:27:32 +0100 Subject: [PATCH 36/74] Always duplicate mode name when duplicating a mode. If the originating mode didn't have a name, we would end up with the name of the original mode being setup correctly, but with the name of the copy still being NULL. --- hw/xfree86/modes/xf86Modes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c index 99817898a..3879b9103 100644 --- a/hw/xfree86/modes/xf86Modes.c +++ b/hw/xfree86/modes/xf86Modes.c @@ -196,9 +196,8 @@ xf86DuplicateMode(DisplayModePtr pMode) pNew->prev = NULL; if (pNew->name == NULL) { xf86SetModeDefaultName(pMode); - } else { - pNew->name = xnfstrdup(pMode->name); } + pNew->name = xnfstrdup(pMode->name); return pNew; } From 181468db92d44a58080fc9a76e46dfc7011bf9f1 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Sun, 4 Nov 2007 04:50:26 -0800 Subject: [PATCH 37/74] add missing null-pointer checks --- miext/rootless/safeAlpha/safeAlphaPicture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miext/rootless/safeAlpha/safeAlphaPicture.c b/miext/rootless/safeAlpha/safeAlphaPicture.c index 0ed2f3e79..57f1ae187 100644 --- a/miext/rootless/safeAlpha/safeAlphaPicture.c +++ b/miext/rootless/safeAlpha/safeAlphaPicture.c @@ -167,7 +167,7 @@ SafeAlphaComposite (CARD8 op, pDst->format = PICT_a8r8g8b8; } - if (pSrc->pDrawable && pMask->pDrawable && + if (pSrc && pMask && pSrc->pDrawable && pMask->pDrawable && !pSrc->transform && !pMask->transform && !pSrc->alphaMap && !pMask->alphaMap && !pMask->repeat && !pMask->componentAlpha && !pDst->alphaMap && From ff9929ed48f2dec8b536d348e25e66a0bc4ac1a6 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Sun, 4 Nov 2007 05:13:19 -0800 Subject: [PATCH 38/74] pulling in changes from xorg-server-1.2-apple branch --- hw/darwin/apple/X11.icns | Bin 28104 -> 65908 bytes hw/darwin/apple/X11Application.h | 2 +- hw/darwin/apple/X11Application.m | 3 ++- hw/darwin/apple/X11Controller.m | 20 +++++--------------- hw/darwin/quartz/xpr/xprCursor.c | 13 ++++++++++--- hw/darwin/quartz/xpr/xprFrame.c | 5 ++--- hw/darwin/quartz/xpr/xprScreen.c | 23 ++++++++++++++--------- 7 files changed, 34 insertions(+), 32 deletions(-) diff --git a/hw/darwin/apple/X11.icns b/hw/darwin/apple/X11.icns index 4c4717726399030db37efe54e4d95f3d746855ec..d770e617ddb455d8a499550e712f93a06a69f871 100644 GIT binary patch literal 65908 zcmeFY1z1&E+crAaT6C8PN_Q+^5rTx2NGl;7N{L8Hih!_a79rgoA}xrND5cUNC8Z$U z-8s+2-tN75_xHW$I^XsG@BXiI4)--#jJVhHJY&ug&$GrHPfTqc0SLtDi6cKB06_g- zf)D^b5FkefK=9#YXHR!;Z+~y^*RIJ2An4xN88Cs}=?;QOu#{hE(;LLiuLHe7&9sp|omVbXSU-P&68sNXw{|o>9|FHh= z{8|7=?rUvtZEb69Yj17+nhXF$q=clTWW;2|gy$c?6YKM_h;jcTm(tlWdXAawnvtM9L3KM=j2n~gzj z-v@*~l0W>T*dIj8riD}cc!SVHwjX}K$N?a>EiIg>3Iy92-unMuSmJ+%3ohSgVHKI% z67m8;zcXMJ2>>Mlr`X^pHu&`r+j~c#|0%G71c2he6HG9H_O2J=Cm3)7ET1{RJ1!z;FfxLjve`0L&u+Am48fAFN{j4DKEt7&3Enw}HNUz#I|)@_cvEPRDs- zK;$mw>6kE_U1{~mXBU`70>EpZ9rXQuHItJ)?;T9AgcZT~>}=P22bejp^WH|^IdTNUT%X#9t`GY70D+(n0QtB-cLdr0=mYqJ zJ^)a;v=3DJ0Dho10I}a#+JAWS#AXye^uyWjL z0uZvb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!_ z%-yhZaEEXO9Q|flcVlmHSTFW<+zf#dHT-moi?};Z4v!LVQVBTPjq%-`y~W`h)2_h* zBr<+NiwkHD6FNrLX8?)n{CsolEsp0qM>WWgesD^QuiqS|JQ&>|KQ?iCbL=gS>4~vF zANdd61N$FpuwQ9&Pvp0$Zvaxh^nZ)jcXOC7^H0{F4cUKW|7osWv^Zq{k^M*Z9|75a zW&dsQ{@NU5|CRk$_Fvh50p$K8_aC|cv^M1aEB9Zy|H}PW?!R*Wkn@L}KUy1d{*d#B zoIm9JA?FV{f5`bm&L6D}Ie*CcL(U&^{*d#BoIm9Jac}33*u<%=z5V0V#Mp-ZAKi6Q zM&|N0t%v2A8I!t3*UKkSoqCNNKRLbiFnRpQUY%}!{~)qMV&B0dMztPB4DOrQ;pX=* z95M0TdOqH(_3(JlZt*dWhVLIJ&gk}W4=;)|O q$4&7-h!Wv&wk8}A3TZH3{6ptE|HJ2>1dXKI8nh~eObLm5jsF1~>3~E4 diff --git a/hw/darwin/apple/X11Application.h b/hw/darwin/apple/X11Application.h index eb205a1cd..861565798 100644 --- a/hw/darwin/apple/X11Application.h +++ b/hw/darwin/apple/X11Application.h @@ -79,7 +79,7 @@ extern void X11ApplicationMain (int argc, const char *argv[], extern int X11EnableKeyEquivalents; extern int quartzHasRoot, quartzEnableRootless; -#define APP_PREFS "org.x.x11" +#define APP_PREFS "org.x.X11" #define PREFS_APPSMENU "apps_menu" #define PREFS_FAKEBUTTONS "enable_fake_buttons" diff --git a/hw/darwin/apple/X11Application.m b/hw/darwin/apple/X11Application.m index 41cf425c6..6b235ad0b 100644 --- a/hw/darwin/apple/X11Application.m +++ b/hw/darwin/apple/X11Application.m @@ -45,7 +45,7 @@ #include #include -#define DEFAULTS_FILE "/usr/X11/lib/X11xserver/Xquartz.plist" +#define DEFAULTS_FILE "/usr/X11/lib/X11/xserver/Xquartz.plist" int X11EnableKeyEquivalents = TRUE; int quartzHasRoot = FALSE, quartzEnableRootless = TRUE; @@ -311,6 +311,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) { [NSApp activateIgnoringOtherApps:YES]; if ([self modalWindow] == nil) [self activateX:YES]; + QuartzMessageServerThread(kXDarwinBringAllToFront, 0); } - (void) set_can_quit:(NSNumber *)state { diff --git a/hw/darwin/apple/X11Controller.m b/hw/darwin/apple/X11Controller.m index acac313f4..fbc9c7402 100644 --- a/hw/darwin/apple/X11Controller.m +++ b/hw/darwin/apple/X11Controller.m @@ -1,5 +1,4 @@ /* X11Controller.m -- connect the IB ui, also the NSApp delegate - $Id: X11Controller.m,v 1.40 2006/09/06 21:19:32 jharper Exp $ Copyright (c) 2002-2007 Apple Inc. All rights reserved. @@ -294,26 +293,17 @@ - (void) launch_client:(NSString *)filename { const char *command = [filename UTF8String]; - const char *shell; - const char *argv[5]; + const char *argv[7]; int child1, child2 = 0; int status; - /* this old code doesn't work with csh ... - shell = getenv("SHELL"); - if (shell == NULL) shell = "/bin/bash"; - - argv[0] = shell; - argv[1] = "-l"; - argv[2] = "-c"; - argv[3] = command; - argv[4] = NULL; - ... but the new code doesn't work with spaces in a command :( - */ - argv[0] = "/usr/bin/login"; argv[1] = "-fp"; argv[2] = getlogin(); + argv[3] = "/bin/sh"; + argv[4] = "-c"; + argv[5] = command; + argv[6] = NULL; /* Do the fork-twice trick to avoid having to reap zombies */ diff --git a/hw/darwin/quartz/xpr/xprCursor.c b/hw/darwin/quartz/xpr/xprCursor.c index d5a118061..10d326444 100644 --- a/hw/darwin/quartz/xpr/xprCursor.c +++ b/hw/darwin/quartz/xpr/xprCursor.c @@ -2,8 +2,6 @@ * * Xplugin cursor support * - **************************************************************/ -/* * Copyright (c) 2001 Torrey T. Lyons and Greg Parker. * Copyright (c) 2002 Apple Computer, Inc. * All Rights Reserved. @@ -84,8 +82,17 @@ load_cursor(CursorPtr src, int screen) #ifdef ARGB_CURSOR if (src->bits->argb != NULL) { - rowbytes = src->bits->width * sizeof(CARD32); +#if BITMAP_BIT_ORDER == MSBFirst + rowbytes = src->bits->width * sizeof (CARD32); data = (uint32_t *) src->bits->argb; +#else + const uint32_t *be_data=(uint32_t *) src->bits->argb; + unsigned i; + rowbytes = src->bits->width * sizeof (CARD32); + data=alloca (rowbytes * src->bits->height); + for(i=0;i<(src->bits->width*src->bits->height);i++) + data[i]=ntohl(be_data[i]); +#endif } else #endif diff --git a/hw/darwin/quartz/xpr/xprFrame.c b/hw/darwin/quartz/xpr/xprFrame.c index 76c719ec0..c395f0743 100644 --- a/hw/darwin/quartz/xpr/xprFrame.c +++ b/hw/darwin/quartz/xpr/xprFrame.c @@ -1,7 +1,6 @@ /* * Xplugin rootless implementation frame functions - */ -/* + * * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. * @@ -411,7 +410,7 @@ xprInit(ScreenPtr pScreen) * Given the id of a physical window, try to find the top-level (or root) * X window that it represents. */ -static WindowPtr +WindowPtr xprGetXWindow(xp_window_id wid) { RootlessWindowRec *winRec; diff --git a/hw/darwin/quartz/xpr/xprScreen.c b/hw/darwin/quartz/xpr/xprScreen.c index b0ddece3f..3f91980bd 100644 --- a/hw/darwin/quartz/xpr/xprScreen.c +++ b/hw/darwin/quartz/xpr/xprScreen.c @@ -1,7 +1,6 @@ /* * Xplugin rootless implementation screen functions - */ -/* + * * Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved. * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved. * @@ -77,8 +76,14 @@ eventHandler(unsigned int type, const void *arg, if (arg_size == sizeof(xp_window_id)) { xp_window_id id = * (xp_window_id *) arg; - - QuartzMessageServerThread(kXDarwinWindowMoved, 1, id); + WindowPtr pWin = xprGetXWindow(id); + BoxRec box; + xp_error retval = xp_get_window_bounds(id, &box); + if (retval != Success) { + ErrorF("Unable to find new bounds for window\n"); + break; + } + QuartzMessageServerThread(kXDarwinWindowMoved, 3, pWin, box.x1, box.y1); } break; @@ -177,15 +182,15 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height) frame = displayScreenBounds(dpy); - ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i, + /* ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i, (int)frame.size.width, (int)frame.size.height, - (int)frame.origin.x, (int)frame.origin.y); + (int)frame.origin.x, (int)frame.origin.y); */ frame.origin.x -= unionRect.origin.x; frame.origin.y -= unionRect.origin.y; - ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n", - i, (int)frame.origin.x, (int)frame.origin.y); + /* ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n", + i, (int)frame.origin.x, (int)frame.origin.y); */ PseudoramiXAddScreen(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height); @@ -203,7 +208,7 @@ xprDisplayInit(void) { CGDisplayCount displayCount; - ErrorF("Display mode: Rootless Quartz -- Xplugin implementation\n"); + // ErrorF("Display mode: Rootless Quartz -- Xplugin implementation\n"); CGGetActiveDisplayList(0, NULL, &displayCount); From 41c3069f7cf28155f8e6cfe0c10a12a1f5f76c7d Mon Sep 17 00:00:00 2001 From: Mark Vytlacil Date: Thu, 1 Nov 2007 21:05:43 +0200 Subject: [PATCH 39/74] XFree86: Input: Save/restore errno around SIGIO (bug #10683) Make sure errno is saved and restored from the SIGIO handler, so errors from system calls in input handlers don't break the interrupted code. --- hw/xfree86/common/xf86Events.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 785815c6a..e88fc3b3e 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -510,12 +510,14 @@ static void xf86SigioReadInput(int fd, void *closure) { + int errno_save = errno; int sigstate = xf86BlockSIGIO(); InputInfoPtr pInfo = (InputInfoPtr) closure; pInfo->read_input(pInfo); xf86UnblockSIGIO(sigstate); + errno = errno_save; } /* From 3f1b6765aadf665ede8253464da19a5878f16e56 Mon Sep 17 00:00:00 2001 From: Markku Vire Date: Thu, 1 Nov 2007 22:43:04 +0200 Subject: [PATCH 40/74] Config: HAL: Touchpads are pointers too Treat touchpads -- not just mice -- as pointer devices. --- config/hal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/hal.c b/config/hal.c index d7835e653..6bb449d5a 100644 --- a/config/hal.c +++ b/config/hal.c @@ -177,7 +177,8 @@ device_added(LibHalContext *hal_ctx, const char *udi) if (strcmp(props[i], "input.keys") == 0 || strcmp(props[i], "input.keyboard") == 0) type |= TYPE_KEYS; - if (strcmp(props[i], "input.mouse") == 0) + if (strcmp(props[i], "input.mouse") == 0 || + strcmp(props[i], "input.touchpad") == 0) type |= TYPE_POINTER; } libhal_free_string_array(props); From f2e310132fbe1520c1b5f3da4faa2d2d47835e72 Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Wed, 31 Oct 2007 14:15:35 -0700 Subject: [PATCH 41/74] Add CreatePixmap allocation hints. These hints allow an acceleration architecture to optimize allocation of certain types of pixmaps, such as pixmaps that will serve as backing pixmaps for redirected windows. --- GL/glx/glxcmds.c | 2 +- Xext/mbuf.c | 5 +++-- Xext/mbufpx.c | 5 +++-- Xext/shm.c | 5 +++-- afb/afb.h | 3 ++- afb/afbimage.c | 3 ++- afb/afbpixmap.c | 9 ++++++--- cfb/cfb.h | 3 ++- cfb/cfbbitblt.c | 3 ++- cfb/cfbpixmap.c | 5 +++-- composite/compalloc.c | 3 ++- dbe/midbe.c | 8 ++++---- dix/dispatch.c | 2 +- dix/gc.c | 4 ++-- dix/glyphcurs.c | 3 ++- dix/pixmap.c | 2 +- dix/window.c | 2 +- exa/exa.c | 7 ++++--- exa/exa_render.c | 2 +- fb/fb.h | 3 ++- fb/fboverlay.c | 2 +- fb/fbpixmap.c | 3 ++- fb/fbpseudocolor.c | 2 +- hw/dmx/dmxpixmap.c | 3 ++- hw/dmx/dmxpixmap.h | 3 ++- hw/kdrive/src/kaa.c | 2 +- hw/xfree86/common/xf86DGA.c | 2 +- hw/xfree86/rac/xf86RAC.c | 7 ++++--- hw/xfree86/xaa/xaaInit.c | 12 +++++++----- hw/xfree86/xf4bpp/ppcIO.c | 2 +- hw/xfree86/xf4bpp/ppcImg.c | 3 ++- hw/xfree86/xf4bpp/ppcPixmap.c | 5 +++-- hw/xfree86/xf4bpp/xf4bpp.h | 3 ++- hw/xfree86/xf8_32bpp/xf86overlay.c | 9 +++++---- hw/xgl/xgl.h | 3 ++- hw/xgl/xglglyph.c | 3 ++- hw/xgl/xglpict.c | 2 +- hw/xgl/xglpixmap.c | 3 ++- hw/xgl/xglscreen.c | 2 +- hw/xgl/xglshm.c | 3 ++- hw/xgl/xgltrap.c | 3 ++- hw/xgl/xglxv.c | 2 +- hw/xnest/Pixmap.c | 3 ++- hw/xnest/XNPixmap.h | 2 +- hw/xprint/pcl/PclArea.c | 3 ++- hw/xprint/pcl/PclGC.c | 3 ++- hw/xprint/ps/Ps.h | 2 +- hw/xprint/ps/PsPixmap.c | 3 ++- hw/xwin/win.h | 3 ++- hw/xwin/winpixmap.c | 6 +++--- include/scrnintstr.h | 10 +++++++++- mfb/mfb.h | 3 ++- mfb/mfbpixmap.c | 5 +++-- mi/miarc.c | 3 ++- mi/mibank.c | 2 +- mi/mibitblt.c | 6 ++++-- mi/midispcur.c | 11 ++++++----- mi/miglblt.c | 3 ++- mi/miscrinit.c | 2 +- miext/rootless/rootlessScreen.c | 2 +- miext/shadow/shadow.c | 2 +- render/glyph.c | 3 ++- render/mirect.c | 4 ++-- render/mitrap.c | 2 +- render/render.c | 6 ++++-- 65 files changed, 150 insertions(+), 97 deletions(-) diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c index 7d352ce36..21f3206c3 100644 --- a/GL/glx/glxcmds.c +++ b/GL/glx/glxcmds.c @@ -1252,7 +1252,7 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId, __glXenterServer(GL_FALSE); pPixmap = (*pGlxScreen->pScreen->CreatePixmap) (pGlxScreen->pScreen, - width, height, config->rgbBits); + width, height, config->rgbBits, 0); __glXleaveServer(GL_FALSE); return DoCreateGLXDrawable(client, pGlxScreen, config, &pPixmap->drawable, diff --git a/Xext/mbuf.c b/Xext/mbuf.c index ed352e21b..f9ff0858c 100644 --- a/Xext/mbuf.c +++ b/Xext/mbuf.c @@ -403,7 +403,7 @@ CreateImageBuffers (pWin, nbuf, ids, action, hint) pMultibuffer->pMultibuffers = pMultibuffers; if (!AddResource (ids[i], MultibufferResType, (pointer) pMultibuffer)) break; - pMultibuffer->pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, depth); + pMultibuffer->pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, depth, 0); if (!pMultibuffer->pPixmap) break; if (!AddResource (ids[i], MultibufferDrawableResType, (pointer) pMultibuffer->pPixmap)) @@ -1576,7 +1576,8 @@ MultibufferPositionWindow (pWin, x, y) { pMultibuffer = &pMultibuffers->buffers[i]; pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, - pWin->drawable.depth); + pWin->drawable.depth, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) { DestroyImageBuffers (pWin); diff --git a/Xext/mbufpx.c b/Xext/mbufpx.c index 16717d330..a04b97d9d 100644 --- a/Xext/mbufpx.c +++ b/Xext/mbufpx.c @@ -155,7 +155,7 @@ pixCreateImageBuffers (pWin, nbuf, ids, action, hint) { pMBBuffer = &pMBWindow->buffers[i]; pMBBuffer->pDrawable = (DrawablePtr) - (*pScreen->CreatePixmap) (pScreen, width, height, depth); + (*pScreen->CreatePixmap) (pScreen, width, height, depth, 0); if (!pMBBuffer->pDrawable) break; @@ -542,7 +542,8 @@ pixPositionWindow (pWin, x, y) for (i = 0; i < pMBWindow->numMultibuffer; i++) { pMBBuffer = &pMBWindow->buffers[i]; - pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pWin->drawable.depth); + pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pWin->drawable.depth, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) { (* MB_SCREEN_PRIV(pScreen)->DestroyImageBuffers)(pWin); diff --git a/Xext/shm.c b/Xext/shm.c index a688aa8d9..5937a0358 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -543,7 +543,8 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) putGC = GetScratchGC(depth, dst->pScreen); if (!putGC) return; - pmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth); + pmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pmap) { FreeScratchGC(putGC); @@ -1070,7 +1071,7 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr) { register PixmapPtr pPixmap; - pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth); + pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth, 0); if (!pPixmap) return NullPixmap; diff --git a/afb/afb.h b/afb/afb.h index 943c2c68a..769e4502f 100644 --- a/afb/afb.h +++ b/afb/afb.h @@ -483,7 +483,8 @@ extern PixmapPtr afbCreatePixmap( ScreenPtr /*pScreen*/, int /*width*/, int /*height*/, - int /*depth*/ + int /*depth*/, + unsigned /*usage_hint*/ ); extern Bool afbDestroyPixmap( diff --git a/afb/afbimage.c b/afb/afbimage.c index 81f49730a..890429fe6 100644 --- a/afb/afbimage.c +++ b/afb/afbimage.c @@ -72,7 +72,8 @@ afbPutImage(pDraw, pGC, depth, x, y, width, height, leftPad, format, pImage) int depthDst; /* Create a tmp pixmap */ - pPixmap = (pScreen->CreatePixmap)(pScreen, width, height, depth); + pPixmap = (pScreen->CreatePixmap)(pScreen, width, height, depth, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) return; diff --git a/afb/afbpixmap.c b/afb/afbpixmap.c index 77ba53513..b0ac80105 100644 --- a/afb/afbpixmap.c +++ b/afb/afbpixmap.c @@ -70,11 +70,12 @@ SOFTWARE. #include "mfb.h" PixmapPtr -afbCreatePixmap(pScreen, width, height, depth) +afbCreatePixmap(pScreen, width, height, depth, usage_hint) ScreenPtr pScreen; int width; int height; int depth; + unsigned usage_hint; { PixmapPtr pPixmap; size_t datasize; @@ -127,8 +128,10 @@ afbCopyPixmap(PixmapPtr pSrc) size = pSrc->drawable.height * pSrc->devKind * pSrc->drawable.depth; pScreen = pSrc->drawable.pScreen; - pDst = (*pScreen->CreatePixmap)(pScreen, pSrc->drawable.width, - pSrc->drawable.height, pSrc->drawable.depth); + pDst = (*pScreen->CreatePixmap)(pScreen, + pSrc->drawable.width, + pSrc->drawable.height, + pSrc->drawable.depth, 0); if (!pDst) return(NullPixmap); memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size); diff --git a/cfb/cfb.h b/cfb/cfb.h index c9ceda9e8..6e9001f3f 100644 --- a/cfb/cfb.h +++ b/cfb/cfb.h @@ -739,7 +739,8 @@ extern PixmapPtr cfbCreatePixmap( ScreenPtr /*pScreen*/, int /*width*/, int /*height*/, - int /*depth*/ + int /*depth*/, + unsigned /*usage_hint*/ ); extern Bool cfbDestroyPixmap( diff --git a/cfb/cfbbitblt.c b/cfb/cfbbitblt.c index faf49b92d..d86f9df11 100644 --- a/cfb/cfbbitblt.c +++ b/cfb/cfbbitblt.c @@ -1407,7 +1407,8 @@ RegionPtr cfbCopyPlane(pSrcDrawable, pDstDrawable, ScreenPtr pScreen = pSrcDrawable->pScreen; GCPtr pGC1; - pBitmap = (*pScreen->CreatePixmap) (pScreen, width, height, 1); + pBitmap = (*pScreen->CreatePixmap) (pScreen, width, height, 1, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pBitmap) return NULL; pGC1 = GetScratchGC (1, pScreen); diff --git a/cfb/cfbpixmap.c b/cfb/cfbpixmap.c index 6fdf3eae6..36ed5724d 100644 --- a/cfb/cfbpixmap.c +++ b/cfb/cfbpixmap.c @@ -65,11 +65,12 @@ SOFTWARE. #include "cfbmskbits.h" PixmapPtr -cfbCreatePixmap (pScreen, width, height, depth) +cfbCreatePixmap (pScreen, width, height, depth, usage_hint) ScreenPtr pScreen; int width; int height; int depth; + unsigned usage_hint; { PixmapPtr pPixmap; size_t datasize; @@ -122,7 +123,7 @@ cfbCopyPixmap(pSrc) size = pSrc->drawable.height * pSrc->devKind; pScreen = pSrc->drawable.pScreen; pDst = (*pScreen->CreatePixmap) (pScreen, pSrc->drawable.width, - pSrc->drawable.height, pSrc->drawable.depth); + pSrc->drawable.height, pSrc->drawable.depth, 0); if (!pDst) return NullPixmap; memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size); diff --git a/composite/compalloc.c b/composite/compalloc.c index 006e80840..dd5faa021 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -462,7 +462,8 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) WindowPtr pParent = pWin->parent; PixmapPtr pPixmap; - pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, pWin->drawable.depth); + pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, pWin->drawable.depth, + CREATE_PIXMAP_USAGE_BACKING_PIXMAP); if (!pPixmap) return 0; diff --git a/dbe/midbe.c b/dbe/midbe.c index 014e365ce..ac7ee62d4 100644 --- a/dbe/midbe.c +++ b/dbe/midbe.c @@ -177,7 +177,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction) if (!(pDbeWindowPrivPriv->pFrontBuffer = (*pScreen->CreatePixmap)(pScreen, pDbeWindowPriv->width, pDbeWindowPriv->height, - pWin->drawable.depth))) + pWin->drawable.depth, 0))) { return(BadAlloc); } @@ -186,7 +186,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction) if (!(pDbeWindowPrivPriv->pBackBuffer = (*pScreen->CreatePixmap)(pScreen, pDbeWindowPriv->width, pDbeWindowPriv->height, - pWin->drawable.depth))) + pWin->drawable.depth, 0))) { (*pScreen->DestroyPixmap)(pDbeWindowPrivPriv->pFrontBuffer); return(BadAlloc); @@ -648,10 +648,10 @@ miDbePositionWindow(WindowPtr pWin, int x, int y) /* Create DBE buffer pixmaps equal to size of resized window. */ pFrontBuffer = (*pScreen->CreatePixmap)(pScreen, width, height, - pWin->drawable.depth); + pWin->drawable.depth, 0); pBackBuffer = (*pScreen->CreatePixmap)(pScreen, width, height, - pWin->drawable.depth); + pWin->drawable.depth, 0); if (!pFrontBuffer || !pBackBuffer) { diff --git a/dix/dispatch.c b/dix/dispatch.c index c313796ab..eae0fa0c4 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -1554,7 +1554,7 @@ ProcCreatePixmap(ClientPtr client) CreatePmap: pMap = (PixmapPtr)(*pDraw->pScreen->CreatePixmap) (pDraw->pScreen, stuff->width, - stuff->height, stuff->depth); + stuff->height, stuff->depth, 0); if (pMap) { pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; diff --git a/dix/gc.c b/dix/gc.c index 7a76dd99d..5dbb6bf09 100644 --- a/dix/gc.c +++ b/dix/gc.c @@ -694,7 +694,7 @@ CreateDefaultTile (GCPtr pGC) (*pGC->pScreen->QueryBestSize)(TileShape, &w, &h, pGC->pScreen); pTile = (PixmapPtr) (*pGC->pScreen->CreatePixmap)(pGC->pScreen, - w, h, pGC->depth); + w, h, pGC->depth, 0); pgcScratch = GetScratchGC(pGC->depth, pGC->pScreen); if (!pTile || !pgcScratch) { @@ -1036,7 +1036,7 @@ CreateDefaultStipple(int screenNum) h = 16; (* pScreen->QueryBestSize)(StippleShape, &w, &h, pScreen); if (!(pScreen->PixmapPerDepth[0] = - (*pScreen->CreatePixmap)(pScreen, w, h, 1))) + (*pScreen->CreatePixmap)(pScreen, w, h, 1, 0))) return FALSE; /* fill stipple with 1 */ tmpval[0] = GXcopy; tmpval[1] = 1; tmpval[2] = FillSolid; diff --git a/dix/glyphcurs.c b/dix/glyphcurs.c index 70b1ff8f7..905b5fb13 100644 --- a/dix/glyphcurs.c +++ b/dix/glyphcurs.c @@ -98,7 +98,8 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm, unsigned cha bzero(pbits, nby); ppix = (PixmapPtr)(*pScreen->CreatePixmap)(pScreen, cm->width, - cm->height, 1); + cm->height, 1, + CREATE_PIXMAP_USAGE_SCRATCH); pGC = GetScratchGC(1, pScreen); if (!ppix || !pGC) { diff --git a/dix/pixmap.c b/dix/pixmap.c index c280a3b94..5b9a6a3aa 100644 --- a/dix/pixmap.c +++ b/dix/pixmap.c @@ -59,7 +59,7 @@ GetScratchPixmapHeader(ScreenPtr pScreen, int width, int height, int depth, pScreen->pScratchPixmap = NULL; else /* width and height of 0 means don't allocate any pixmap data */ - pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth); + pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0); if (pPixmap) { if ((*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, diff --git a/dix/window.c b/dix/window.c index 717c5a7ec..f65fb848f 100644 --- a/dix/window.c +++ b/dix/window.c @@ -312,7 +312,7 @@ MakeRootTile(WindowPtr pWin) int i, j; pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4, - pScreen->rootDepth); + pScreen->rootDepth, 0); pWin->backgroundState = BackgroundPixmap; pGC = GetScratchGC(pScreen->rootDepth, pScreen); diff --git a/exa/exa.c b/exa/exa.c index 6d6c0549f..1f85d8ef0 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -234,7 +234,8 @@ exaLog2(int val) * for scratch pixmaps, or to represent the visible screen. */ static PixmapPtr -exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth) +exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, + unsigned usage_hint) { PixmapPtr pPixmap; ExaPixmapPrivPtr pExaPixmap; @@ -246,10 +247,10 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth) return NullPixmap; if (!pExaScr->info->CreatePixmap) { - pPixmap = fbCreatePixmap (pScreen, w, h, depth); + pPixmap = fbCreatePixmap (pScreen, w, h, depth, usage_hint); } else { driver_alloc = 1; - pPixmap = fbCreatePixmap(pScreen, 0, 0, depth); + pPixmap = fbCreatePixmap(pScreen, 0, 0, depth, usage_hint); } if (!pPixmap) diff --git a/exa/exa_render.c b/exa/exa_render.c index 6a9e53f3e..a510e54f6 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -774,7 +774,7 @@ exaCreateAlphaPicture (ScreenPtr pScreen, } pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, - pPictFormat->depth); + pPictFormat->depth, 0); if (!pPixmap) return 0; pGC = GetScratchGC (pPixmap->drawable.depth, pScreen); diff --git a/fb/fb.h b/fb/fb.h index 379a00a34..380e2e118 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -1624,7 +1624,8 @@ PixmapPtr fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp); PixmapPtr -fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth); +fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth, + unsigned usage_hint); Bool fbDestroyPixmap (PixmapPtr pPixmap); diff --git a/fb/fboverlay.c b/fb/fboverlay.c index 0d1eb88eb..456c921a6 100644 --- a/fb/fboverlay.c +++ b/fb/fboverlay.c @@ -137,7 +137,7 @@ fbOverlayCreateScreenResources(ScreenPtr pScreen) pbits = pScrPriv->layer[i].u.init.pbits; width = pScrPriv->layer[i].u.init.width; depth = pScrPriv->layer[i].u.init.depth; - pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth); + pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0); if (!pPixmap) return FALSE; if (!(*pScreen->ModifyPixmapHeader)(pPixmap, pScreen->width, diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c index 88f693e73..cddab3ee3 100644 --- a/fb/fbpixmap.c +++ b/fb/fbpixmap.c @@ -80,7 +80,8 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp) } PixmapPtr -fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth) +fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth, + unsigned usage_hint) { int bpp; bpp = BitsPerPixel (depth); diff --git a/fb/fbpseudocolor.c b/fb/fbpseudocolor.c index 411bde1dc..a15697d43 100644 --- a/fb/fbpseudocolor.c +++ b/fb/fbpseudocolor.c @@ -275,7 +275,7 @@ xxCreateScreenResources(ScreenPtr pScreen) * (BitsPerPixel(depth) >> 3)); if (!pBits) return FALSE; - pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth); + pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0); if (!pPixmap) { xfree(pBits); return FALSE; diff --git a/hw/dmx/dmxpixmap.c b/hw/dmx/dmxpixmap.c index 40d2d8e56..acc08c38a 100644 --- a/hw/dmx/dmxpixmap.c +++ b/hw/dmx/dmxpixmap.c @@ -81,7 +81,8 @@ void dmxBECreatePixmap(PixmapPtr pPixmap) /** Create a pixmap for \a pScreen with the specified \a width, \a * height, and \a depth. */ -PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth) +PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, + unsigned usage_hint) { DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; PixmapPtr pPixmap; diff --git a/hw/dmx/dmxpixmap.h b/hw/dmx/dmxpixmap.h index 4ecd10fd8..5cca7f44a 100644 --- a/hw/dmx/dmxpixmap.h +++ b/hw/dmx/dmxpixmap.h @@ -49,7 +49,8 @@ typedef struct _dmxPixPriv { extern Bool dmxInitPixmap(ScreenPtr pScreen); extern PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, - int width, int height, int depth); + int width, int height, int depth, + unsigned usage_hint); extern Bool dmxDestroyPixmap(PixmapPtr pPixmap); extern RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap); diff --git a/hw/kdrive/src/kaa.c b/hw/kdrive/src/kaa.c index 7ee6c0bcf..9cf9bf201 100644 --- a/hw/kdrive/src/kaa.c +++ b/hw/kdrive/src/kaa.c @@ -294,7 +294,7 @@ kaaDestroyPixmap (PixmapPtr pPixmap) } static PixmapPtr -kaaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth) +kaaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) { PixmapPtr pPixmap; KaaPixmapPrivPtr pKaaPixmap; diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c index 9474ec8e0..85d4b2ea0 100644 --- a/hw/xfree86/common/xf86DGA.c +++ b/hw/xfree86/common/xf86DGA.c @@ -432,7 +432,7 @@ xf86SetDGAMode( } if(pMode->flags & DGA_PIXMAP_AVAILABLE) { - if((pPix = (*pScreen->CreatePixmap)(pScreen, 0, 0, pMode->depth))) { + if((pPix = (*pScreen->CreatePixmap)(pScreen, 0, 0, pMode->depth, 0))) { (*pScreen->ModifyPixmapHeader)(pPix, pMode->pixmapWidth, pMode->pixmapHeight, pMode->depth, pMode->bitsPerPixel, diff --git a/hw/xfree86/rac/xf86RAC.c b/hw/xfree86/rac/xf86RAC.c index 9d2812c49..0d41599b1 100644 --- a/hw/xfree86/rac/xf86RAC.c +++ b/hw/xfree86/rac/xf86RAC.c @@ -141,7 +141,8 @@ static void RACCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc ); static void RACClearToBackground (WindowPtr pWin, int x, int y, int w, int h, Bool generateExposures ); -static PixmapPtr RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth); +static PixmapPtr RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, + unsigned usage_hint); static Bool RACCreateGC(GCPtr pGC); static Bool RACSaveScreen(ScreenPtr pScreen, Bool unblank); static void RACStoreColors (ColormapPtr pmap, int ndef, xColorItem *pdefs); @@ -450,14 +451,14 @@ RACClearToBackground ( } static PixmapPtr -RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth) +RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) { PixmapPtr pPix; DPRINT_S("RACCreatePixmap",pScreen->myNum); SCREEN_PROLOG ( CreatePixmap); ENABLE; - pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth); + pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint); SCREEN_EPILOG (CreatePixmap, RACCreatePixmap); return pPix; diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c index 422242513..196569278 100644 --- a/hw/xfree86/xaa/xaaInit.c +++ b/hw/xfree86/xaa/xaaInit.c @@ -30,7 +30,8 @@ static void XAAGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, char *pdstLine); static void XAAGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart); -static PixmapPtr XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth); +static PixmapPtr XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, + unsigned usage_hint); static Bool XAADestroyPixmap(PixmapPtr pPixmap); static Bool XAAEnterVT (int index, int flags); static void XAALeaveVT (int index, int flags); @@ -306,7 +307,8 @@ XAAPixmapBPP (ScreenPtr pScreen, int depth) DestroyPixmapProcPtr destroyPixmap; XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap); - pPix = (*pScreen->CreatePixmap) (pScreen, 1, 1, depth); + pPix = (*pScreen->CreatePixmap) (pScreen, 1, 1, depth, + CREATE_PIXMAP_USAGE_SCRATCH); XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap); if (!pPix) return 0; @@ -337,7 +339,7 @@ XAAInitializeOffscreenDepths (ScreenPtr pScreen) } static PixmapPtr -XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth) +XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) { XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; @@ -383,7 +385,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth) } XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap); - pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth); + pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, usage_hint); XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap); if (!pPix) { @@ -415,7 +417,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth) } BAILOUT: XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap); - pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth); + pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint); XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap); if(pPix) { diff --git a/hw/xfree86/xf4bpp/ppcIO.c b/hw/xfree86/xf4bpp/ppcIO.c index 313fcb0f8..83952d12d 100644 --- a/hw/xfree86/xf4bpp/ppcIO.c +++ b/hw/xfree86/xf4bpp/ppcIO.c @@ -146,7 +146,7 @@ v16CreateScreenResources /* create a pixmap with no data, then redirect it to point to * the screen */ - pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth); + pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth, 0); if (!pPixmap) return FALSE; diff --git a/hw/xfree86/xf4bpp/ppcImg.c b/hw/xfree86/xf4bpp/ppcImg.c index 3691587ae..39d39c4a9 100644 --- a/hw/xfree86/xf4bpp/ppcImg.c +++ b/hw/xfree86/xf4bpp/ppcImg.c @@ -79,7 +79,8 @@ xf4bppGetImage( pDraw, sx, sy, w, h, format, planeMask, pdstLine ) != (unsigned)( 1 << pDraw->depth ) - 1 ) { pGC = GetScratchGC( depth, pDraw->pScreen ) ; pPixmap = (PixmapPtr) - (* pDraw->pScreen->CreatePixmap)( pDraw->pScreen, w, h, depth ) ; + (* pDraw->pScreen->CreatePixmap)( pDraw->pScreen, w, h, depth, + CREATE_PIXMAP_USAGE_SCRATCH) ; gcv[0] = GXcopy ; gcv[1] = planeMask ; DoChangeGC( pGC, GCPlaneMask | GCFunction, gcv, 0 ) ; diff --git a/hw/xfree86/xf4bpp/ppcPixmap.c b/hw/xfree86/xf4bpp/ppcPixmap.c index ec181cfaf..241217bf4 100644 --- a/hw/xfree86/xf4bpp/ppcPixmap.c +++ b/hw/xfree86/xf4bpp/ppcPixmap.c @@ -82,16 +82,17 @@ SOFTWARE. #include "scrnintstr.h" PixmapPtr -xf4bppCreatePixmap( pScreen, width, height, depth ) +xf4bppCreatePixmap( pScreen, width, height, depth, usage_hint ) ScreenPtr pScreen ; int width ; int height ; int depth ; + unsigned usage_hint ; { register PixmapPtr pPixmap = (PixmapPtr)NULL; size_t size ; - TRACE(("xf4bppCreatePixmap(pScreen=0x%x, width=%d, height=%d, depth=%d)\n", pScreen, width, height, depth)) ; + TRACE(("xf4bppCreatePixmap(pScreen=0x%x, width=%d, height=%d, depth=%d, usage_hint=%d)\n", pScreen, width, height, depth, usage_hint)) ; if ( depth > 8 ) return (PixmapPtr) NULL ; diff --git a/hw/xfree86/xf4bpp/xf4bpp.h b/hw/xfree86/xf4bpp/xf4bpp.h index e7e3721f7..cf0822444 100644 --- a/hw/xfree86/xf4bpp/xf4bpp.h +++ b/hw/xfree86/xf4bpp/xf4bpp.h @@ -183,7 +183,8 @@ PixmapPtr xf4bppCreatePixmap( ScreenPtr, int, int, - int + int, + unsigned ); PixmapPtr xf4bppCopyPixmap( PixmapPtr diff --git a/hw/xfree86/xf8_32bpp/xf86overlay.c b/hw/xfree86/xf8_32bpp/xf86overlay.c index 3cd351ad0..47b2b52db 100644 --- a/hw/xfree86/xf8_32bpp/xf86overlay.c +++ b/hw/xfree86/xf8_32bpp/xf86overlay.c @@ -32,7 +32,7 @@ static Bool OverlayCloseScreen (int, ScreenPtr); static Bool OverlayCreateGC(GCPtr pGC); static Bool OverlayDestroyPixmap(PixmapPtr); -static PixmapPtr OverlayCreatePixmap(ScreenPtr, int, int, int); +static PixmapPtr OverlayCreatePixmap(ScreenPtr, int, int, int, unsigned); static Bool OverlayChangeWindowAttributes(WindowPtr, unsigned long); /** Funcs **/ @@ -339,13 +339,14 @@ OverlayCreateGC(GCPtr pGC) } static PixmapPtr -OverlayCreatePixmap(ScreenPtr pScreen, int w, int h, int depth) +OverlayCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, + unsigned usage_hint) { OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen); PixmapPtr pPix; pScreen->CreatePixmap = pScreenPriv->CreatePixmap; - pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth); + pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint); pScreen->CreatePixmap = OverlayCreatePixmap; /* We initialize all the privates */ @@ -439,7 +440,7 @@ OverlayRefreshPixmap(PixmapPtr pix8) PixmapPtr newPix; newPix = (*pScreen->CreatePixmap)(pScreen, pix8->drawable.width, - pix8->drawable.height, 24); + pix8->drawable.height, 24, 0); newPix->drawable.depth = 8; /* Bad Mark! Bad Mark! */ pixPriv->pix32 = newPix; } diff --git a/hw/xgl/xgl.h b/hw/xgl/xgl.h index 7bca1d53e..80fa69577 100644 --- a/hw/xgl/xgl.h +++ b/hw/xgl/xgl.h @@ -870,7 +870,8 @@ PixmapPtr xglCreatePixmap (ScreenPtr pScreen, int width, int height, - int depth); + int depth, + unsigned usage_hint); void xglFiniPixmap (PixmapPtr pPixmap); diff --git a/hw/xgl/xglglyph.c b/hw/xgl/xglglyph.c index 7a601889c..c1a484ac0 100644 --- a/hw/xgl/xglglyph.c +++ b/hw/xgl/xglglyph.c @@ -1075,7 +1075,8 @@ xglGlyphs (CARD8 op, pPixmap = (*pScreen->CreatePixmap) (pScreen, rect.width, rect.height, - maskFormat->depth); + maskFormat->depth, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) return; diff --git a/hw/xgl/xglpict.c b/hw/xgl/xglpict.c index 932d31a33..fee2431b7 100644 --- a/hw/xgl/xglpict.c +++ b/hw/xgl/xglpict.c @@ -494,7 +494,7 @@ xglSyncPicture (ScreenPtr pScreen, return FALSE; pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, - pFormat->depth); + pFormat->depth, 0); if (!pPixmap) return FALSE; diff --git a/hw/xgl/xglpixmap.c b/hw/xgl/xglpixmap.c index 368c3eaeb..8c54d64fc 100644 --- a/hw/xgl/xglpixmap.c +++ b/hw/xgl/xglpixmap.c @@ -222,7 +222,8 @@ PixmapPtr xglCreatePixmap (ScreenPtr pScreen, int width, int height, - int depth) + int depth, + unsigned usage_hint) { xglPixmapPtr pPixmapPriv; PixmapPtr pPixmap; diff --git a/hw/xgl/xglscreen.c b/hw/xgl/xglscreen.c index 9b7297b91..cd3b59a34 100644 --- a/hw/xgl/xglscreen.c +++ b/hw/xgl/xglscreen.c @@ -447,7 +447,7 @@ xglCreateSolidAlphaPicture (ScreenPtr pScreen) if (!pGC) return; - pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, pFormat->depth); + pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, pFormat->depth, 0); if (!pPixmap) return; diff --git a/hw/xgl/xglshm.c b/hw/xgl/xglshm.c index 52a8aabb8..567daa954 100644 --- a/hw/xgl/xglshm.c +++ b/hw/xgl/xglshm.c @@ -64,7 +64,8 @@ xglShmPutImage (DrawablePtr pDrawable, } else { - pPixmap = (*pScreen->CreatePixmap) (pScreen, sw, sh, depth); + pPixmap = (*pScreen->CreatePixmap) (pScreen, sw, sh, depth, + CREATE_PIXMAP_USAGE_SCRATCH); if (pPixmap) { GCPtr pScratchGC; diff --git a/hw/xgl/xgltrap.c b/hw/xgl/xgltrap.c index 26e2bc451..6e7a5082c 100644 --- a/hw/xgl/xgltrap.c +++ b/hw/xgl/xgltrap.c @@ -194,7 +194,8 @@ xglTrapezoids (CARD8 op, pPixmap = (*pScreen->CreatePixmap) (pScreen, rect.width, rect.height, - maskFormat->depth); + maskFormat->depth, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) return; diff --git a/hw/xgl/xglxv.c b/hw/xgl/xglxv.c index aaa66c738..8138a0cbb 100644 --- a/hw/xgl/xglxv.c +++ b/hw/xgl/xglxv.c @@ -290,7 +290,7 @@ xglXvPutImage (ClientPtr client, if (!pPortPriv->pPixmap) { - pPortPriv->pPixmap = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth); + pPortPriv->pPixmap = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, 0); if (!pPortPriv->pPixmap) return BadAlloc; } diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c index 612df8dac..1f420015a 100644 --- a/hw/xnest/Pixmap.c +++ b/hw/xnest/Pixmap.c @@ -35,7 +35,8 @@ is" without express or implied warranty. int xnestPixmapPrivateIndex; PixmapPtr -xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth) +xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, + unsigned usage_hint) { PixmapPtr pPixmap; diff --git a/hw/xnest/XNPixmap.h b/hw/xnest/XNPixmap.h index 6971b1162..9eb2a3c70 100644 --- a/hw/xnest/XNPixmap.h +++ b/hw/xnest/XNPixmap.h @@ -29,7 +29,7 @@ typedef struct { #define xnestSharePixmap(pPixmap) ((pPixmap)->refcnt++) PixmapPtr xnestCreatePixmap(ScreenPtr pScreen, int width, int height, - int depth); + int depth, unsigned usage_hint); Bool xnestDestroyPixmap(PixmapPtr pPixmap); RegionPtr xnestPixmapToRegion(PixmapPtr pPixmap); diff --git a/hw/xprint/pcl/PclArea.c b/hw/xprint/pcl/PclArea.c index 59ae5e3cc..a4e53dad6 100644 --- a/hw/xprint/pcl/PclArea.c +++ b/hw/xprint/pcl/PclArea.c @@ -415,7 +415,8 @@ PclCopyPlane(DrawablePtr pSrc, * know how to do a CopyArea. */ scratchPix = (*pDst->pScreen->CreatePixmap)( pDst->pScreen, width, - height, pDst->depth ); + height, pDst->depth, + CREATE_PIXMAP_USAGE_SCRATCH ); scratchGC = GetScratchGC( pDst->depth, pDst->pScreen ); CopyGC( pGC, scratchGC, ~0L ); diff --git a/hw/xprint/pcl/PclGC.c b/hw/xprint/pcl/PclGC.c index ba82c566a..b47f2833a 100644 --- a/hw/xprint/pcl/PclGC.c +++ b/hw/xprint/pcl/PclGC.c @@ -709,7 +709,8 @@ PclUpdateDrawableGC( scratchPix = (*pGC->pScreen->CreatePixmap)( pGC->pScreen, - w, h, pGC->depth ); + w, h, pGC->depth, + CREATE_PIXMAP_USAGE_SCRATCH ); scratchGC = GetScratchGC( pGC->depth, pGC->pScreen ); CopyGC( pGC, scratchGC, ~0L ); diff --git a/hw/xprint/ps/Ps.h b/hw/xprint/ps/Ps.h index 25bd5333b..5e77d9a0a 100644 --- a/hw/xprint/ps/Ps.h +++ b/hw/xprint/ps/Ps.h @@ -574,7 +574,7 @@ extern void PsSetFillColor(DrawablePtr pDrawable, GCPtr pGC, PsOutPtr psOut, */ extern PixmapPtr PsCreatePixmap(ScreenPtr pScreen, int width, int height, - int depth); + int depth, unsigned usage_hint); extern void PsScrubPixmap(PixmapPtr pPixmap); extern Bool PsDestroyPixmap(PixmapPtr pPixmap); extern DisplayListPtr PsGetFreeDisplayBlock(PsPixmapPrivPtr priv); diff --git a/hw/xprint/ps/PsPixmap.c b/hw/xprint/ps/PsPixmap.c index c3259c98c..d3ab198f8 100644 --- a/hw/xprint/ps/PsPixmap.c +++ b/hw/xprint/ps/PsPixmap.c @@ -91,7 +91,8 @@ PsCreatePixmap( ScreenPtr pScreen, int width, int height, - int depth) + int depth, + unsigned usage_hint) { PixmapPtr pPixmap; diff --git a/hw/xwin/win.h b/hw/xwin/win.h index d3be39b73..754666090 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -1036,7 +1036,8 @@ winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen); */ PixmapPtr -winCreatePixmapNativeGDI (ScreenPtr pScreen, int width, int height, int depth); +winCreatePixmapNativeGDI (ScreenPtr pScreen, int width, int height, int depth, + unsigned usage_hint); Bool winDestroyPixmapNativeGDI (PixmapPtr pPixmap); diff --git a/hw/xwin/winpixmap.c b/hw/xwin/winpixmap.c index baff60c92..994eeb89a 100644 --- a/hw/xwin/winpixmap.c +++ b/hw/xwin/winpixmap.c @@ -64,7 +64,7 @@ winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix, PixmapPtr winCreatePixmapNativeGDI (ScreenPtr pScreen, int iWidth, int iHeight, - int iDepth) + int iDepth, unsigned usage_hint) { winPrivPixmapPtr pPixmapPriv = NULL; PixmapPtr pPixmap = NULL; @@ -78,8 +78,8 @@ winCreatePixmapNativeGDI (ScreenPtr pScreen, } #if CYGDEBUG - winDebug ("winCreatePixmap () - w %d h %d d %d bw %d\n", - iWidth, iHeight, iDepth, + winDebug ("winCreatePixmap () - w %d h %d d %d uh %d bw %d\n", + iWidth, iHeight, iDepth, usage_hint, PixmapBytePad (iWidth, iDepth)); #endif diff --git a/include/scrnintstr.h b/include/scrnintstr.h index bcec02e39..383ee80e1 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -197,11 +197,19 @@ typedef void (* ClipNotifyProcPtr)( int /*dx*/, int /*dy*/); +/* pixmap will exist only for the duration of the current rendering operation */ +#define CREATE_PIXMAP_USAGE_SCRATCH 1 +/* pixmap will be the backing pixmap for a redirected window */ +#define CREATE_PIXMAP_USAGE_BACKING_PIXMAP 2 +/* pixmap will contain a glyph */ +#define CREATE_PIMXAP_USAGE_GLYPH_PICTURE 3 + typedef PixmapPtr (* CreatePixmapProcPtr)( ScreenPtr /*pScreen*/, int /*width*/, int /*height*/, - int /*depth*/); + int /*depth*/, + unsigned /*usage_hint*/); typedef Bool (* DestroyPixmapProcPtr)( PixmapPtr /*pPixmap*/); diff --git a/mfb/mfb.h b/mfb/mfb.h index 69d2d6978..c24b54024 100644 --- a/mfb/mfb.h +++ b/mfb/mfb.h @@ -587,7 +587,8 @@ extern PixmapPtr mfbCreatePixmap( ScreenPtr /*pScreen*/, int /*width*/, int /*height*/, - int /*depth*/ + int /*depth*/, + unsigned /*usage_hint*/ ); extern Bool mfbDestroyPixmap( diff --git a/mfb/mfbpixmap.c b/mfb/mfbpixmap.c index e34972451..1472b44e2 100644 --- a/mfb/mfbpixmap.c +++ b/mfb/mfbpixmap.c @@ -69,11 +69,12 @@ SOFTWARE. PixmapPtr -mfbCreatePixmap (pScreen, width, height, depth) +mfbCreatePixmap (pScreen, width, height, depth, usage_hint) ScreenPtr pScreen; int width; int height; int depth; + unsigned usage_hint; { PixmapPtr pPixmap; size_t datasize; @@ -129,7 +130,7 @@ mfbCopyPixmap(pSrc) size = pSrc->drawable.height * pSrc->devKind; pScreen = pSrc->drawable.pScreen; pDst = (*pScreen->CreatePixmap) (pScreen, pSrc->drawable.width, - pSrc->drawable.height, pSrc->drawable.depth); + pSrc->drawable.height, pSrc->drawable.depth, 0); if (!pDst) return NullPixmap; memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size); diff --git a/mi/miarc.c b/mi/miarc.c index 3b77ce74a..70888155e 100644 --- a/mi/miarc.c +++ b/mi/miarc.c @@ -1155,7 +1155,8 @@ miPolyArc(pDraw, pGC, narcs, parcs) /* allocate a 1 bit deep pixmap of the appropriate size, and * validate it */ pDrawTo = (DrawablePtr)(*pDraw->pScreen->CreatePixmap) - (pDraw->pScreen, pixmapWidth, pixmapHeight, 1); + (pDraw->pScreen, pixmapWidth, pixmapHeight, 1, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pDrawTo) { FreeScratchGC(pGCTo); diff --git a/mi/mibank.c b/mi/mibank.c index 3492f1e0e..d693f2668 100644 --- a/mi/mibank.c +++ b/mi/mibank.c @@ -1605,7 +1605,7 @@ miBankCreateScreenResources( /* Get shadow pixmap; width & height of 0 means no pixmap data */ pScreenPriv->pBankPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, - pScreenPriv->pScreenPixmap->drawable.depth); + pScreenPriv->pScreenPixmap->drawable.depth, 0); if (!pScreenPriv->pBankPixmap) retval = FALSE; } diff --git a/mi/mibitblt.c b/mi/mibitblt.c index e61855a93..1ddccdda1 100644 --- a/mi/mibitblt.c +++ b/mi/mibitblt.c @@ -416,7 +416,8 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc, RegionPtr prgnSrcClip; pPixmap = (*pDraw->pScreen->CreatePixmap) - (pDraw->pScreen, w + srcx, h, 1); + (pDraw->pScreen, w + srcx, h, 1, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) return; @@ -667,7 +668,8 @@ miGetImage(pDraw, sx, sy, w, h, format, planeMask, pDst) if (!pGC) return; pPixmap = (*pDraw->pScreen->CreatePixmap) - (pDraw->pScreen, w, 1, depth); + (pDraw->pScreen, w, 1, depth, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) { FreeScratchGC(pGC); diff --git a/mi/midispcur.c b/mi/midispcur.c index 802fc6c27..7b203f71f 100644 --- a/mi/midispcur.c +++ b/mi/midispcur.c @@ -270,7 +270,8 @@ miDCRealize ( pPriv->sourceBits = 0; pPriv->maskBits = 0; pPixmap = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, - pCursor->bits->height, 32); + pCursor->bits->height, 32, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) { xfree ((pointer) pPriv); @@ -302,13 +303,13 @@ miDCRealize ( } pPriv->pPicture = 0; #endif - pPriv->sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1); + pPriv->sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1, 0); if (!pPriv->sourceBits) { xfree ((pointer) pPriv); return (miDCCursorPtr)NULL; } - pPriv->maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1); + pPriv->maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1, 0); if (!pPriv->maskBits) { (*pScreen->DestroyPixmap) (pPriv->sourceBits); @@ -527,7 +528,7 @@ miDCSaveUnderCursor (pScreen, x, y, w, h) if (pSave) (*pScreen->DestroyPixmap) (pSave); pScreenPriv->pSave = pSave = - (*pScreen->CreatePixmap) (pScreen, w, h, pScreen->rootDepth); + (*pScreen->CreatePixmap) (pScreen, w, h, pScreen->rootDepth, 0); if (!pSave) return FALSE; } @@ -737,7 +738,7 @@ miDCMoveCursor (pScreen, pCursor, x, y, w, h, dx, dy, source, mask) } #endif pScreenPriv->pTemp = pTemp = (*pScreen->CreatePixmap) - (pScreen, w, h, pScreenPriv->pSave->drawable.depth); + (pScreen, w, h, pScreenPriv->pSave->drawable.depth, 0); if (!pTemp) return FALSE; } diff --git a/mi/miglblt.c b/mi/miglblt.c index 4db3eb62f..c9ae02db7 100644 --- a/mi/miglblt.c +++ b/mi/miglblt.c @@ -120,7 +120,8 @@ miPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) FONTMAXBOUNDS(pfont,descent); pPixmap = (*pDrawable->pScreen->CreatePixmap)(pDrawable->pScreen, - width, height, 1); + width, height, 1, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) return; diff --git a/mi/miscrinit.c b/mi/miscrinit.c index d88eb7118..7a9014aa8 100644 --- a/mi/miscrinit.c +++ b/mi/miscrinit.c @@ -158,7 +158,7 @@ miCreateScreenResources(pScreen) /* create a pixmap with no data, then redirect it to point to * the screen */ - pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth); + pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth, 0); if (!pPixmap) return FALSE; diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index 0bcd2f7f1..489d3fb23 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -84,7 +84,7 @@ RootlessUpdateScreenPixmap(ScreenPtr pScreen) pPix = (*pScreen->GetScreenPixmap)(pScreen); if (pPix == NULL) { - pPix = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth); + pPix = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth, 0); (*pScreen->SetScreenPixmap)(pPix); } diff --git a/miext/shadow/shadow.c b/miext/shadow/shadow.c index f624216db..8aa192f62 100644 --- a/miext/shadow/shadow.c +++ b/miext/shadow/shadow.c @@ -240,7 +240,7 @@ shadowInit(ScreenPtr pScreen, ShadowUpdateProc update, ShadowWindowProc window) PixmapPtr pPixmap; pPixmap = pScreen->CreatePixmap(pScreen, pScreen->width, pScreen->height, - pScreen->rootDepth); + pScreen->rootDepth, 0); if (!pPixmap) return FALSE; diff --git a/render/glyph.c b/render/glyph.c index f3e3917b1..e1dc0bc99 100644 --- a/render/glyph.c +++ b/render/glyph.c @@ -969,7 +969,8 @@ miGlyphs (CARD8 op, width = extents.x2 - extents.x1; height = extents.y2 - extents.y1; pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, - maskFormat->depth); + maskFormat->depth, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pMaskPixmap) return; component_alpha = NeedsComponent(maskFormat->format); diff --git a/render/mirect.c b/render/mirect.c index 87767a76c..464df51c1 100644 --- a/render/mirect.c +++ b/render/mirect.c @@ -135,8 +135,8 @@ miCompositeRects (CARD8 op, if (!rgbaFormat) goto bail1; - pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, - rgbaFormat->depth); + pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, rgbaFormat->depth, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) goto bail2; diff --git a/render/mitrap.c b/render/mitrap.c index c6188061c..8bdc8a8d0 100644 --- a/render/mitrap.c +++ b/render/mitrap.c @@ -61,7 +61,7 @@ miCreateAlphaPicture (ScreenPtr pScreen, } pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, - pPictFormat->depth); + pPictFormat->depth, 0); if (!pPixmap) return 0; pGC = GetScratchGC (pPixmap->drawable.depth, pScreen); diff --git a/render/render.c b/render/render.c index 1a1cd7a0e..b0707539f 100644 --- a/render/render.c +++ b/render/render.c @@ -1202,7 +1202,8 @@ ProcRenderAddGlyphs (ClientPtr client) } pDstPix = (pScreen->CreatePixmap) (pScreen, - width, height, depth); + width, height, depth, + CREATE_PIMXAP_USAGE_GLYPH_PICTURE); GlyphPicture (glyph)[screen] = pDst = CreatePicture (0, &pDstPix->drawable, @@ -1636,7 +1637,8 @@ ProcRenderCreateCursor (ClientPtr client) xfree (mskbits); return (BadImplementation); } - pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32); + pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) { xfree (argbbits); From 27ecb89250398f45564fe454e20bfdd66f62c8e4 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Sun, 4 Nov 2007 18:53:41 -0800 Subject: [PATCH 42/74] Removed CVS tags. --- hw/darwin/XDarwin.man | 2 -- hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp | 2 -- hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp | 1 - hw/darwin/bundle/English.lproj/Localizable.strings | 1 - hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp | 2 -- hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp | 2 -- hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp | 2 -- hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp | 2 -- hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp | 2 -- hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp | 2 -- hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp | 2 -- hw/darwin/bundle/startXClients.cpp | 2 -- hw/darwin/darwin.c | 2 -- hw/darwin/quartz/Preferences.m | 1 - hw/darwin/quartz/XApplication.m | 3 +-- hw/darwin/quartz/cr/XView.m | 1 - hw/darwin/quartz/cr/crAppleWM.m | 4 +--- hw/darwin/quartz/cr/crScreen.m | 5 +---- hw/darwin/quartz/quartzCocoa.m | 5 +---- 19 files changed, 4 insertions(+), 39 deletions(-) diff --git a/hw/darwin/XDarwin.man b/hw/darwin/XDarwin.man index eb1b9dcb8..6fc9aec0f 100644 --- a/hw/darwin/XDarwin.man +++ b/hw/darwin/XDarwin.man @@ -1,5 +1,3 @@ -.\" $XFree86: xc/programs/Xserver/hw/darwin/XDarwin.man,v 1.3 2001/09/23 23:02:37 torrey Exp $ -.\" .TH XDARWIN 1 __vendorversion__ .SH NAME XDarwin \- X window system server for Darwin operating system diff --git a/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp index 1113b8ae6..4b8e6f5cb 100644 --- a/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp +++ b/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp @@ -1,5 +1,3 @@ - - XDarwin Help diff --git a/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp b/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp index aeb210342..268b80091 100644 --- a/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp +++ b/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp @@ -1,5 +1,4 @@ /* English versions of the Info.plist keys; used by most localizations. */ /* Most of these are set in the target application settings. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp,v 1.3 2002/07/17 01:24:55 torrey Exp $ */ NSHumanReadableCopyright = __quote__ X_VENDOR_NAME X_VERSION __quote__; diff --git a/hw/darwin/bundle/English.lproj/Localizable.strings b/hw/darwin/bundle/English.lproj/Localizable.strings index 2c25c1dc3..6f6487902 100644 --- a/hw/darwin/bundle/English.lproj/Localizable.strings +++ b/hw/darwin/bundle/English.lproj/Localizable.strings @@ -1,5 +1,4 @@ /* English localized versions of strings used by the Mac OS X front end. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings,v 1.3 2002/01/30 06:50:46 torrey Exp $ */ /* Title of alert panel */ "Quit X server?" = "Quit X server?"; diff --git a/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp index 5996285ae..db33670d9 100644 --- a/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp +++ b/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp @@ -1,5 +1,3 @@ - - XDarwin Help diff --git a/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp index 2a14793db..512416b1b 100644 --- a/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp +++ b/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp @@ -1,5 +1,3 @@ - - XDarwin Help diff --git a/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp index 5996285ae..db33670d9 100644 --- a/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp +++ b/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp @@ -1,5 +1,3 @@ - - XDarwin Help diff --git a/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp index 7ef1ba5d8..6800171d9 100644 --- a/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp +++ b/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp @@ -1,5 +1,3 @@ - - XDarwin Help diff --git a/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp index 5cd27862d..a79e6f95f 100644 --- a/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp +++ b/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp @@ -1,5 +1,3 @@ - - XDarwin Ayuda diff --git a/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp index 4210878c0..ab940ec3d 100644 --- a/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp +++ b/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp @@ -1,5 +1,3 @@ - - XDarwin Help diff --git a/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp index 5996285ae..db33670d9 100644 --- a/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp +++ b/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp @@ -1,5 +1,3 @@ - - XDarwin Help diff --git a/hw/darwin/bundle/startXClients.cpp b/hw/darwin/bundle/startXClients.cpp index 51cdb5c9e..f812dbfd8 100644 --- a/hw/darwin/bundle/startXClients.cpp +++ b/hw/darwin/bundle/startXClients.cpp @@ -2,8 +2,6 @@ XCOMM!/bin/sh XCOMM This script is used by XDarwin to start X clients when XDarwin is XCOMM launched from the Finder. -XCOMM -XCOMM $XFree86: $ userclientrc=$HOME/.xinitrc sysclientrc=XINITDIR/xinitrc diff --git a/hw/darwin/darwin.c b/hw/darwin/darwin.c index 1c18cd2ac..c32cd5461 100644 --- a/hw/darwin/darwin.c +++ b/hw/darwin/darwin.c @@ -3,8 +3,6 @@ * Shared code for the Darwin X Server * running with Quartz or IOKit display mode * - **************************************************************/ -/* * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. * Copyright (c) 2007 Apple Inc. * diff --git a/hw/darwin/quartz/Preferences.m b/hw/darwin/quartz/Preferences.m index 6fca3b655..0425392ae 100644 --- a/hw/darwin/quartz/Preferences.m +++ b/hw/darwin/quartz/Preferences.m @@ -30,7 +30,6 @@ * sale, use or other dealings in this Software without prior written * authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.m,v 1.5 2004/06/08 22:58:10 torrey Exp $ */ #include diff --git a/hw/darwin/quartz/XApplication.m b/hw/darwin/quartz/XApplication.m index e0ee8d9c6..c18d9a570 100644 --- a/hw/darwin/quartz/XApplication.m +++ b/hw/darwin/quartz/XApplication.m @@ -2,7 +2,7 @@ // XApplication.m // // Created by Andreas Monitzer on January 6, 2001. -// + /* * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved. * @@ -30,7 +30,6 @@ * sale, use or other dealings in this Software without prior written * authorization. */ -/* $XFree86: $ */ #import "XApplication.h" diff --git a/hw/darwin/quartz/cr/XView.m b/hw/darwin/quartz/cr/XView.m index 0cea250bb..8379f9476 100644 --- a/hw/darwin/quartz/cr/XView.m +++ b/hw/darwin/quartz/cr/XView.m @@ -29,7 +29,6 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/XView.m,v 1.1 2003/06/07 05:49:07 torrey Exp $ */ #include diff --git a/hw/darwin/quartz/cr/crAppleWM.m b/hw/darwin/quartz/cr/crAppleWM.m index a583581dc..a0259c3f8 100644 --- a/hw/darwin/quartz/cr/crAppleWM.m +++ b/hw/darwin/quartz/cr/crAppleWM.m @@ -1,7 +1,6 @@ /* * Cocoa rootless implementation functions for AppleWM extension - */ -/* + * * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -26,7 +25,6 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.2 2003/06/30 01:45:13 torrey Exp $ */ #include diff --git a/hw/darwin/quartz/cr/crScreen.m b/hw/darwin/quartz/cr/crScreen.m index 8c0966578..504e7b37a 100644 --- a/hw/darwin/quartz/cr/crScreen.m +++ b/hw/darwin/quartz/cr/crScreen.m @@ -1,8 +1,6 @@ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m,v 1.4 2004/08/12 20:24:36 torrey Exp $ */ /* * Cocoa rootless implementation initialization - */ -/* + * * Copyright (c) 2001 Greg Parker. All Rights Reserved. * Copyright (c) 2002-2004 Torrey T. Lyons. All Rights Reserved. * @@ -28,7 +26,6 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m,v 1.5 2003/11/12 20:21:52 torrey Exp $ */ #include diff --git a/hw/darwin/quartz/quartzCocoa.m b/hw/darwin/quartz/quartzCocoa.m index 5bc1501a6..33c50a1c6 100644 --- a/hw/darwin/quartz/quartzCocoa.m +++ b/hw/darwin/quartz/quartzCocoa.m @@ -1,4 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.2 2004/04/23 19:15:17 eich Exp $ */ /************************************************************** * * Quartz-specific support for the Darwin X Server @@ -7,8 +6,6 @@ * This file is separate from the parts of Quartz support * that use X include files to avoid symbol collisions. * - **************************************************************/ -/* * Copyright (c) 2001-2004 Torrey T. Lyons and Greg Parker. * All Rights Reserved. * @@ -34,7 +31,7 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.5 2004/06/08 22:58:10 torrey Exp $ */ + #include #include "quartzCommon.h" From 10fde62fc88302f7d3b2546239b1679be249567c Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Sun, 4 Nov 2007 18:59:41 -0800 Subject: [PATCH 43/74] more CVS tags --- hw/darwin/quartz/XServer.m | 1 - hw/darwin/quartz/cr/crFrame.m | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/darwin/quartz/XServer.m b/hw/darwin/quartz/XServer.m index 14776f888..f8173cb7f 100644 --- a/hw/darwin/quartz/XServer.m +++ b/hw/darwin/quartz/XServer.m @@ -34,7 +34,6 @@ * sale, use or other dealings in this Software without prior written * authorization. */ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.3 2004/07/30 19:12:17 torrey Exp $ */ #include #include "quartzCommon.h" diff --git a/hw/darwin/quartz/cr/crFrame.m b/hw/darwin/quartz/cr/crFrame.m index 3c1f0bb28..79697fbac 100644 --- a/hw/darwin/quartz/cr/crFrame.m +++ b/hw/darwin/quartz/cr/crFrame.m @@ -1,7 +1,6 @@ /* * Cocoa rootless implementation frame functions - */ -/* + * * Copyright (c) 2001 Greg Parker. All Rights Reserved. * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. * @@ -27,7 +26,6 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.2 2004/04/23 19:15:51 eich Exp $ */ #include From b1764ddf133cfdf979db62ee2491124a4798b55b Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Mon, 5 Nov 2007 05:44:54 -0800 Subject: [PATCH 44/74] pulling more patches over from xorg-xserver-1.2-apple branch --- hw/darwin/darwin.h | 1 + hw/darwin/quartz/XDarwinStartup.man | 1 - hw/darwin/quartz/applewm.c | 2 +- hw/darwin/quartz/fullscreen/quartzCursor.h | 3 +- hw/darwin/quartz/keysym2ucs.c | 3 +- hw/darwin/quartz/quartz.c | 23 +++++--- hw/darwin/quartz/quartz.h | 3 +- hw/darwin/quartz/quartzCocoa.m | 8 ++- hw/darwin/quartz/quartzCursor.h | 3 +- hw/darwin/quartz/quartzKeyboard.c | 62 +++++++++++----------- hw/darwin/quartz/xpr/dri.c | 2 +- hw/darwin/quartz/xpr/xprScreen.c | 8 +++ miext/rootless/rootless.h | 4 ++ miext/rootless/rootlessWindow.c | 26 +++++++++ 14 files changed, 98 insertions(+), 51 deletions(-) diff --git a/hw/darwin/darwin.h b/hw/darwin/darwin.h index de104006c..70ce57e01 100644 --- a/hw/darwin/darwin.h +++ b/hw/darwin/darwin.h @@ -141,6 +141,7 @@ enum { kXDarwinQuit, // kill the X server and release the display kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer kXDarwinWritePasteboard, // copy X cut buffer onto Mac OS X pasteboard + kXDarwinBringAllToFront, // bring all X windows to front /* * AppleWM events */ diff --git a/hw/darwin/quartz/XDarwinStartup.man b/hw/darwin/quartz/XDarwinStartup.man index 9bf7dfabd..1ad3bbced 100644 --- a/hw/darwin/quartz/XDarwinStartup.man +++ b/hw/darwin/quartz/XDarwinStartup.man @@ -1,4 +1,3 @@ -.\" $XFree86: xc/programs/Xserver/hw/darwin/bundle/XDarwinStartup.man,v 1.1 2002/02/05 19:16:14 torrey Exp $ .TH XDarwinStartup 1 .SH NAME XDarwinStartup - Startup program for the XDarwin X window server diff --git a/hw/darwin/quartz/applewm.c b/hw/darwin/quartz/applewm.c index d3c26ed28..308c51074 100644 --- a/hw/darwin/quartz/applewm.c +++ b/hw/darwin/quartz/applewm.c @@ -1,6 +1,6 @@ /************************************************************************** -Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved. +Copyright (c) 2002-2007 Apple Inc. All Rights Reserved. Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a diff --git a/hw/darwin/quartz/fullscreen/quartzCursor.h b/hw/darwin/quartz/fullscreen/quartzCursor.h index 57fac68a5..56a02098d 100644 --- a/hw/darwin/quartz/fullscreen/quartzCursor.h +++ b/hw/darwin/quartz/fullscreen/quartzCursor.h @@ -2,8 +2,7 @@ * quartzCursor.h * * External interface for Quartz hardware cursor - */ -/* + * * Copyright (c) 2001 Torrey T. Lyons and Greg Parker. * All Rights Reserved. * diff --git a/hw/darwin/quartz/keysym2ucs.c b/hw/darwin/quartz/keysym2ucs.c index 3be59df33..8626ebc4e 100644 --- a/hw/darwin/quartz/keysym2ucs.c +++ b/hw/darwin/quartz/keysym2ucs.c @@ -1,4 +1,5 @@ -/* +/* + * * This module converts keysym values into the corresponding ISO 10646 * (UCS, Unicode) values. * diff --git a/hw/darwin/quartz/quartz.c b/hw/darwin/quartz/quartz.c index 374f365f2..25061a8b3 100644 --- a/hw/darwin/quartz/quartz.c +++ b/hw/darwin/quartz/quartz.c @@ -1,9 +1,7 @@ -/************************************************************** +/* * * Quartz-specific support for the Darwin X Server * - **************************************************************/ -/* * Copyright (c) 2001-2004 Greg Parker and Torrey T. Lyons. * All Rights Reserved. * @@ -64,7 +62,7 @@ int quartzServerVisible = TRUE; int quartzServerQuitting = FALSE; int quartzScreenIndex = 0; int aquaMenuBarHeight = 0; -int noPseudoramiXExtension = TRUE; +int noPseudoramiXExtension = FALSE; QuartzModeProcsPtr quartzProcs = NULL; const char *quartzOpenGLBundle = NULL; @@ -397,11 +395,22 @@ void DarwinModeProcessEvent( QuartzUpdateScreens(); break; - case kXDarwinWindowState: - case kXDarwinWindowMoved: - // FIXME: Not implemented yet + case kXDarwinBringAllToFront: + RootlessOrderAllWindows(); break; + case kXDarwinWindowState: + ErrorF("kXDarwinWindowState\n"); + break; + case kXDarwinWindowMoved: { + WindowPtr pWin = (WindowPtr)xe->u.clientMessage.u.l.longs0; + short x = xe->u.clientMessage.u.l.longs1, + y = xe->u.clientMessage.u.l.longs2; + ErrorF("kXDarwinWindowMoved(%p, %hd, %hd)\n", pWin, x, y); + RootlessMoveWindow(pWin, x, y, pWin->nextSib, VTMove); + } + break; + default: ErrorF("Unknown application defined event type %d.\n", xe->u.u.type); diff --git a/hw/darwin/quartz/quartz.h b/hw/darwin/quartz/quartz.h index f1b36b6b1..fa7499df1 100644 --- a/hw/darwin/quartz/quartz.h +++ b/hw/darwin/quartz/quartz.h @@ -3,8 +3,7 @@ * * External interface of the Quartz display modes seen by the generic, mode * independent parts of the Darwin X server. - */ -/* + * * Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons. * All Rights Reserved. * diff --git a/hw/darwin/quartz/quartzCocoa.m b/hw/darwin/quartz/quartzCocoa.m index 33c50a1c6..3987cd2c2 100644 --- a/hw/darwin/quartz/quartzCocoa.m +++ b/hw/darwin/quartz/quartzCocoa.m @@ -42,14 +42,16 @@ #include +#ifndef INXQUARTZ #import "Preferences.h" +#endif #include "pseudoramiX.h" extern void FatalError(const char *, ...); extern char *display; extern int noPanoramiXExtension; - +#ifndef INXQUARTZ /* * QuartzReadPreferences * Read the user preferences from the Cocoa front end. @@ -95,7 +97,7 @@ void QuartzReadPreferences(void) darwinDesiredDepth = [Preferences depth] - 1; } - +#endif /* * QuartzWriteCocoaPasteboard @@ -160,6 +162,7 @@ char *QuartzReadCocoaPasteboard(void) int QuartzFSUseQDCursor( int depth) // screen depth { +#ifndef INXQUARTZ switch ([Preferences useQDCursor]) { case qdCursor_Always: return TRUE; @@ -171,6 +174,7 @@ int QuartzFSUseQDCursor( else return FALSE; } +#endif return TRUE; } diff --git a/hw/darwin/quartz/quartzCursor.h b/hw/darwin/quartz/quartzCursor.h index 57fac68a5..56a02098d 100644 --- a/hw/darwin/quartz/quartzCursor.h +++ b/hw/darwin/quartz/quartzCursor.h @@ -2,8 +2,7 @@ * quartzCursor.h * * External interface for Quartz hardware cursor - */ -/* + * * Copyright (c) 2001 Torrey T. Lyons and Greg Parker. * All Rights Reserved. * diff --git a/hw/darwin/quartz/quartzKeyboard.c b/hw/darwin/quartz/quartzKeyboard.c index f81ef0abc..b580a8e84 100644 --- a/hw/darwin/quartz/quartzKeyboard.c +++ b/hw/darwin/quartz/quartzKeyboard.c @@ -217,42 +217,41 @@ DarwinModeReadSystemKeymap (darwinKeyboardInfo *info) const void *chr_data = NULL; int num_keycodes = NUM_KEYCODES; UInt32 keyboard_type = 0; - int is_uchr, i, j; + int is_uchr = 1, i, j; OSStatus err; KeySym *k; TISInputSourceRef currentKeyLayoutRef = TISCopyCurrentKeyboardLayoutInputSource(); - if (currentKeyLayoutRef) - { - CFDataRef currentKeyLayoutDataRef = (CFDataRef )TISGetInputSourceProperty(currentKeyLayoutRef, kTISPropertyUnicodeKeyLayoutData); - if (currentKeyLayoutDataRef) - chr_data = CFDataGetBytePtr(currentKeyLayoutDataRef); - } - - if (chr_data != NULL) - { - KLGetCurrentKeyboardLayout (&key_layout); - KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data); - - if (chr_data != NULL) + if (currentKeyLayoutRef) { - is_uchr = 1; - keyboard_type = LMGetKbdType (); + CFDataRef currentKeyLayoutDataRef = (CFDataRef )TISGetInputSourceProperty(currentKeyLayoutRef, kTISPropertyUnicodeKeyLayoutData); + if (currentKeyLayoutDataRef) + chr_data = CFDataGetBytePtr(currentKeyLayoutDataRef); + } + + if(chr_data == NULL) { + KLGetCurrentKeyboardLayout (&key_layout); + KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data); + + if (chr_data != NULL) + { + is_uchr = 1; + keyboard_type = LMGetKbdType (); + } + else + { + KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data); + + if (chr_data == NULL) + { + ErrorF ( "Couldn't get uchr or kchr resource\n"); + return FALSE; + } + + is_uchr = 0; + num_keycodes = 128; + } } - else - { - KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data); - - if (chr_data == NULL) - { - ErrorF ( "Couldn't get uchr or kchr resource\n"); - return FALSE; - } - - is_uchr = 0; - num_keycodes = 128; - } - } /* Scan the keycode range for the Unicode character that each key produces in the four shift states. Then convert that to @@ -376,8 +375,7 @@ DarwinModeReadSystemKeymap (darwinKeyboardInfo *info) } } } - - if(currentKeyLayoutRef) CFRelease(currentKeyLayoutRef); + if(currentKeyLayoutRef) CFRelease(currentKeyLayoutRef); return TRUE; } diff --git a/hw/darwin/quartz/xpr/dri.c b/hw/darwin/quartz/xpr/dri.c index acc1f45f7..fd0bff1a9 100644 --- a/hw/darwin/quartz/xpr/dri.c +++ b/hw/darwin/quartz/xpr/dri.c @@ -236,7 +236,7 @@ DRIFinishScreenInit(ScreenPtr pScreen) pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify; pScreen->ClipNotify = DRIClipNotify; - ErrorF("[DRI] screen %d installation complete\n", pScreen->myNum); + // ErrorF("[DRI] screen %d installation complete\n", pScreen->myNum); return TRUE; } diff --git a/hw/darwin/quartz/xpr/xprScreen.c b/hw/darwin/quartz/xpr/xprScreen.c index 3f91980bd..709e6e8cc 100644 --- a/hw/darwin/quartz/xpr/xprScreen.c +++ b/hw/darwin/quartz/xpr/xprScreen.c @@ -45,6 +45,10 @@ # include "damage.h" #endif +/* 10.4's deferred update makes X slower.. have to live with the tearing + for now.. */ +#define XP_NO_DEFERRED_UPDATES 8 + // Name of GLX bundle for native OpenGL static const char *xprOpenGLBundle = "glxCGL.bundle"; @@ -59,10 +63,12 @@ eventHandler(unsigned int type, const void *arg, switch (type) { case XP_EVENT_DISPLAY_CHANGED: + // ErrorF("XP_EVENT_DISPLAY_MOVED\n"); QuartzMessageServerThread(kXDarwinDisplayChanged, 0); break; case XP_EVENT_WINDOW_STATE_CHANGED: + // ErrorF("XP_EVENT_WINDOW_STATE_CHANGED\n"); if (arg_size >= sizeof(xp_window_state_event)) { const xp_window_state_event *ws_arg = arg; @@ -73,6 +79,7 @@ eventHandler(unsigned int type, const void *arg, break; case XP_EVENT_WINDOW_MOVED: + // ErrorF("XP_EVENT_WINDOW_MOVED\n"); if (arg_size == sizeof(xp_window_id)) { xp_window_id id = * (xp_window_id *) arg; @@ -89,6 +96,7 @@ eventHandler(unsigned int type, const void *arg, case XP_EVENT_SURFACE_DESTROYED: case XP_EVENT_SURFACE_CHANGED: + // ErrorF("XP_EVENT_SURFACE_MOVED\n"); if (arg_size == sizeof(xp_surface_id)) { int kind; diff --git a/miext/rootless/rootless.h b/miext/rootless/rootless.h index f83defeb6..d9fdb6adb 100644 --- a/miext/rootless/rootless.h +++ b/miext/rootless/rootless.h @@ -432,4 +432,8 @@ void RootlessUpdateScreenPixmap(ScreenPtr pScreen); */ void RootlessRepositionWindows(ScreenPtr pScreen); +/* + * Bring all windows to the front of the Aqua stack + */ +void RootlessOrderAllWindows (void); #endif /* _ROOTLESS_H */ diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c index f7126590b..4a3c0f6ae 100644 --- a/miext/rootless/rootlessWindow.c +++ b/miext/rootless/rootlessWindow.c @@ -1376,3 +1376,29 @@ RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width) RL_DEBUG_MSG("change border width end\n"); } + +/* + * RootlessOrderAllWindows + * Brings all X11 windows to the top of the window stack + * (i.e in front of Aqua windows) -- called when X11.app is given focus + */ +void +RootlessOrderAllWindows (void) +{ + int i; + WindowPtr pWin; + + RL_DEBUG_MSG("RootlessOrderAllWindows() "); + for (i = 0; i < screenInfo.numScreens; i++) { + if (screenInfo.screens[i] == NULL) continue; + pWin = WindowTable[i]; + if (pWin == NULL) continue; + + for (pWin = pWin->firstChild; pWin != NULL; pWin = pWin->nextSib) { + if (!pWin->realized) continue; + if (RootlessEnsureFrame(pWin) == NULL) continue; + RootlessReorderWindow (pWin); + } + } + RL_DEBUG_MSG("RootlessOrderAllWindows() done"); +} From 6e4f5cf83f35ffebb51633ab30b1826e63e37223 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Mon, 5 Nov 2007 05:53:34 -0800 Subject: [PATCH 45/74] changing ALLOCATE_LOCAL to xalloc to prevent stack overflow --- dix/dispatch.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/dix/dispatch.c b/dix/dispatch.c index eae0fa0c4..1a3b4abf8 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -919,7 +919,7 @@ ProcQueryTree(ClientPtr client) { int curChild = 0; - childIDs = (Window *) ALLOCATE_LOCAL(numChildren * sizeof(Window)); + childIDs = (Window *) xalloc(numChildren * sizeof(Window)); if (!childIDs) return BadAlloc; for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) @@ -934,7 +934,7 @@ ProcQueryTree(ClientPtr client) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, numChildren * sizeof(Window), childIDs); - DEALLOCATE_LOCAL(childIDs); + xfree(childIDs); } return(client->noClientException); @@ -1402,7 +1402,7 @@ ProcQueryFont(ClientPtr client) rlength = sizeof(xQueryFontReply) + FONTINFONPROPS(FONTCHARSET(pFont)) * sizeof(xFontProp) + nprotoxcistructs * sizeof(xCharInfo); - reply = (xQueryFontReply *)ALLOCATE_LOCAL(rlength); + reply = (xQueryFontReply *)xalloc(rlength); if(!reply) { return(BadAlloc); @@ -1414,7 +1414,7 @@ ProcQueryFont(ClientPtr client) QueryFont( pFont, reply, nprotoxcistructs); WriteReplyToClient(client, rlength, reply); - DEALLOCATE_LOCAL(reply); + xfree(reply); return(client->noClientException); } } @@ -2260,7 +2260,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, length += widthBytesLine; } } - if(!(pBuf = (char *) ALLOCATE_LOCAL(length))) + if(!(pBuf = (char *) xalloc(length))) return (BadAlloc); WriteReplyToClient(client, sizeof (xGetImageReply), &xgi); } @@ -2362,7 +2362,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, if (pVisibleRegion) REGION_DESTROY(pDraw->pScreen, pVisibleRegion); if (!im_return) - DEALLOCATE_LOCAL(pBuf); + xfree(pBuf); return (client->noClientException); } @@ -2619,7 +2619,7 @@ ProcListInstalledColormaps(ClientPtr client) return rc; preply = (xListInstalledColormapsReply *) - ALLOCATE_LOCAL(sizeof(xListInstalledColormapsReply) + + xalloc(sizeof(xListInstalledColormapsReply) + pWin->drawable.pScreen->maxInstalledCmaps * sizeof(Colormap)); if(!preply) @@ -2634,7 +2634,7 @@ ProcListInstalledColormaps(ClientPtr client) WriteReplyToClient(client, sizeof (xListInstalledColormapsReply), preply); client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]); - DEALLOCATE_LOCAL(preply); + xfree(preply); return(client->noClientException); } @@ -2761,7 +2761,7 @@ ProcAllocColorCells (ClientPtr client) } nmasks = stuff->planes; length = ((long)npixels + (long)nmasks) * sizeof(Pixel); - ppixels = (Pixel *)ALLOCATE_LOCAL(length); + ppixels = (Pixel *)xalloc(length); if(!ppixels) return(BadAlloc); pmasks = ppixels + npixels; @@ -2769,7 +2769,7 @@ ProcAllocColorCells (ClientPtr client) if( (retval = AllocColorCells(client->index, pcmp, npixels, nmasks, (Bool)stuff->contiguous, ppixels, pmasks)) ) { - DEALLOCATE_LOCAL(ppixels); + xfree(ppixels); if (client->noClientException != Success) return(client->noClientException); else @@ -2788,7 +2788,7 @@ ProcAllocColorCells (ClientPtr client) client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, length, ppixels); } - DEALLOCATE_LOCAL(ppixels); + xfree(ppixels); return (client->noClientException); } else @@ -2829,7 +2829,7 @@ ProcAllocColorPlanes(ClientPtr client) acpr.sequenceNumber = client->sequence; acpr.nPixels = npixels; length = (long)npixels * sizeof(Pixel); - ppixels = (Pixel *)ALLOCATE_LOCAL(length); + ppixels = (Pixel *)xalloc(length); if(!ppixels) return(BadAlloc); if( (retval = AllocColorPlanes(client->index, pcmp, npixels, @@ -2837,7 +2837,7 @@ ProcAllocColorPlanes(ClientPtr client) (Bool)stuff->contiguous, ppixels, &acpr.redMask, &acpr.greenMask, &acpr.blueMask)) ) { - DEALLOCATE_LOCAL(ppixels); + xfree(ppixels); if (client->noClientException != Success) return(client->noClientException); else @@ -2852,7 +2852,7 @@ ProcAllocColorPlanes(ClientPtr client) client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, length, ppixels); } - DEALLOCATE_LOCAL(ppixels); + xfree(ppixels); return (client->noClientException); } else @@ -2981,12 +2981,12 @@ ProcQueryColors(ClientPtr client) xQueryColorsReply qcr; count = ((client->req_len << 2) - sizeof(xQueryColorsReq)) >> 2; - prgbs = (xrgb *)ALLOCATE_LOCAL(count * sizeof(xrgb)); + prgbs = (xrgb *)xalloc(count * sizeof(xrgb)); if(!prgbs && count) return(BadAlloc); if( (retval = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs)) ) { - if (prgbs) DEALLOCATE_LOCAL(prgbs); + if (prgbs) xfree(prgbs); if (client->noClientException != Success) return(client->noClientException); else @@ -3005,7 +3005,7 @@ ProcQueryColors(ClientPtr client) client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend; WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs); } - if (prgbs) DEALLOCATE_LOCAL(prgbs); + if (prgbs) xfree(prgbs); return(client->noClientException); } From 59774af86b851c7fb8989cef6c013522549000b8 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 13:59:15 +0000 Subject: [PATCH 46/74] XKB: Remove usage of alloca alloca has no way to return failure, and instead can possibly arbitrarily overflow the stack. Let's avoid that one. --- xkb/xkb.c | 24 ++++++++++++------------ xkb/xkbInit.c | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index cf4243070..2b8b52835 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -1312,7 +1312,7 @@ unsigned i,len; char *desc,*start; len= (rep->length*4)-(SIZEOF(xkbGetMapReply)-SIZEOF(xGenericReply)); - start= desc= (char *)ALLOCATE_LOCAL(len); + start= desc= (char *)xalloc(len); if (!start) return BadAlloc; if ( rep->nTypes>0 ) @@ -1352,7 +1352,7 @@ char *desc,*start; } WriteToClient(client, (i=SIZEOF(xkbGetMapReply)), (char *)rep); WriteToClient(client, len, start); - DEALLOCATE_LOCAL((char *)start); + xfree((char *)start); return client->noClientException; } @@ -2499,7 +2499,7 @@ int size; size= rep->length*4; if (size>0) { - data = (char *)ALLOCATE_LOCAL(size); + data = (char *)xalloc(size); if (data) { register unsigned i,bit; xkbModsWireDesc * grp; @@ -2550,7 +2550,7 @@ int size; WriteToClient(client, SIZEOF(xkbGetCompatMapReply), (char *)rep); if (data) { WriteToClient(client, size, data); - DEALLOCATE_LOCAL((char *)data); + xfree((char *)data); } return client->noClientException; } @@ -2801,7 +2801,7 @@ register unsigned bit; length = rep->length*4; if (length>0) { CARD8 *to; - to= map= (CARD8 *)ALLOCATE_LOCAL(length); + to= map= (CARD8 *)xalloc(length); if (map) { xkbIndicatorMapWireDesc *wire = (xkbIndicatorMapWireDesc *)to; for (i=0,bit=1;inoClientException; } @@ -3292,7 +3292,7 @@ register int n; swapl(&rep->indicators,n); } - start = desc = (char *)ALLOCATE_LOCAL(length); + start = desc = (char *)xalloc(length); if ( !start ) return BadAlloc; if (xkb->names) { @@ -3416,7 +3416,7 @@ register int n; } WriteToClient(client, SIZEOF(xkbGetNamesReply), (char *)rep); WriteToClient(client, length, start); - DEALLOCATE_LOCAL((char *)start); + xfree((char *)start); return client->noClientException; } @@ -4314,7 +4314,7 @@ XkbSendGeometry( ClientPtr client, if (geom!=NULL) { len= rep->length*4; - start= desc= (char *)ALLOCATE_LOCAL(len); + start= desc= (char *)xalloc(len); if (!start) return BadAlloc; desc= XkbWriteCountedString(desc,geom->label_font,client->swapped); @@ -4358,7 +4358,7 @@ XkbSendGeometry( ClientPtr client, if (len>0) WriteToClient(client, len, start); if (start!=NULL) - DEALLOCATE_LOCAL((char *)start); + xfree((char *)start); if (freeGeom) XkbFreeGeometry(geom,XkbGeomAllMask,True); return client->noClientException; @@ -5758,12 +5758,12 @@ char * str; } WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), (char *)&rep); - str= (char*) ALLOCATE_LOCAL(nameLen); + str= (char*) xalloc(nameLen); if (!str) return BadAlloc; XkbWriteCountedString(str,dev->name,client->swapped); WriteToClient(client,nameLen,str); - DEALLOCATE_LOCAL(str); + xfree(str); length-= nameLen; if (rep.nBtnsRtrn>0) { diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index c0867adf0..6301a32e7 100644 --- a/xkb/xkbInit.c +++ b/xkb/xkbInit.c @@ -182,7 +182,7 @@ char * pval; ErrorF("Atom error: %s not created\n",_XKB_RF_NAMES_PROP_ATOM); return True; } - pval= (char*) ALLOCATE_LOCAL(len); + pval= (char*) xalloc(len); if (!pval) { ErrorF("Allocation error: %s proprerty not created\n", _XKB_RF_NAMES_PROP_ATOM); @@ -223,7 +223,7 @@ char * pval; } ChangeWindowProperty(WindowTable[0],name,XA_STRING,8,PropModeReplace, len,pval,True); - DEALLOCATE_LOCAL(pval); + xfree(pval); return True; } From e0491f470e130147191388168e878e3a7348afaf Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 13:59:51 +0000 Subject: [PATCH 47/74] Render: Remove usage of alloca Replace it with heap-based allocations. --- render/mitri.c | 8 ++++---- render/render.c | 44 ++++++++++++++++++++++---------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/render/mitri.c b/render/mitri.c index 374e2fdc7..a92c19b7e 100644 --- a/render/mitri.c +++ b/render/mitri.c @@ -144,7 +144,7 @@ miTriStrip (CARD8 op, if (npoint < 3) return; ntri = npoint - 2; - tris = ALLOCATE_LOCAL (ntri * sizeof (xTriangle)); + tris = xalloc (ntri * sizeof (xTriangle)); if (!tris) return; for (tri = tris; npoint >= 3; npoint--, points++, tri++) @@ -154,7 +154,7 @@ miTriStrip (CARD8 op, tri->p3 = points[2]; } (*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris); - DEALLOCATE_LOCAL (tris); + xfree (tris); } void @@ -176,7 +176,7 @@ miTriFan (CARD8 op, if (npoint < 3) return; ntri = npoint - 2; - tris = ALLOCATE_LOCAL (ntri * sizeof (xTriangle)); + tris = xalloc (ntri * sizeof (xTriangle)); if (!tris) return; first = points++; @@ -187,5 +187,5 @@ miTriFan (CARD8 op, tri->p3 = points[1]; } (*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris); - DEALLOCATE_LOCAL (tris); + xfree (tris); } diff --git a/render/render.c b/render/render.c index b0707539f..3a9d24a02 100644 --- a/render/render.c +++ b/render/render.c @@ -1409,7 +1409,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphsBase = glyphsLocal; else { - glyphsBase = (GlyphPtr *) ALLOCATE_LOCAL (nglyph * sizeof (GlyphPtr)); + glyphsBase = (GlyphPtr *) xalloc (nglyph * sizeof (GlyphPtr)); if (!glyphsBase) return BadAlloc; } @@ -1417,7 +1417,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) listsBase = listsLocal; else { - listsBase = (GlyphListPtr) ALLOCATE_LOCAL (nlist * sizeof (GlyphListRec)); + listsBase = (GlyphListPtr) xalloc (nlist * sizeof (GlyphListRec)); if (!listsBase) return BadAlloc; } @@ -1442,9 +1442,9 @@ ProcRenderCompositeGlyphs (ClientPtr client) { client->errorValue = gs; if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); + xfree (glyphsBase); if (listsBase != listsLocal) - DEALLOCATE_LOCAL (listsBase); + xfree (listsBase); return RenderErrBase + BadGlyphSet; } } @@ -1498,9 +1498,9 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphsBase); if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); + xfree (glyphsBase); if (listsBase != listsLocal) - DEALLOCATE_LOCAL (listsBase); + xfree (listsBase); return client->noClientException; } @@ -2965,7 +2965,7 @@ PanoramiXRenderFillRectangles (ClientPtr client) RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) + (extra = (char *) xalloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -2991,7 +2991,7 @@ PanoramiXRenderFillRectangles (ClientPtr client) result = (*PanoramiXSaveRenderVector[X_RenderFillRectangles]) (client); if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + xfree(extra); } return result; @@ -3016,7 +3016,7 @@ PanoramiXRenderTrapezoids(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) xalloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -3053,7 +3053,7 @@ PanoramiXRenderTrapezoids(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + xfree(extra); } return result; @@ -3078,7 +3078,7 @@ PanoramiXRenderTriangles(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) xalloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -3111,7 +3111,7 @@ PanoramiXRenderTriangles(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + xfree(extra); } return result; @@ -3136,7 +3136,7 @@ PanoramiXRenderTriStrip(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) xalloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -3165,7 +3165,7 @@ PanoramiXRenderTriStrip(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + xfree(extra); } return result; @@ -3190,7 +3190,7 @@ PanoramiXRenderTriFan(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) xalloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -3219,7 +3219,7 @@ PanoramiXRenderTriFan(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + xfree(extra); } return result; @@ -3244,7 +3244,7 @@ PanoramiXRenderColorTrapezoids(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderColorTrapezoidsReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) xalloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -3265,7 +3265,7 @@ PanoramiXRenderColorTrapezoids(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + xfree(extra); } return result; @@ -3288,7 +3288,7 @@ PanoramiXRenderColorTriangles(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderColorTrianglesReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) xalloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -3309,7 +3309,7 @@ PanoramiXRenderColorTriangles(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + xfree(extra); } return result; @@ -3332,7 +3332,7 @@ PanoramiXRenderAddTraps (ClientPtr client) RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderAddTrapsReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) + (extra = (char *) xalloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); x_off = stuff->xOff; @@ -3349,7 +3349,7 @@ PanoramiXRenderAddTraps (ClientPtr client) result = (*PanoramiXSaveRenderVector[X_RenderAddTraps]) (client); if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + xfree(extra); } return result; From 3c1d2fdeff0ed61d86fa7d35cb0a61535d9b2816 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:00:40 +0000 Subject: [PATCH 48/74] Record: Remove usage of alloca Replace with xalloc/xfree. --- record/record.c | 12 ++++++------ record/set.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/record/record.c b/record/record.c index 0ed8f84c2..f580f643e 100644 --- a/record/record.c +++ b/record/record.c @@ -1724,7 +1724,7 @@ RecordRegisterClients(RecordContextPtr pContext, ClientPtr client, xRecordRegist * range for extension replies. */ maxSets = PREDEFSETS + 2 * stuff->nRanges; - si = (SetInfoPtr)ALLOCATE_LOCAL(sizeof(SetInfoRec) * maxSets); + si = (SetInfoPtr)xalloc(sizeof(SetInfoRec) * maxSets); if (!si) { err = BadAlloc; @@ -1931,7 +1931,7 @@ bailout: for (i = 0; i < maxSets; i++) if (si[i].intervals) xfree(si[i].intervals); - DEALLOCATE_LOCAL(si); + xfree(si); } if (pCanonClients && pCanonClients != (XID *)&stuff[1]) xfree(pCanonClients); @@ -2298,7 +2298,7 @@ ProcRecordGetContext(ClientPtr client) /* allocate and initialize space for record range info */ - pRangeInfo = (GetContextRangeInfoPtr)ALLOCATE_LOCAL( + pRangeInfo = (GetContextRangeInfoPtr)xalloc( nRCAPs * sizeof(GetContextRangeInfoRec)); if (!pRangeInfo && nRCAPs > 0) return BadAlloc; @@ -2415,7 +2415,7 @@ bailout: { if (pRangeInfo[i].pRanges) xfree(pRangeInfo[i].pRanges); } - DEALLOCATE_LOCAL(pRangeInfo); + xfree(pRangeInfo); return err; } /* ProcRecordGetContext */ @@ -2815,14 +2815,14 @@ RecordConnectionSetupInfo(RecordContextPtr pContext, NewClientInfoRec *pci) if (pci->client->swapped) { - char *pConnSetup = (char *)ALLOCATE_LOCAL(prefixsize + restsize); + char *pConnSetup = (char *)xalloc(prefixsize + restsize); if (!pConnSetup) return; SwapConnSetupPrefix(pci->prefix, pConnSetup); SwapConnSetupInfo(pci->setup, pConnSetup + prefixsize); RecordAProtocolElement(pContext, pci->client, XRecordClientStarted, (pointer)pConnSetup, prefixsize + restsize, 0); - DEALLOCATE_LOCAL(pConnSetup); + xfree(pConnSetup); } else { diff --git a/record/set.c b/record/set.c index 07a3a63a3..453452ec6 100644 --- a/record/set.c +++ b/record/set.c @@ -302,7 +302,7 @@ IntervalListCreateSet(RecordSetInterval *pIntervals, int nIntervals, if (nIntervals > 0) { - stackIntervals = (RecordSetInterval *)ALLOCATE_LOCAL( + stackIntervals = (RecordSetInterval *)xalloc( sizeof(RecordSetInterval) * nIntervals); if (!stackIntervals) return NULL; @@ -360,7 +360,7 @@ IntervalListCreateSet(RecordSetInterval *pIntervals, int nIntervals, memcpy(&prls[1], stackIntervals, nIntervals * sizeof(RecordSetInterval)); prls->nIntervals = nIntervals; bailout: - if (stackIntervals) DEALLOCATE_LOCAL(stackIntervals); + if (stackIntervals) xfree(stackIntervals); return (RecordSetPtr)prls; } From 2d738efb959912d8a89864e41190e0064fa77906 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:01:11 +0000 Subject: [PATCH 49/74] RandR: Remove usage of alloca Replace with heap allocations. --- randr/rrproperty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/randr/rrproperty.c b/randr/rrproperty.c index 5ac073f81..4617064e4 100644 --- a/randr/rrproperty.c +++ b/randr/rrproperty.c @@ -386,7 +386,7 @@ ProcRRListOutputProperties (ClientPtr client) for (prop = output->properties; prop; prop = prop->next) numProps++; if (numProps) - if(!(pAtoms = (Atom *)ALLOCATE_LOCAL(numProps * sizeof(Atom)))) + if(!(pAtoms = (Atom *)xalloc(numProps * sizeof(Atom)))) return(BadAlloc); rep.type = X_Reply; @@ -408,7 +408,7 @@ ProcRRListOutputProperties (ClientPtr client) { client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); - DEALLOCATE_LOCAL(pAtoms); + xfree(pAtoms); } return(client->noClientException); } From 2761c103311a1160bc483fd0367d654733df8598 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:03:26 +0000 Subject: [PATCH 50/74] OS: Remove usage of alloca Replace with heap allocations. --- os/oscolor.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/os/oscolor.c b/os/oscolor.c index e1756926d..6f3a7fa4a 100644 --- a/os/oscolor.c +++ b/os/oscolor.c @@ -180,7 +180,7 @@ lookup(char *name, int len, Bool create) dbEntryPtr entry, *prev = NULL; char *str = name; - if (!(name = (char*)ALLOCATE_LOCAL(len +1))) return NULL; + if (!(name = (char*)xalloc(len +1))) return NULL; CopyISOLatin1Lowered((unsigned char *)name, (unsigned char *)str, len); name[len] = '\0'; @@ -206,7 +206,7 @@ lookup(char *name, int len, Bool create) strcpy( entry->name, name ); } - DEALLOCATE_LOCAL(name); + xfree(name); return entry; } @@ -225,13 +225,13 @@ OsInitColors(void) if (!was_here) { - path = (char*)ALLOCATE_LOCAL(strlen(rgbPath) +5); + path = (char*)xalloc(strlen(rgbPath) +5); strcpy(path, rgbPath); strcat(path, ".txt"); if (!(rgb = fopen(path, "r"))) { ErrorF( "Couldn't open RGB_DB '%s'\n", rgbPath ); - DEALLOCATE_LOCAL(path); + xfree(path); return FALSE; } @@ -259,7 +259,7 @@ OsInitColors(void) } fclose(rgb); - DEALLOCATE_LOCAL(path); + xfree(path); was_here = TRUE; } From 3633ae6efb57c5405c26e8ae132b9371e5f920de Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:04:27 +0000 Subject: [PATCH 51/74] Damage: Remove usage of alloca Replace with heap allocations. --- miext/damage/damage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miext/damage/damage.c b/miext/damage/damage.c index 58f37e990..17425aeb2 100755 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -1399,7 +1399,7 @@ damageText (DrawablePtr pDrawable, imageblt = (textType == TT_IMAGE8) || (textType == TT_IMAGE16); - charinfo = (CharInfoPtr *) ALLOCATE_LOCAL(count * sizeof(CharInfoPtr)); + charinfo = (CharInfoPtr *) xalloc(count * sizeof(CharInfoPtr)); if (!charinfo) return x; @@ -1421,7 +1421,7 @@ damageText (DrawablePtr pDrawable, (*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font)); } - DEALLOCATE_LOCAL(charinfo); + xfree(charinfo); return x + w; } From be9ee17f960cc3d8a8f999cab1579e83d9aea520 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:08:51 +0000 Subject: [PATCH 52/74] mi: Remove usage of alloca Replace with heap allocations. --- mi/miarc.c | 22 +++++++++++----------- mi/mibank.c | 32 ++++++++++++++++---------------- mi/mibitblt.c | 42 +++++++++++++++++++++--------------------- mi/miexpose.c | 16 ++++++++-------- mi/mifillarc.c | 40 ++++++++++++++++++++-------------------- mi/mifillrct.c | 12 ++++++------ mi/mifpolycon.c | 18 +++++++++--------- mi/miglblt.c | 4 ++-- mi/mipolycon.c | 16 ++++++++-------- mi/mipolygen.c | 6 +++--- mi/mipolypnt.c | 4 ++-- mi/mipolyrect.c | 4 ++-- mi/mispans.c | 2 +- mi/miwideline.c | 20 ++++++++++---------- mi/mizerarc.c | 10 +++++----- mi/mizerline.c | 8 ++++---- 16 files changed, 128 insertions(+), 128 deletions(-) diff --git a/mi/miarc.c b/mi/miarc.c index 70888155e..5ccd11127 100644 --- a/mi/miarc.c +++ b/mi/miarc.c @@ -925,14 +925,14 @@ miFillWideEllipse( yorgu = parc->height + pGC->lineWidth; n = (sizeof(int) * 2) * yorgu; - widths = (int *)ALLOCATE_LOCAL(n + (sizeof(DDXPointRec) * 2) * yorgu); + widths = (int *)xalloc(n + (sizeof(DDXPointRec) * 2) * yorgu); if (!widths) return; points = (DDXPointPtr)((char *)widths + n); spdata = miComputeWideEllipse((int)pGC->lineWidth, parc, &mustFree); if (!spdata) { - DEALLOCATE_LOCAL(widths); + xfree(widths); return; } pts = points; @@ -1025,7 +1025,7 @@ miFillWideEllipse( xfree(spdata); (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE); - DEALLOCATE_LOCAL(widths); + xfree(widths); } /* @@ -1899,13 +1899,13 @@ miComputeArcs ( isDoubleDash = (pGC->lineStyle == LineDoubleDash); dashOffset = pGC->dashOffset; - data = (struct arcData *) ALLOCATE_LOCAL (narcs * sizeof (struct arcData)); + data = (struct arcData *) xalloc (narcs * sizeof (struct arcData)); if (!data) return (miPolyArcPtr)NULL; arcs = (miPolyArcPtr) xalloc (sizeof (*arcs) * (isDoubleDash ? 2 : 1)); if (!arcs) { - DEALLOCATE_LOCAL(data); + xfree(data); return (miPolyArcPtr)NULL; } for (i = 0; i < narcs; i++) { @@ -2254,11 +2254,11 @@ miComputeArcs ( arcs[iphase].arcs[arcs[iphase].narcs-1].cap = arcs[iphase].ncaps; } - DEALLOCATE_LOCAL(data); + xfree(data); return arcs; arcfail: miFreeArcs(arcs, pGC); - DEALLOCATE_LOCAL(data); + xfree(data); return (miPolyArcPtr)NULL; } @@ -3162,8 +3162,8 @@ fillSpans ( if (nspans == 0) return; - xSpan = xSpans = (DDXPointPtr) ALLOCATE_LOCAL (nspans * sizeof (DDXPointRec)); - xWidth = xWidths = (int *) ALLOCATE_LOCAL (nspans * sizeof (int)); + xSpan = xSpans = (DDXPointPtr) xalloc (nspans * sizeof (DDXPointRec)); + xWidth = xWidths = (int *) xalloc (nspans * sizeof (int)); if (xSpans && xWidths) { i = 0; @@ -3183,9 +3183,9 @@ fillSpans ( } disposeFinalSpans (); if (xSpans) - DEALLOCATE_LOCAL (xSpans); + xfree (xSpans); if (xWidths) - DEALLOCATE_LOCAL (xWidths); + xfree (xWidths); finalMiny = 0; finalMaxy = -1; finalSize = 0; diff --git a/mi/mibank.c b/mi/mibank.c index d693f2668..859770cc2 100644 --- a/mi/mibank.c +++ b/mi/mibank.c @@ -172,8 +172,8 @@ typedef struct _miBankQueue (*pScreenPriv->BankInfo.SetDestinationBank)(pScreen, (_no)) - \ (pScreenPriv->BankInfo.BankSize * (_no))) -#define ALLOCATE_LOCAL_ARRAY(atype, ntype) \ - (atype *)ALLOCATE_LOCAL((ntype) * sizeof(atype)) +#define xalloc_ARRAY(atype, ntype) \ + (atype *)xalloc((ntype) * sizeof(atype)) static int miBankScreenIndex; static int miBankGCIndex; @@ -318,14 +318,14 @@ static unsigned long miBankGeneration = 0; atype *aarg = pArray, *acopy; \ int i; \ CLIP_SAVE; \ - if ((acopy = ALLOCATE_LOCAL_ARRAY(atype, nArray))) \ + if ((acopy = xalloc_ARRAY(atype, nArray))) \ aarg = acopy; \ GCOP_TOP_PART; \ if (acopy) \ memcpy(acopy, pArray, nArray * sizeof(atype)); \ (*pGC->ops->aop)(pDrawable, pGC, GCOP_ARGS nArray, aarg); \ GCOP_BOTTOM_PART; \ - DEALLOCATE_LOCAL(acopy); \ + xfree(acopy); \ CLIP_RESTORE; \ } \ SCREEN_RESTORE; \ @@ -787,7 +787,7 @@ miBankCopy( fastBlit = pGCPriv->fastCopy; nQueue = nBox * pScreenPriv->maxRects * 2; - pQueue = Queue = ALLOCATE_LOCAL_ARRAY(miBankQueue, nQueue); + pQueue = Queue = xalloc_ARRAY(miBankQueue, nQueue); if (Queue) { @@ -953,7 +953,7 @@ miBankCopy( paddedWidth = PixmapBytePad(maxWidth, pScreenPriv->pScreenPixmap->drawable.depth); - pImage = (char *)ALLOCATE_LOCAL(paddedWidth * maxHeight); + pImage = (char *)xalloc(paddedWidth * maxHeight); pGC->fExpose = FALSE; @@ -1031,7 +1031,7 @@ miBankCopy( pQueue++; } - DEALLOCATE_LOCAL(pImage); + xfree(pImage); BANK_RESTORE; } @@ -1040,7 +1040,7 @@ miBankCopy( pGC->fExpose = fExpose; - DEALLOCATE_LOCAL(Queue); + xfree(Queue); } SCREEN_RESTORE; @@ -1748,7 +1748,7 @@ miBankGetImage( paddedWidth = PixmapBytePad(w, pScreenPriv->pScreenPixmap->drawable.depth); - pBankImage = (char *)ALLOCATE_LOCAL(paddedWidth * h); + pBankImage = (char *)xalloc(paddedWidth * h); if (pBankImage) { @@ -1768,7 +1768,7 @@ miBankGetImage( BANK_RESTORE; - DEALLOCATE_LOCAL(pBankImage); + xfree(pBankImage); } } @@ -1809,7 +1809,7 @@ miBankGetSpans( paddedWidth = PixmapBytePad(pScreenPriv->pScreenPixmap->drawable.width, pScreenPriv->pScreenPixmap->drawable.depth); - pBankImage = (char *)ALLOCATE_LOCAL(paddedWidth); + pBankImage = (char *)xalloc(paddedWidth); if (pBankImage) { @@ -1838,7 +1838,7 @@ miBankGetSpans( BANK_RESTORE; - DEALLOCATE_LOCAL(pBankImage); + xfree(pBankImage); } } @@ -1911,7 +1911,7 @@ miBankCopyWindow( if (dy < 0) { /* Sort boxes from bottom to top */ - pBoxNew1 = ALLOCATE_LOCAL_ARRAY(BoxRec, nBox); + pBoxNew1 = xalloc_ARRAY(BoxRec, nBox); if (pBoxNew1) { @@ -1939,7 +1939,7 @@ miBankCopyWindow( if (dx < 0) { /* Sort boxes from right to left */ - pBoxNew2 = ALLOCATE_LOCAL_ARRAY(BoxRec, nBox); + pBoxNew2 = xalloc_ARRAY(BoxRec, nBox); if (pBoxNew2) { @@ -1979,8 +1979,8 @@ miBankCopyWindow( REGION_DESTROY(pScreen, pRgnDst); - DEALLOCATE_LOCAL(pBoxNew2); - DEALLOCATE_LOCAL(pBoxNew1); + xfree(pBoxNew2); + xfree(pBoxNew1); } _X_EXPORT Bool diff --git a/mi/mibitblt.c b/mi/mibitblt.c index 1ddccdda1..14d68e2e1 100644 --- a/mi/mibitblt.c +++ b/mi/mibitblt.c @@ -143,21 +143,21 @@ miCopyArea(pSrcDrawable, pDstDrawable, } pptFirst = ppt = (DDXPointPtr) - ALLOCATE_LOCAL(heightSrc * sizeof(DDXPointRec)); + xalloc(heightSrc * sizeof(DDXPointRec)); pwidthFirst = pwidth = (unsigned int *) - ALLOCATE_LOCAL(heightSrc * sizeof(unsigned int)); + xalloc(heightSrc * sizeof(unsigned int)); numRects = REGION_NUM_RECTS(prgnSrcClip); boxes = REGION_RECTS(prgnSrcClip); ordering = (unsigned int *) - ALLOCATE_LOCAL(numRects * sizeof(unsigned int)); + xalloc(numRects * sizeof(unsigned int)); if(!pptFirst || !pwidthFirst || !ordering) { if (ordering) - DEALLOCATE_LOCAL(ordering); + xfree(ordering); if (pwidthFirst) - DEALLOCATE_LOCAL(pwidthFirst); + xfree(pwidthFirst); if (pptFirst) - DEALLOCATE_LOCAL(pptFirst); + xfree(pptFirst); return (RegionPtr)NULL; } @@ -264,9 +264,9 @@ miCopyArea(pSrcDrawable, pDstDrawable, if(realSrcClip) REGION_DESTROY(pGC->pScreen, prgnSrcClip); - DEALLOCATE_LOCAL(ordering); - DEALLOCATE_LOCAL(pwidthFirst); - DEALLOCATE_LOCAL(pptFirst); + xfree(ordering); + xfree(pwidthFirst); + xfree(pptFirst); return prgnExposed; } @@ -433,12 +433,12 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc, dixChangeGC(NullClient, pGCT, GCBackground, NULL, gcv); ValidateGC((DrawablePtr)pPixmap, pGCT); miClearDrawable((DrawablePtr)pPixmap, pGCT); - ppt = pptFirst = (DDXPointPtr)ALLOCATE_LOCAL(h * sizeof(DDXPointRec)); - pwidth = pwidthFirst = (int *)ALLOCATE_LOCAL(h * sizeof(int)); + ppt = pptFirst = (DDXPointPtr)xalloc(h * sizeof(DDXPointRec)); + pwidth = pwidthFirst = (int *)xalloc(h * sizeof(int)); if(!pptFirst || !pwidthFirst) { - if (pwidthFirst) DEALLOCATE_LOCAL(pwidthFirst); - if (pptFirst) DEALLOCATE_LOCAL(pptFirst); + if (pwidthFirst) xfree(pwidthFirst); + if (pptFirst) xfree(pptFirst); FreeScratchGC(pGCT); return; } @@ -464,8 +464,8 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc, (*pGCT->ops->SetSpans)((DrawablePtr)pPixmap, pGCT, (char *)pbits, pptFirst, pwidthFirst, h, TRUE); - DEALLOCATE_LOCAL(pwidthFirst); - DEALLOCATE_LOCAL(pptFirst); + xfree(pwidthFirst); + xfree(pptFirst); /* Save current values from the client GC */ @@ -808,14 +808,14 @@ miPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage) break; case ZPixmap: - ppt = pptFirst = (DDXPointPtr)ALLOCATE_LOCAL(h * sizeof(DDXPointRec)); - pwidth = pwidthFirst = (int *)ALLOCATE_LOCAL(h * sizeof(int)); + ppt = pptFirst = (DDXPointPtr)xalloc(h * sizeof(DDXPointRec)); + pwidth = pwidthFirst = (int *)xalloc(h * sizeof(int)); if(!pptFirst || !pwidthFirst) { if (pwidthFirst) - DEALLOCATE_LOCAL(pwidthFirst); + xfree(pwidthFirst); if (pptFirst) - DEALLOCATE_LOCAL(pptFirst); + xfree(pptFirst); return; } if (pGC->miTranslate) @@ -834,8 +834,8 @@ miPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage) (*pGC->ops->SetSpans)(pDraw, pGC, (char *)pImage, pptFirst, pwidthFirst, h, TRUE); - DEALLOCATE_LOCAL(pwidthFirst); - DEALLOCATE_LOCAL(pptFirst); + xfree(pwidthFirst); + xfree(pptFirst); break; } } diff --git a/mi/miexpose.c b/mi/miexpose.c index 6ace9f589..2d3b0d510 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -369,7 +369,7 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor) numRects = REGION_NUM_RECTS(pRgn); pBox = REGION_RECTS(pRgn); - if(!(pEvent = (xEvent *)ALLOCATE_LOCAL(numRects * sizeof(xEvent)))) + if(!(pEvent = (xEvent *)xalloc(numRects * sizeof(xEvent)))) return; pe = pEvent; @@ -387,7 +387,7 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor) } TryClientEvents(client, pEvent, numRects, (Mask)0, NoEventMask, NullGrab); - DEALLOCATE_LOCAL(pEvent); + xfree(pEvent); } else { @@ -415,7 +415,7 @@ miSendExposures(pWin, pRgn, dx, dy) pBox = REGION_RECTS(pRgn); numRects = REGION_NUM_RECTS(pRgn); - if(!(pEvent = (xEvent *) ALLOCATE_LOCAL(numRects * sizeof(xEvent)))) + if(!(pEvent = (xEvent *) xalloc(numRects * sizeof(xEvent)))) return; for (i=numRects, pe = pEvent; --i >= 0; pe++, pBox++) @@ -445,7 +445,7 @@ miSendExposures(pWin, pRgn, dx, dy) win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, scrnum); if(!win) { - DEALLOCATE_LOCAL(pEvent); + xfree(pEvent); return; } realWin = win->info[0].id; @@ -462,7 +462,7 @@ miSendExposures(pWin, pRgn, dx, dy) DeliverEvents(pWin, pEvent, numRects, NullWindow); - DEALLOCATE_LOCAL(pEvent); + xfree(pEvent); } _X_EXPORT void @@ -620,7 +620,7 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin; } - prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) * + prect = (xRectangle *)xalloc(REGION_NUM_RECTS(prgn) * sizeof(xRectangle)); if (!prect) return; @@ -628,7 +628,7 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) pGC = GetScratchGC(drawable->depth, drawable->pScreen); if (!pGC) { - DEALLOCATE_LOCAL(prect); + xfree(prect); return; } @@ -646,7 +646,7 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) } prect -= numRects; (*pGC->ops->PolyFillRect)(drawable, pGC, numRects, prect); - DEALLOCATE_LOCAL(prect); + xfree(prect); FreeScratchGC(pGC); } diff --git a/mi/mifillarc.c b/mi/mifillarc.c index c561b1f5b..f68ddf468 100644 --- a/mi/mifillarc.c +++ b/mi/mifillarc.c @@ -551,13 +551,13 @@ miFillEllipseI( int *widths; int *wids; - points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * arc->height); + points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * arc->height); if (!points) return; - widths = (int *)ALLOCATE_LOCAL(sizeof(int) * arc->height); + widths = (int *)xalloc(sizeof(int) * arc->height); if (!widths) { - DEALLOCATE_LOCAL(points); + xfree(points); return; } miFillArcSetup(arc, &info); @@ -575,8 +575,8 @@ miFillEllipseI( ADDSPANS(); } (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE); - DEALLOCATE_LOCAL(widths); - DEALLOCATE_LOCAL(points); + xfree(widths); + xfree(points); } static void @@ -594,13 +594,13 @@ miFillEllipseD( int *widths; int *wids; - points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * arc->height); + points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * arc->height); if (!points) return; - widths = (int *)ALLOCATE_LOCAL(sizeof(int) * arc->height); + widths = (int *)xalloc(sizeof(int) * arc->height); if (!widths) { - DEALLOCATE_LOCAL(points); + xfree(points); return; } miFillArcDSetup(arc, &info); @@ -618,8 +618,8 @@ miFillEllipseD( ADDSPANS(); } (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE); - DEALLOCATE_LOCAL(widths); - DEALLOCATE_LOCAL(points); + xfree(widths); + xfree(points); } #define ADDSPAN(l,r) \ @@ -666,13 +666,13 @@ miFillArcSliceI( slw = arc->height; if (slice.flip_top || slice.flip_bot) slw += (arc->height >> 1) + 1; - points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * slw); + points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * slw); if (!points) return; - widths = (int *)ALLOCATE_LOCAL(sizeof(int) * slw); + widths = (int *)xalloc(sizeof(int) * slw); if (!widths) { - DEALLOCATE_LOCAL(points); + xfree(points); return; } if (pGC->miTranslate) @@ -703,8 +703,8 @@ miFillArcSliceI( } } (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE); - DEALLOCATE_LOCAL(widths); - DEALLOCATE_LOCAL(points); + xfree(widths); + xfree(points); } static void @@ -730,13 +730,13 @@ miFillArcSliceD( slw = arc->height; if (slice.flip_top || slice.flip_bot) slw += (arc->height >> 1) + 1; - points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * slw); + points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * slw); if (!points) return; - widths = (int *)ALLOCATE_LOCAL(sizeof(int) * slw); + widths = (int *)xalloc(sizeof(int) * slw); if (!widths) { - DEALLOCATE_LOCAL(points); + xfree(points); return; } if (pGC->miTranslate) @@ -767,8 +767,8 @@ miFillArcSliceD( } } (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE); - DEALLOCATE_LOCAL(widths); - DEALLOCATE_LOCAL(points); + xfree(widths); + xfree(points); } /* MIPOLYFILLARC -- The public entry for the PolyFillArc request. diff --git a/mi/mifillrct.c b/mi/mifillrct.c index ca7e86445..e7646cf38 100644 --- a/mi/mifillrct.c +++ b/mi/mifillrct.c @@ -106,12 +106,12 @@ miPolyFillRect(pDrawable, pGC, nrectFill, prectInit) maxheight = max(maxheight, prect->height); } - pptFirst = (DDXPointPtr) ALLOCATE_LOCAL(maxheight * sizeof(DDXPointRec)); - pwFirst = (int *) ALLOCATE_LOCAL(maxheight * sizeof(int)); + pptFirst = (DDXPointPtr) xalloc(maxheight * sizeof(DDXPointRec)); + pwFirst = (int *) xalloc(maxheight * sizeof(int)); if(!pptFirst || !pwFirst) { - if (pwFirst) DEALLOCATE_LOCAL(pwFirst); - if (pptFirst) DEALLOCATE_LOCAL(pptFirst); + if (pwFirst) xfree(pwFirst); + if (pptFirst) xfree(pptFirst); return; } @@ -137,6 +137,6 @@ miPolyFillRect(pDrawable, pGC, nrectFill, prectInit) 1); prect++; } - DEALLOCATE_LOCAL(pwFirst); - DEALLOCATE_LOCAL(pptFirst); + xfree(pwFirst); + xfree(pptFirst); } diff --git a/mi/mifpolycon.c b/mi/mifpolycon.c index f85197157..d19f031d7 100644 --- a/mi/mifpolycon.c +++ b/mi/mifpolycon.c @@ -114,15 +114,15 @@ miFillSppPoly(dst, pgc, count, ptsIn, xTrans, yTrans, xFtrans, yFtrans) y = ymax - ymin + 1; if ((count < 3) || (y <= 0)) return; - ptsOut = FirstPoint = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * y); - width = FirstWidth = (int *) ALLOCATE_LOCAL(sizeof(int) * y); - Marked = (int *) ALLOCATE_LOCAL(sizeof(int) * count); + ptsOut = FirstPoint = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * y); + width = FirstWidth = (int *) xalloc(sizeof(int) * y); + Marked = (int *) xalloc(sizeof(int) * count); if(!ptsOut || !width || !Marked) { - if (Marked) DEALLOCATE_LOCAL(Marked); - if (width) DEALLOCATE_LOCAL(width); - if (ptsOut) DEALLOCATE_LOCAL(ptsOut); + if (Marked) xfree(Marked); + if (width) xfree(width); + if (ptsOut) xfree(ptsOut); return; } @@ -236,9 +236,9 @@ miFillSppPoly(dst, pgc, count, ptsIn, xTrans, yTrans, xFtrans, yFtrans) /* Finally, fill the spans we've collected */ (*pgc->ops->FillSpans)(dst, pgc, ptsOut-FirstPoint, FirstPoint, FirstWidth, 1); - DEALLOCATE_LOCAL(Marked); - DEALLOCATE_LOCAL(FirstWidth); - DEALLOCATE_LOCAL(FirstPoint); + xfree(Marked); + xfree(FirstWidth); + xfree(FirstPoint); } diff --git a/mi/miglblt.c b/mi/miglblt.c index c9ae02db7..0155b5618 100644 --- a/mi/miglblt.c +++ b/mi/miglblt.c @@ -139,7 +139,7 @@ miPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) DoChangeGC(pGCtmp, GCFunction|GCForeground|GCBackground, gcvals, 0); nbyLine = BitmapBytePad(width); - pbits = (unsigned char *)ALLOCATE_LOCAL(height*nbyLine); + pbits = (unsigned char *)xalloc(height*nbyLine); if (!pbits) { (*pDrawable->pScreen->DestroyPixmap)(pPixmap); @@ -190,7 +190,7 @@ miPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) x += pci->metrics.characterWidth; } (*pDrawable->pScreen->DestroyPixmap)(pPixmap); - DEALLOCATE_LOCAL(pbits); + xfree(pbits); FreeScratchGC(pGCtmp); } diff --git a/mi/mipolycon.c b/mi/mipolycon.c index e2d666e51..6aabad675 100644 --- a/mi/mipolycon.c +++ b/mi/mipolycon.c @@ -104,12 +104,12 @@ miFillConvexPoly(dst, pgc, count, ptsIn) dy = ymax - ymin + 1; if ((count < 3) || (dy < 0)) return(TRUE); - ptsOut = FirstPoint = (DDXPointPtr )ALLOCATE_LOCAL(sizeof(DDXPointRec)*dy); - width = FirstWidth = (int *)ALLOCATE_LOCAL(sizeof(int) * dy); + ptsOut = FirstPoint = (DDXPointPtr )xalloc(sizeof(DDXPointRec)*dy); + width = FirstWidth = (int *)xalloc(sizeof(int) * dy); if(!FirstPoint || !FirstWidth) { - if (FirstWidth) DEALLOCATE_LOCAL(FirstWidth); - if (FirstPoint) DEALLOCATE_LOCAL(FirstPoint); + if (FirstWidth) xfree(FirstWidth); + if (FirstPoint) xfree(FirstPoint); return(FALSE); } @@ -174,8 +174,8 @@ miFillConvexPoly(dst, pgc, count, ptsIn) /* in case we're called with non-convex polygon */ if(i < 0) { - DEALLOCATE_LOCAL(FirstWidth); - DEALLOCATE_LOCAL(FirstPoint); + xfree(FirstWidth); + xfree(FirstPoint); return(TRUE); } while (i-- > 0) @@ -209,8 +209,8 @@ miFillConvexPoly(dst, pgc, count, ptsIn) (*pgc->ops->FillSpans)(dst, pgc, ptsOut-FirstPoint,FirstPoint,FirstWidth, 1); - DEALLOCATE_LOCAL(FirstWidth); - DEALLOCATE_LOCAL(FirstPoint); + xfree(FirstWidth); + xfree(FirstPoint); return(TRUE); } diff --git a/mi/mipolygen.c b/mi/mipolygen.c index 0d2ecc430..7623fc40a 100644 --- a/mi/mipolygen.c +++ b/mi/mipolygen.c @@ -92,13 +92,13 @@ miFillGeneralPoly(dst, pgc, count, ptsIn) return(TRUE); if(!(pETEs = (EdgeTableEntry *) - ALLOCATE_LOCAL(sizeof(EdgeTableEntry) * count))) + xalloc(sizeof(EdgeTableEntry) * count))) return(FALSE); ptsOut = FirstPoint; width = FirstWidth; if (!miCreateETandAET(count, ptsIn, &ET, &AET, pETEs, &SLLBlock)) { - DEALLOCATE_LOCAL(pETEs); + xfree(pETEs); return(FALSE); } pSLL = ET.scanlines.next; @@ -224,7 +224,7 @@ miFillGeneralPoly(dst, pgc, count, ptsIn) * Get any spans that we missed by buffering */ (*pgc->ops->FillSpans)(dst, pgc, nPts, FirstPoint, FirstWidth, 1); - DEALLOCATE_LOCAL(pETEs); + xfree(pETEs); miFreeStorage(SLLBlock.next); return(TRUE); } diff --git a/mi/mipolypnt.c b/mi/mipolypnt.c index afe3f724a..56026bdbd 100644 --- a/mi/mipolypnt.c +++ b/mi/mipolypnt.c @@ -106,7 +106,7 @@ miPolyPoint(pDrawable, pGC, mode, npt, pptInit) DoChangeGC(pGC, GCFillStyle, &fsNew, 0); ValidateGC(pDrawable, pGC); } - if(!(pwidthInit = (int *)ALLOCATE_LOCAL(npt * sizeof(int)))) + if(!(pwidthInit = (int *)xalloc(npt * sizeof(int)))) return; pwidth = pwidthInit; for(i = 0; i < npt; i++) @@ -118,6 +118,6 @@ miPolyPoint(pDrawable, pGC, mode, npt, pptInit) DoChangeGC(pGC, GCFillStyle, &fsOld, 0); ValidateGC(pDrawable, pGC); } - DEALLOCATE_LOCAL(pwidthInit); + xfree(pwidthInit); } diff --git a/mi/mipolyrect.c b/mi/mipolyrect.c index a9ab90928..788624872 100644 --- a/mi/mipolyrect.c +++ b/mi/mipolyrect.c @@ -94,7 +94,7 @@ miPolyRectangle(pDraw, pGC, nrects, pRects) offset2 = pGC->lineWidth; offset1 = offset2 >> 1; offset3 = offset2 - offset1; - tmp = (xRectangle *) ALLOCATE_LOCAL(ntmp * sizeof (xRectangle)); + tmp = (xRectangle *) xalloc(ntmp * sizeof (xRectangle)); if (!tmp) return; t = tmp; @@ -162,7 +162,7 @@ miPolyRectangle(pDraw, pGC, nrects, pRects) } } (*pGC->ops->PolyFillRect) (pDraw, pGC, t - tmp, tmp); - DEALLOCATE_LOCAL ((pointer) tmp); + xfree ((pointer) tmp); } else { diff --git a/mi/mispans.c b/mi/mispans.c index 530d9dff2..6f30155f5 100644 --- a/mi/mispans.c +++ b/mi/mispans.c @@ -528,7 +528,7 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup) xfree(points); xfree(widths); xfree(yspans); - xfree(ysizes); /* use (DE)ALLOCATE_LOCAL for these? */ + xfree(ysizes); /* use (DE)xalloc for these? */ } spanGroup->count = 0; diff --git a/mi/miwideline.c b/mi/miwideline.c index 8c6022f6f..f080ca11d 100644 --- a/mi/miwideline.c +++ b/mi/miwideline.c @@ -95,13 +95,13 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, if (!spanData) { - pptInit = (DDXPointPtr) ALLOCATE_LOCAL (overall_height * sizeof(*ppt)); + pptInit = (DDXPointPtr) xalloc (overall_height * sizeof(*ppt)); if (!pptInit) return; - pwidthInit = (int *) ALLOCATE_LOCAL (overall_height * sizeof(*pwidth)); + pwidthInit = (int *) xalloc (overall_height * sizeof(*pwidth)); if (!pwidthInit) { - DEALLOCATE_LOCAL (pptInit); + xfree (pptInit); return; } ppt = pptInit; @@ -167,8 +167,8 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, if (!spanData) { (*pGC->ops->FillSpans) (pDrawable, pGC, ppt - pptInit, pptInit, pwidthInit, TRUE); - DEALLOCATE_LOCAL (pwidthInit); - DEALLOCATE_LOCAL (pptInit); + xfree (pwidthInit); + xfree (pptInit); if (pixel != oldPixel) { DoChangeGC (pGC, GCForeground, &oldPixel, FALSE); @@ -1045,13 +1045,13 @@ miLineArc ( } if (!spanData) { - points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * pGC->lineWidth); + points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * pGC->lineWidth); if (!points) return; - widths = (int *)ALLOCATE_LOCAL(sizeof(int) * pGC->lineWidth); + widths = (int *)xalloc(sizeof(int) * pGC->lineWidth); if (!widths) { - DEALLOCATE_LOCAL(points); + xfree(points); return; } oldPixel = pGC->fgPixel; @@ -1086,8 +1086,8 @@ miLineArc ( if (!spanData) { (*pGC->ops->FillSpans)(pDraw, pGC, n, points, widths, TRUE); - DEALLOCATE_LOCAL(widths); - DEALLOCATE_LOCAL(points); + xfree(widths); + xfree(points); if (pixel != oldPixel) { DoChangeGC(pGC, GCForeground, &oldPixel, FALSE); diff --git a/mi/mizerarc.c b/mi/mizerarc.c index 9d4715a30..947b85aac 100644 --- a/mi/mizerarc.c +++ b/mi/mizerarc.c @@ -744,7 +744,7 @@ miZeroPolyArc(pDraw, pGC, narcs, parcs) dospans = (pGC->fillStyle != FillSolid); if (dospans) { - widths = (int *)ALLOCATE_LOCAL(sizeof(int) * numPts); + widths = (int *)xalloc(sizeof(int) * numPts); if (!widths) return; maxw = 0; @@ -761,12 +761,12 @@ miZeroPolyArc(pDraw, pGC, narcs, parcs) (unsigned char *) pGC->dash, (int)pGC->numInDashList, &dinfo.dashOffsetInit); } - points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * numPts); + points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * numPts); if (!points) { if (dospans) { - DEALLOCATE_LOCAL(widths); + xfree(widths); } return; } @@ -843,9 +843,9 @@ miZeroPolyArc(pDraw, pGC, narcs, parcs) } } } - DEALLOCATE_LOCAL(points); + xfree(points); if (dospans) { - DEALLOCATE_LOCAL(widths); + xfree(widths); } } diff --git a/mi/mizerline.c b/mi/mizerline.c index 073f1b20f..6604a0923 100644 --- a/mi/mizerline.c +++ b/mi/mizerline.c @@ -155,8 +155,8 @@ miZeroLine(pDraw, pGC, mode, npt, pptInit) width = xright - xleft + 1; height = ybottom - ytop + 1; list_len = (height >= width) ? height : width; - pspanInit = (DDXPointPtr)ALLOCATE_LOCAL(list_len * sizeof(DDXPointRec)); - pwidthInit = (int *)ALLOCATE_LOCAL(list_len * sizeof(int)); + pspanInit = (DDXPointPtr)xalloc(list_len * sizeof(DDXPointRec)); + pwidthInit = (int *)xalloc(list_len * sizeof(int)); if (!pspanInit || !pwidthInit) return; @@ -359,8 +359,8 @@ miZeroLine(pDraw, pGC, mode, npt, pptInit) (*pGC->ops->FillSpans)(pDraw, pGC, Nspans, pspanInit, pwidthInit, FALSE); - DEALLOCATE_LOCAL(pwidthInit); - DEALLOCATE_LOCAL(pspanInit); + xfree(pwidthInit); + xfree(pspanInit); } _X_EXPORT void From f7d5c292e44113ea8eb32e67e91cd02e520df5e3 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:09:14 +0000 Subject: [PATCH 53/74] mfb: Remove usage of alloca Replace with heap-based allocations. --- mfb/mfbbitblt.c | 4 +- mfb/mfbblt.c | 26 ++++++------ mfb/mfbfillrct.c | 4 +- mfb/mfbfillsp.c | 108 +++++++++++++++++++++++------------------------ mfb/mfbimggblt.c | 4 +- mfb/mfbpixmap.c | 4 +- mfb/mfbplygblt.c | 4 +- mfb/mfbpushpxl.c | 4 +- mfb/mfbwindow.c | 4 +- 9 files changed, 81 insertions(+), 81 deletions(-) diff --git a/mfb/mfbbitblt.c b/mfb/mfbbitblt.c index 0f84df354..153cf6ac6 100644 --- a/mfb/mfbbitblt.c +++ b/mfb/mfbbitblt.c @@ -351,7 +351,7 @@ int dstx, dsty; numRects = REGION_NUM_RECTS(&rgnDst); if (numRects && width && height) { - if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects * + if(!(pptSrc = (DDXPointPtr)xalloc(numRects * sizeof(DDXPointRec)))) { REGION_UNINIT(pGC->pScreen, &rgnDst); @@ -370,7 +370,7 @@ int dstx, dsty; if (pGC->planemask & 1) (*localDoBitBlt) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); } prgnExposed = NULL; diff --git a/mfb/mfbblt.c b/mfb/mfbblt.c index 4c3028126..b87a69797 100644 --- a/mfb/mfbblt.c +++ b/mfb/mfbblt.c @@ -119,13 +119,13 @@ MROP_NAME(mfbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc) if (nbox > 1) { /* keep ordering in each band, reverse order of bands */ - pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); + pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); if(!pboxNew1) return; - pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); if(!pptNew1) { - DEALLOCATE_LOCAL(pboxNew1); + xfree(pboxNew1); return; } pboxBase = pboxNext = pbox+nbox-1; @@ -163,16 +163,16 @@ MROP_NAME(mfbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc) if (nbox > 1) { /* reverse order of rects in each band */ - pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); - pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); + pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); if(!pboxNew2 || !pptNew2) { - if (pptNew2) DEALLOCATE_LOCAL(pptNew2); - if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2); + if (pptNew2) xfree(pptNew2); + if (pboxNew2) xfree(pboxNew2); if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); + xfree(pptNew1); + xfree(pboxNew1); } return; } @@ -578,12 +578,12 @@ bits1 = *--psrc; --pdst; \ } if (pboxNew2) { - DEALLOCATE_LOCAL(pptNew2); - DEALLOCATE_LOCAL(pboxNew2); + xfree(pptNew2); + xfree(pboxNew2); } if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); + xfree(pptNew1); + xfree(pboxNew1); } } diff --git a/mfb/mfbfillrct.c b/mfb/mfbfillrct.c index f9209d096..594c7f01b 100644 --- a/mfb/mfbfillrct.c +++ b/mfb/mfbfillrct.c @@ -118,7 +118,7 @@ mfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit) numRects = REGION_NUM_RECTS(prgnClip) * nrectFill; if (numRects > NUM_STACK_RECTS) { - pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec)); + pboxClippedBase = (BoxPtr)xalloc(numRects * sizeof(BoxRec)); if (!pboxClippedBase) return; } @@ -222,5 +222,5 @@ mfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit) if (pboxClipped != pboxClippedBase) (*pfn) (pDrawable,pboxClipped-pboxClippedBase, pboxClippedBase, alu, ppix); if (pboxClippedBase != stackRects) - DEALLOCATE_LOCAL(pboxClippedBase); + xfree(pboxClippedBase); } diff --git a/mfb/mfbfillsp.c b/mfb/mfbfillsp.c index 112f5327c..f83ca6a54 100644 --- a/mfb/mfbfillsp.c +++ b/mfb/mfbfillsp.c @@ -111,12 +111,12 @@ mfbBlackSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -151,8 +151,8 @@ mfbBlackSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) pwidth++; ppt++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } @@ -183,12 +183,12 @@ mfbWhiteSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -223,8 +223,8 @@ mfbWhiteSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) pwidth++; ppt++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } @@ -255,12 +255,12 @@ mfbInvertSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -295,8 +295,8 @@ mfbInvertSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) pwidth++; ppt++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } @@ -330,12 +330,12 @@ mfbWhiteStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -372,8 +372,8 @@ mfbWhiteStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) pwidth++; ppt++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } @@ -407,12 +407,12 @@ mfbBlackStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -449,8 +449,8 @@ mfbBlackStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) pwidth++; ppt++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } @@ -484,12 +484,12 @@ mfbInvertStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -526,8 +526,8 @@ mfbInvertStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) pwidth++; ppt++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } @@ -603,12 +603,12 @@ mfbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -708,8 +708,8 @@ mfbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) } break; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } @@ -746,12 +746,12 @@ mfbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -873,8 +873,8 @@ mfbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) ppt++; pwidth++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } @@ -912,12 +912,12 @@ mfbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -1021,6 +1021,6 @@ mfbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) ppt++; pwidth++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } diff --git a/mfb/mfbimggblt.c b/mfb/mfbimggblt.c index e5c186b89..c21e82608 100644 --- a/mfb/mfbimggblt.c +++ b/mfb/mfbimggblt.c @@ -293,7 +293,7 @@ MFBIMAGEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) int getWidth; /* bits to get from glyph */ #endif - if(!(ppos = (TEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(TEXTPOS)))) + if(!(ppos = (TEXTPOS *)xalloc(nglyph * sizeof(TEXTPOS)))) return; pdstBase = mfbScanlineNoBankSwitch(pdstBase, x, y, widthDst); @@ -434,7 +434,7 @@ MFBIMAGEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) } } /* for each glyph */ } /* while nbox-- */ - DEALLOCATE_LOCAL(ppos); + xfree(ppos); break; } default: diff --git a/mfb/mfbpixmap.c b/mfb/mfbpixmap.c index 1472b44e2..438e9ab57 100644 --- a/mfb/mfbpixmap.c +++ b/mfb/mfbpixmap.c @@ -253,13 +253,13 @@ mfbYRotatePixmap(pPix, rh) nbyDown = rh * pPix->devKind; nbyUp = (pPix->devKind * height) - nbyDown; - if(!(ptmp = (char *)ALLOCATE_LOCAL(nbyUp))) + if(!(ptmp = (char *)xalloc(nbyUp))) return; memmove(ptmp, pbase, nbyUp); /* save the low rows */ memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */ memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rh */ - DEALLOCATE_LOCAL(ptmp); + xfree(ptmp); } void diff --git a/mfb/mfbplygblt.c b/mfb/mfbplygblt.c index 997e4a388..1bd56e1ec 100644 --- a/mfb/mfbplygblt.c +++ b/mfb/mfbplygblt.c @@ -254,7 +254,7 @@ MFBPOLYGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) int getWidth; /* bits to get from glyph */ #endif - if(!(ppos = (TEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(TEXTPOS)))) + if(!(ppos = (TEXTPOS *)xalloc(nglyph * sizeof(TEXTPOS)))) return; pdstBase = mfbScanlineNoBankSwitch(pdstBase, x, y, widthDst); @@ -388,7 +388,7 @@ MFBPOLYGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) } } /* for each glyph */ } /* while nbox-- */ - DEALLOCATE_LOCAL(ppos); + xfree(ppos); break; } default: diff --git a/mfb/mfbpushpxl.c b/mfb/mfbpushpxl.c index ddf7b3c0e..de9699252 100644 --- a/mfb/mfbpushpxl.c +++ b/mfb/mfbpushpxl.c @@ -132,7 +132,7 @@ mfbSolidPP(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg) if (!REGION_NIL(&rgnDst)) { i = REGION_NUM_RECTS(&rgnDst); - pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(i * sizeof(DDXPointRec)); + pptSrc = (DDXPointPtr)xalloc(i * sizeof(DDXPointRec)); if(pptSrc) { for (pbox = REGION_RECTS(&rgnDst), ppt = pptSrc; @@ -143,7 +143,7 @@ mfbSolidPP(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg) ppt->y = pbox->y1 - yOrg; } mfbDoBitblt((DrawablePtr)pBitMap, pDrawable, alu, &rgnDst, pptSrc); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); } } REGION_UNINIT(pGC->pScreen, &rgnDst); diff --git a/mfb/mfbwindow.c b/mfb/mfbwindow.c index 4cbf59fdc..30b8857b1 100644 --- a/mfb/mfbwindow.c +++ b/mfb/mfbwindow.c @@ -150,7 +150,7 @@ mfbCopyWindow(pWin, ptOldOrg, prgnSrc) pbox = REGION_RECTS(prgnDst); nbox = REGION_NUM_RECTS(prgnDst); - if(!(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) + if(!(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) return; ppt = pptSrc; @@ -162,6 +162,6 @@ mfbCopyWindow(pWin, ptOldOrg, prgnSrc) mfbDoBitblt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, GXcopy, prgnDst, pptSrc); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); REGION_DESTROY(pWin->drawable.pScreen, prgnDst); } From 1c84337af0ac40498a53aa36289e2f6f5ff8b1c6 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:09:32 +0000 Subject: [PATCH 54/74] Xwin: Remove usage of alloca Replace with heap allocations. --- hw/xwin/winwindow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c index e844dbfb3..1600996df 100644 --- a/hw/xwin/winwindow.c +++ b/hw/xwin/winwindow.c @@ -167,7 +167,7 @@ winCopyWindowNativeGDI (WindowPtr pWin, nbox = REGION_NUM_RECTS(prgnDst); /* Allocate source points for each box */ - if(!(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) + if(!(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) return; /* Set an iterator pointer */ @@ -206,7 +206,7 @@ winCopyWindowNativeGDI (WindowPtr pWin, } /* Cleanup the regions, etc. */ - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); REGION_DESTROY(pWin->drawable.pScreen, prgnDst); } From 259f4c36d581896ce605741b9e557a589013a9b8 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:09:49 +0000 Subject: [PATCH 55/74] Xprint: Remove usage of alloca Replace with heap-based allocations. --- hw/xprint/ps/PsText.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xprint/ps/PsText.c b/hw/xprint/ps/PsText.c index 98cf15345..872c0f427 100644 --- a/hw/xprint/ps/PsText.c +++ b/hw/xprint/ps/PsText.c @@ -535,7 +535,7 @@ PsPolyGlyphBlt( nbyLine = BitmapBytePad(width); - pbits = (unsigned char *)ALLOCATE_LOCAL(height*nbyLine); + pbits = (unsigned char *)xalloc(height*nbyLine); if (!pbits){ PsDestroyPixmap(pPixmap); return; @@ -576,6 +576,6 @@ PsPolyGlyphBlt( x += pci->metrics.characterWidth; } - DEALLOCATE_LOCAL(pbits); + xfree(pbits); FreeScratchGC(pGCtmp); } From def6f74f2d7342f85f3df2053e0b9c1ac483b51d Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:10:03 +0000 Subject: [PATCH 56/74] Xvfb: Remove usage of alloca Replace with heap allocations --- hw/vfb/InitOutput.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index 812326a50..0d4ca57fe 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -482,9 +482,9 @@ vfbInstallColormap(ColormapPtr pmap) swapcopy32(pXWDHeader->bits_per_rgb, pVisual->bitsPerRGBValue); swapcopy32(pXWDHeader->colormap_entries, pVisual->ColormapEntries); - ppix = (Pixel *)ALLOCATE_LOCAL(entries * sizeof(Pixel)); - prgb = (xrgb *)ALLOCATE_LOCAL(entries * sizeof(xrgb)); - defs = (xColorItem *)ALLOCATE_LOCAL(entries * sizeof(xColorItem)); + ppix = (Pixel *)xalloc(entries * sizeof(Pixel)); + prgb = (xrgb *)xalloc(entries * sizeof(xrgb)); + defs = (xColorItem *)xalloc(entries * sizeof(xColorItem)); for (i = 0; i < entries; i++) ppix[i] = i; /* XXX truecolor */ @@ -499,9 +499,9 @@ vfbInstallColormap(ColormapPtr pmap) } (*pmap->pScreen->StoreColors)(pmap, entries, defs); - DEALLOCATE_LOCAL(ppix); - DEALLOCATE_LOCAL(prgb); - DEALLOCATE_LOCAL(defs); + xfree(ppix); + xfree(prgb); + xfree(defs); } } From d57060f16714f5667722001bd1a4500059dd59e1 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:10:21 +0000 Subject: [PATCH 57/74] DMX: Remove usage of alloca Replace with heap allocations. --- hw/dmx/dmx.c | 48 +++++++++++++++++++++---------------------- hw/dmx/dmxextension.c | 12 +++++------ hw/dmx/dmxpict.c | 10 ++++----- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/hw/dmx/dmx.c b/hw/dmx/dmx.c index 24d1620b8..5f1fc0546 100644 --- a/hw/dmx/dmx.c +++ b/hw/dmx/dmx.c @@ -424,7 +424,7 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client) if (!_DMXXineramaActive()) goto noxinerama; - if (!(attribs = ALLOCATE_LOCAL(stuff->screenCount * sizeof(*attribs)))) + if (!(attribs = xalloc(stuff->screenCount * sizeof(*attribs)))) return BadAlloc; for (i = 0; i < stuff->screenCount; i++) { @@ -443,7 +443,7 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client) &errorScreen); #endif - DEALLOCATE_LOCAL(attribs); + xfree(attribs); if (status == BadValue) return status; @@ -489,7 +489,7 @@ static int ProcDMXAddScreen(ClientPtr client) value_list = (CARD32 *)(stuff + 1); count = dmxFetchScreenAttributes(stuff->valueMask, &attr, value_list); - if (!(name = ALLOCATE_LOCAL(stuff->displayNameLength + 1 + 4))) + if (!(name = xalloc(stuff->displayNameLength + 1 + 4))) return BadAlloc; memcpy(name, &value_list[count], stuff->displayNameLength); name[stuff->displayNameLength] = '\0'; @@ -497,7 +497,7 @@ static int ProcDMXAddScreen(ClientPtr client) status = dmxAttachScreen(stuff->physicalScreen, &attr); - DEALLOCATE_LOCAL(name); + xfree(name); rep.type = X_Reply; rep.sequenceNumber = client->sequence; @@ -617,30 +617,30 @@ static int ProcDMXGetWindowAttributes(ClientPtr client) REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq); - if (!(screens = ALLOCATE_LOCAL(count * sizeof(*screens)))) + if (!(screens = xalloc(count * sizeof(*screens)))) return BadAlloc; - if (!(windows = ALLOCATE_LOCAL(count * sizeof(*windows)))) { - DEALLOCATE_LOCAL(screens); + if (!(windows = xalloc(count * sizeof(*windows)))) { + xfree(screens); return BadAlloc; } - if (!(pos = ALLOCATE_LOCAL(count * sizeof(*pos)))) { - DEALLOCATE_LOCAL(windows); - DEALLOCATE_LOCAL(screens); + if (!(pos = xalloc(count * sizeof(*pos)))) { + xfree(windows); + xfree(screens); return BadAlloc; } - if (!(vis = ALLOCATE_LOCAL(count * sizeof(*vis)))) { - DEALLOCATE_LOCAL(pos); - DEALLOCATE_LOCAL(windows); - DEALLOCATE_LOCAL(screens); + if (!(vis = xalloc(count * sizeof(*vis)))) { + xfree(pos); + xfree(windows); + xfree(screens); return BadAlloc; } if ((count = dmxPopulate(client, stuff->window, screens, windows, pos, vis)) < 0) { - DEALLOCATE_LOCAL(vis); - DEALLOCATE_LOCAL(pos); - DEALLOCATE_LOCAL(windows); - DEALLOCATE_LOCAL(screens); + xfree(vis); + xfree(pos); + xfree(windows); + xfree(screens); return BadWindow; } @@ -678,10 +678,10 @@ static int ProcDMXGetWindowAttributes(ClientPtr client) WriteToClient(client, count * sizeof(*vis), (char *)vis); } - DEALLOCATE_LOCAL(vis); - DEALLOCATE_LOCAL(pos); - DEALLOCATE_LOCAL(windows); - DEALLOCATE_LOCAL(screens); + xfree(vis); + xfree(pos); + xfree(windows); + xfree(screens); return client->noClientException; } @@ -842,7 +842,7 @@ static int ProcDMXAddInput(ClientPtr client) value_list = (CARD32 *)(stuff + 1); count = dmxFetchInputAttributes(stuff->valueMask, &attr, value_list); - if (!(name = ALLOCATE_LOCAL(stuff->displayNameLength + 1 + 4))) + if (!(name = xalloc(stuff->displayNameLength + 1 + 4))) return BadAlloc; memcpy(name, &value_list[count], stuff->displayNameLength); name[stuff->displayNameLength] = '\0'; @@ -850,7 +850,7 @@ static int ProcDMXAddInput(ClientPtr client) status = dmxAddInput(&attr, &id); - DEALLOCATE_LOCAL(name); + xfree(name); if (status) return status; diff --git a/hw/dmx/dmxextension.c b/hw/dmx/dmxextension.c index 103364446..560468c4b 100644 --- a/hw/dmx/dmxextension.c +++ b/hw/dmx/dmxextension.c @@ -1121,9 +1121,9 @@ static void dmxBERestoreRenderGlyph(pointer value, XID id, pointer n) } /* Now allocate the memory we need */ - images = ALLOCATE_LOCAL(len_images*sizeof(char)); - gids = ALLOCATE_LOCAL(glyphSet->hash.tableEntries*sizeof(Glyph)); - glyphs = ALLOCATE_LOCAL(glyphSet->hash.tableEntries*sizeof(XGlyphInfo)); + images = xalloc(len_images*sizeof(char)); + gids = xalloc(glyphSet->hash.tableEntries*sizeof(Glyph)); + glyphs = xalloc(glyphSet->hash.tableEntries*sizeof(XGlyphInfo)); memset(images, 0, len_images * sizeof(char)); pos = images; @@ -1159,9 +1159,9 @@ static void dmxBERestoreRenderGlyph(pointer value, XID id, pointer n) len_images); /* Clean up */ - DEALLOCATE_LOCAL(len_images); - DEALLOCATE_LOCAL(gids); - DEALLOCATE_LOCAL(glyphs); + xfree(len_images); + xfree(gids); + xfree(glyphs); } #endif diff --git a/hw/dmx/dmxpict.c b/hw/dmx/dmxpict.c index 478542a13..bbb744c45 100644 --- a/hw/dmx/dmxpict.c +++ b/hw/dmx/dmxpict.c @@ -531,13 +531,13 @@ static int dmxProcRenderCompositeGlyphs(ClientPtr client) /* The following only works for Render version > 0.2 */ /* All of the XGlyphElt* structure sizes are identical */ - elts = ALLOCATE_LOCAL(nelt * sizeof(XGlyphElt8)); + elts = xalloc(nelt * sizeof(XGlyphElt8)); if (!elts) return BadAlloc; - glyphs = ALLOCATE_LOCAL(nglyph * size); + glyphs = xalloc(nglyph * size); if (!glyphs) { - DEALLOCATE_LOCAL(elts); + xfree(elts); return BadAlloc; } @@ -605,8 +605,8 @@ static int dmxProcRenderCompositeGlyphs(ClientPtr client) dmxSync(dmxScreen, FALSE); - DEALLOCATE_LOCAL(elts); - DEALLOCATE_LOCAL(glyphs); + xfree(elts); + xfree(glyphs); } return ret; From caf545063457591f88e1f7bcd25dbd0342f44343 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:10:55 +0000 Subject: [PATCH 58/74] KDrive: Remove usage of alloca Replace with heap allocations. --- hw/kdrive/epson/epson13806.c | 4 ++-- hw/kdrive/fbdev/fbdev.c | 4 ++-- hw/kdrive/igs/igsdraw.c | 12 ++++++------ hw/kdrive/nvidia/nvidiavideo.c | 4 ++-- hw/kdrive/savage/s3draw.c | 32 ++++++++++++++++---------------- hw/kdrive/sis530/sisdraw.c | 16 ++++++++-------- hw/kdrive/smi/smivideo.c | 4 ++-- hw/kdrive/src/kxv.c | 4 ++-- 8 files changed, 40 insertions(+), 40 deletions(-) diff --git a/hw/kdrive/epson/epson13806.c b/hw/kdrive/epson/epson13806.c index cb00890a7..6cf8c9ad9 100644 --- a/hw/kdrive/epson/epson13806.c +++ b/hw/kdrive/epson/epson13806.c @@ -331,7 +331,7 @@ epsonCreateColormap (ColormapPtr pmap) case FB_VISUAL_STATIC_PSEUDOCOLOR: pVisual = pmap->pVisual; nent = pVisual->ColormapEntries; - pdefs = ALLOCATE_LOCAL (nent * sizeof (xColorItem)); + pdefs = xalloc (nent * sizeof (xColorItem)); if (!pdefs) return FALSE; for (i = 0; i < nent; i++) @@ -343,7 +343,7 @@ epsonCreateColormap (ColormapPtr pmap) pmap->red[i].co.local.green = pdefs[i].green; pmap->red[i].co.local.blue = pdefs[i].blue; } - DEALLOCATE_LOCAL (pdefs); + xfree (pdefs); return TRUE; default: diff --git a/hw/kdrive/fbdev/fbdev.c b/hw/kdrive/fbdev/fbdev.c index 6e8b3ff5e..177be0bdc 100644 --- a/hw/kdrive/fbdev/fbdev.c +++ b/hw/kdrive/fbdev/fbdev.c @@ -598,7 +598,7 @@ fbdevCreateColormap (ColormapPtr pmap) case FB_VISUAL_STATIC_PSEUDOCOLOR: pVisual = pmap->pVisual; nent = pVisual->ColormapEntries; - pdefs = ALLOCATE_LOCAL (nent * sizeof (xColorItem)); + pdefs = xalloc (nent * sizeof (xColorItem)); if (!pdefs) return FALSE; for (i = 0; i < nent; i++) @@ -610,7 +610,7 @@ fbdevCreateColormap (ColormapPtr pmap) pmap->red[i].co.local.green = pdefs[i].green; pmap->red[i].co.local.blue = pdefs[i].blue; } - DEALLOCATE_LOCAL (pdefs); + xfree (pdefs); return TRUE; default: return fbInitializeColormap (pmap); diff --git a/hw/kdrive/igs/igsdraw.c b/hw/kdrive/igs/igsdraw.c index e1ff2befc..677436be5 100644 --- a/hw/kdrive/igs/igsdraw.c +++ b/hw/kdrive/igs/igsdraw.c @@ -553,12 +553,12 @@ igsFillSpans (DrawablePtr pDrawable, GCPtr pGC, int n, return; } nTmp = n * miFindMaxBand(fbGetCompositeClip(pGC)); - pwidthFree = (int *)ALLOCATE_LOCAL(nTmp * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(nTmp * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(nTmp * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(nTmp * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } n = miClipSpans(fbGetCompositeClip(pGC), @@ -607,8 +607,8 @@ igsFillSpans (DrawablePtr pDrawable, GCPtr pGC, int n, _igsPatRect(cop,x,y,width,1,cmd); } } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); KdMarkSync (pDrawable->pScreen); } diff --git a/hw/kdrive/nvidia/nvidiavideo.c b/hw/kdrive/nvidia/nvidiavideo.c index ad7147dd1..2ab41edfd 100644 --- a/hw/kdrive/nvidia/nvidiavideo.c +++ b/hw/kdrive/nvidia/nvidiavideo.c @@ -343,7 +343,7 @@ nvidiaPaintRegion (ScreenPtr pScreen, RegionPtr pRgn, Pixel fg) BoxPtr pBox = REGION_RECTS (pRgn); int nBox = REGION_NUM_RECTS (pRgn); - rects = ALLOCATE_LOCAL (nBox * sizeof (xRectangle)); + rects = xalloc (nBox * sizeof (xRectangle)); if (!rects) goto bail0; r = rects; @@ -372,7 +372,7 @@ nvidiaPaintRegion (ScreenPtr pScreen, RegionPtr pRgn, Pixel fg) FreeScratchGC (pGC); bail1: - DEALLOCATE_LOCAL (rects); + xfree (rects); bail0: ; } diff --git a/hw/kdrive/savage/s3draw.c b/hw/kdrive/savage/s3draw.c index 7b6543b4b..e2766df0f 100644 --- a/hw/kdrive/savage/s3draw.c +++ b/hw/kdrive/savage/s3draw.c @@ -519,7 +519,7 @@ s3PolyFillRect (DrawablePtr pDrawable, GCPtr pGC, numRects = REGION_NUM_RECTS(prgnClip) * nrectFill; if (numRects > NUM_STACK_RECTS) { - pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec)); + pboxClippedBase = (BoxPtr)xalloc(numRects * sizeof(BoxRec)); if (!pboxClippedBase) return; } @@ -637,7 +637,7 @@ s3PolyFillRect (DrawablePtr pDrawable, GCPtr pGC, pboxClippedBase); } if (pboxClippedBase != stackRects) - DEALLOCATE_LOCAL(pboxClippedBase); + xfree(pboxClippedBase); } void @@ -771,12 +771,12 @@ s3FillSpans (DrawablePtr pDrawable, GCPtr pGC, int n, else { nTmp = n * miFindMaxBand(pClip); - pwidthFree = (int *)ALLOCATE_LOCAL(nTmp * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(nTmp * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(nTmp * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(nTmp * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } n = miClipSpans(fbGetCompositeClip(pGC), @@ -820,8 +820,8 @@ s3FillSpans (DrawablePtr pDrawable, GCPtr pGC, int n, { _s3FillSpanLargeStipple (pDrawable, pGC, n, ppt, pwidth); } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } MarkSyncS3 (pDrawable->pScreen); } @@ -2449,12 +2449,12 @@ s3_24FillSpans (DrawablePtr pDrawable, GCPtr pGC, int n, else { nTmp = n * miFindMaxBand(pClip); - pwidthFree = (int *)ALLOCATE_LOCAL(nTmp * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(nTmp * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(nTmp * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(nTmp * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } n = miClipSpans(fbGetCompositeClip(pGC), @@ -2474,8 +2474,8 @@ s3_24FillSpans (DrawablePtr pDrawable, GCPtr pGC, int n, _s3SolidRect(s3,x*3,y,width*3,1); } } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } MarkSyncS3 (pDrawable->pScreen); } @@ -2610,7 +2610,7 @@ s3_24PolyFillRect (DrawablePtr pDrawable, GCPtr pGC, numRects = REGION_NUM_RECTS(prgnClip) * nrectFill; if (numRects > NUM_STACK_RECTS) { - pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec)); + pboxClippedBase = (BoxPtr)xalloc(numRects * sizeof(BoxRec)); if (!pboxClippedBase) return; } @@ -2718,7 +2718,7 @@ s3_24PolyFillRect (DrawablePtr pDrawable, GCPtr pGC, pGC->fgPixel, pGC->alu, pGC->planemask); } if (pboxClippedBase != stackRects) - DEALLOCATE_LOCAL(pboxClippedBase); + xfree(pboxClippedBase); } void diff --git a/hw/kdrive/sis530/sisdraw.c b/hw/kdrive/sis530/sisdraw.c index f2b39a477..595544348 100644 --- a/hw/kdrive/sis530/sisdraw.c +++ b/hw/kdrive/sis530/sisdraw.c @@ -1234,12 +1234,12 @@ sisFillSpans (DrawablePtr pDrawable, GCPtr pGC, int n, return; } nTmp = n * miFindMaxBand(fbGetCompositeClip(pGC)); - pwidthFree = (int *)ALLOCATE_LOCAL(nTmp * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(nTmp * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(nTmp * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(nTmp * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } n = miClipSpans(fbGetCompositeClip(pGC), @@ -1273,8 +1273,8 @@ sisFillSpans (DrawablePtr pDrawable, GCPtr pGC, int n, } } KdMarkSync (pDrawable->pScreen); - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } #define NUM_STACK_RECTS 1024 @@ -1323,7 +1323,7 @@ sisPolyFillRect (DrawablePtr pDrawable, GCPtr pGC, numRects = REGION_NUM_RECTS(prgnClip) * nrectFill; if (numRects > NUM_STACK_RECTS) { - pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec)); + pboxClippedBase = (BoxPtr)xalloc(numRects * sizeof(BoxRec)); if (!pboxClippedBase) return; } @@ -1448,7 +1448,7 @@ sisPolyFillRect (DrawablePtr pDrawable, GCPtr pGC, } } if (pboxClippedBase != stackRects) - DEALLOCATE_LOCAL(pboxClippedBase); + xfree(pboxClippedBase); } static const GCOps sisOps = { diff --git a/hw/kdrive/smi/smivideo.c b/hw/kdrive/smi/smivideo.c index 46593a0ee..f372498c0 100644 --- a/hw/kdrive/smi/smivideo.c +++ b/hw/kdrive/smi/smivideo.c @@ -342,7 +342,7 @@ mach64PaintRegion (ScreenPtr pScreen, RegionPtr pRgn, Pixel fg) BoxPtr pBox = REGION_RECTS (pRgn); int nBox = REGION_NUM_RECTS (pRgn); - rects = ALLOCATE_LOCAL (nBox * sizeof (xRectangle)); + rects = xalloc (nBox * sizeof (xRectangle)); if (!rects) goto bail0; r = rects; @@ -371,7 +371,7 @@ mach64PaintRegion (ScreenPtr pScreen, RegionPtr pRgn, Pixel fg) FreeScratchGC (pGC); bail1: - DEALLOCATE_LOCAL (rects); + xfree (rects); bail0: ; } diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c index b8fbd731b..046ab27b3 100644 --- a/hw/kdrive/src/kxv.c +++ b/hw/kdrive/src/kxv.c @@ -1927,7 +1927,7 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg) BoxPtr pBox = REGION_RECTS (pRgn); int nBox = REGION_NUM_RECTS (pRgn); - rects = ALLOCATE_LOCAL (nBox * sizeof (xRectangle)); + rects = xalloc (nBox * sizeof (xRectangle)); if (!rects) goto bail0; r = rects; @@ -1956,7 +1956,7 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg) FreeScratchGC (pGC); bail1: - DEALLOCATE_LOCAL (rects); + xfree (rects); bail0: ; } From 733d42065f2c24505b3874ce51c18f6063c2b67e Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:11:59 +0000 Subject: [PATCH 59/74] XFree86: Remove usage of alloca Replace with heap allocations. --- hw/xfree86/common/xf86Configure.c | 2 +- hw/xfree86/common/xf86sbusBus.c | 4 ++-- hw/xfree86/common/xf86xv.c | 4 ++-- hw/xfree86/dixmods/extmod/xf86vmode.c | 16 +++++++------- hw/xfree86/modes/xf86RandR12.c | 26 +++++++++++------------ hw/xfree86/shadowfb/shadow.c | 6 +++--- hw/xfree86/vgahw/vgaCmap.c | 12 +++++------ hw/xfree86/xaa/xaaBitBlt.c | 4 ++-- hw/xfree86/xaa/xaaCpyArea.c | 26 +++++++++++------------ hw/xfree86/xaa/xaaCpyWin.c | 4 ++-- hw/xfree86/xaa/xaaNonTEText.c | 4 ++-- hw/xfree86/xaa/xaaOverlay.c | 4 ++-- hw/xfree86/xaa/xaaOverlayDF.c | 8 +++---- hw/xfree86/xaa/xaaPCache.c | 16 +++++++------- hw/xfree86/xaa/xaaPict.c | 4 ++-- hw/xfree86/xaa/xaaTEGlyph.c | 8 +++---- hw/xfree86/xf4bpp/mfbimggblt.c | 4 ++-- hw/xfree86/xf4bpp/ppcCpArea.c | 30 +++++++++++++-------------- hw/xfree86/xf4bpp/ppcFillRct.c | 4 ++-- hw/xfree86/xf4bpp/ppcImg.c | 4 ++-- hw/xfree86/xf4bpp/ppcPixFS.c | 22 ++++++++++---------- hw/xfree86/xf4bpp/ppcWinFS.c | 22 ++++++++++---------- hw/xfree86/xf4bpp/ppcWindow.c | 6 +++--- hw/xfree86/xf8_32bpp/cfbcpyarea.c | 26 +++++++++++------------ hw/xfree86/xf8_32bpp/cfbwindow.c | 4 ++-- 25 files changed, 135 insertions(+), 135 deletions(-) diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index 4c980a291..f896c29aa 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -823,7 +823,7 @@ DoConfigure() homebuf[PATH_MAX-1] = '\0'; home = homebuf; if (!(filename = - (char *)ALLOCATE_LOCAL(strlen(home) + + (char *)xalloc(strlen(home) + strlen(configfile) + 3))) if (home[0] == '/' && home[1] == '\0') diff --git a/hw/xfree86/common/xf86sbusBus.c b/hw/xfree86/common/xf86sbusBus.c index 2e06ffac4..af2cd4a4c 100644 --- a/hw/xfree86/common/xf86sbusBus.c +++ b/hw/xfree86/common/xf86sbusBus.c @@ -622,7 +622,7 @@ xf86SbusCmapLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, int i, index; sbusCmapPtr cmap; struct fbcmap fbcmap; - unsigned char *data = ALLOCATE_LOCAL(numColors*3); + unsigned char *data = xalloc(numColors*3); cmap = SBUSCMAPPTR(pScrn->pScreen); if (!cmap) return; @@ -643,7 +643,7 @@ xf86SbusCmapLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, fbcmap.blue[fbcmap.count++] = colors[index].blue; } ioctl (cmap->psdp->fd, FBIOPUTCMAP, &fbcmap); - DEALLOCATE_LOCAL(data); + xfree(data); } static Bool diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index 6abe31c2f..eac0d7e2c 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -1856,7 +1856,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes) REGION_TRANSLATE(pDraw->pScreen, clipboxes, -pDraw->x, -pDraw->y); - rects = ALLOCATE_LOCAL(nbox * sizeof(xRectangle)); + rects = xalloc(nbox * sizeof(xRectangle)); for(i = 0; i < nbox; i++, pbox++) { rects[i].x = pbox->x1; @@ -1869,7 +1869,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes) if (!pPriv) FreeGC(pGC, 0); - DEALLOCATE_LOCAL(rects); + xfree(rects); } _X_EXPORT void diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c index 44ec9f11d..3b054a829 100644 --- a/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/hw/xfree86/dixmods/extmod/xf86vmode.c @@ -1323,14 +1323,14 @@ ProcXF86VidModeGetMonitor(ClientPtr client) rep.sequenceNumber = client->sequence; rep.nhsync = nHsync; rep.nvsync = nVrefresh; - hsyncdata = ALLOCATE_LOCAL(nHsync * sizeof(CARD32)); + hsyncdata = xalloc(nHsync * sizeof(CARD32)); if (!hsyncdata) { return BadAlloc; } - vsyncdata = ALLOCATE_LOCAL(nVrefresh * sizeof(CARD32)); + vsyncdata = xalloc(nVrefresh * sizeof(CARD32)); if (!vsyncdata) { - DEALLOCATE_LOCAL(hsyncdata); + xfree(hsyncdata); return BadAlloc; } @@ -1363,8 +1363,8 @@ ProcXF86VidModeGetMonitor(ClientPtr client) if (rep.modelLength) WriteToClient(client, rep.modelLength, (char *)(VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr); - DEALLOCATE_LOCAL(hsyncdata); - DEALLOCATE_LOCAL(vsyncdata); + xfree(hsyncdata); + xfree(vsyncdata); return (client->noClientException); } @@ -1448,11 +1448,11 @@ ProcXF86VidModeGetDotClocks(ClientPtr client) rep.flags = 0; if (!ClockProg) { - Clocks = ALLOCATE_LOCAL(numClocks * sizeof(int)); + Clocks = xalloc(numClocks * sizeof(int)); if (!Clocks) return BadValue; if (!VidModeGetClocks(stuff->screen, Clocks)) { - DEALLOCATE_LOCAL(Clocks); + xfree(Clocks); return BadValue; } } @@ -1479,7 +1479,7 @@ ProcXF86VidModeGetDotClocks(ClientPtr client) } } - DEALLOCATE_LOCAL(Clocks); + xfree(Clocks); return (client->noClientException); } diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 7169f74c8..fe21717f1 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -636,7 +636,7 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc) DisplayModePtr mode = &crtc->mode; Bool ret; - randr_outputs = ALLOCATE_LOCAL(config->num_output * sizeof (RROutputPtr)); + randr_outputs = xalloc(config->num_output * sizeof (RROutputPtr)); if (!randr_outputs) return FALSE; x = crtc->x; @@ -671,7 +671,7 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc) } ret = RRCrtcNotify (randr_crtc, randr_mode, x, y, rotation, numOutputs, randr_outputs); - DEALLOCATE_LOCAL(randr_outputs); + xfree(randr_outputs); return ret; } @@ -726,7 +726,7 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, xf86CrtcPtr *save_crtcs; Bool save_enabled = crtc->enabled; - save_crtcs = ALLOCATE_LOCAL(config->num_output * sizeof (xf86CrtcPtr)); + save_crtcs = xalloc(config->num_output * sizeof (xf86CrtcPtr)); if ((randr_mode != NULL) != crtc->enabled) changed = TRUE; else if (randr_mode && !xf86RandRModeMatches (randr_mode, &crtc->mode)) @@ -782,7 +782,7 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, xf86OutputPtr output = config->output[o]; output->crtc = save_crtcs[o]; } - DEALLOCATE_LOCAL(save_crtcs); + xfree(save_crtcs); return FALSE; } /* @@ -795,7 +795,7 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, } xf86DisableUnusedFunctions (pScrn); } - DEALLOCATE_LOCAL(save_crtcs); + xfree(save_crtcs); return xf86RandR12CrtcNotify (randr_crtc); } @@ -938,8 +938,8 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) RRCrtcPtr randr_crtc; int nclone; - clones = ALLOCATE_LOCAL(config->num_output * sizeof (RROutputPtr)); - crtcs = ALLOCATE_LOCAL (config->num_crtc * sizeof (RRCrtcPtr)); + clones = xalloc(config->num_output * sizeof (RROutputPtr)); + crtcs = xalloc (config->num_crtc * sizeof (RRCrtcPtr)); for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; @@ -956,8 +956,8 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) if (!RROutputSetCrtcs (output->randr_output, crtcs, ncrtc)) { - DEALLOCATE_LOCAL (crtcs); - DEALLOCATE_LOCAL (clones); + xfree (crtcs); + xfree (clones); return FALSE; } @@ -993,13 +993,13 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) } if (!RROutputSetClones (output->randr_output, clones, nclone)) { - DEALLOCATE_LOCAL (crtcs); - DEALLOCATE_LOCAL (clones); + xfree (crtcs); + xfree (clones); return FALSE; } } - DEALLOCATE_LOCAL (crtcs); - DEALLOCATE_LOCAL (clones); + xfree (crtcs); + xfree (clones); return TRUE; } diff --git a/hw/xfree86/shadowfb/shadow.c b/hw/xfree86/shadowfb/shadow.c index 3511a635e..52fdcbef6 100644 --- a/hw/xfree86/shadowfb/shadow.c +++ b/hw/xfree86/shadowfb/shadow.c @@ -1035,7 +1035,7 @@ ShadowPolyRectangle( offset1 = offset2 >> 1; offset3 = offset2 - offset1; - pBoxInit = (BoxPtr)ALLOCATE_LOCAL(nRects * 4 * sizeof(BoxRec)); + pBoxInit = (BoxPtr)xalloc(nRects * 4 * sizeof(BoxRec)); pbox = pBoxInit; while(nRects--) { @@ -1086,7 +1086,7 @@ ShadowPolyRectangle( if(pPriv->preRefresh) (*pPriv->preRefresh)(pPriv->pScrn, num, pBoxInit); } else { - DEALLOCATE_LOCAL(pBoxInit); + xfree(pBoxInit); } } } @@ -1098,7 +1098,7 @@ ShadowPolyRectangle( } else if(num) { if(pPriv->postRefresh) (*pPriv->postRefresh)(pPriv->pScrn, num, pBoxInit); - DEALLOCATE_LOCAL(pBoxInit); + xfree(pBoxInit); } SHADOW_GC_OP_EPILOGUE(pGC); diff --git a/hw/xfree86/vgahw/vgaCmap.c b/hw/xfree86/vgahw/vgaCmap.c index 609376a57..44043c6c7 100644 --- a/hw/xfree86/vgahw/vgaCmap.c +++ b/hw/xfree86/vgahw/vgaCmap.c @@ -236,9 +236,9 @@ vgaInstallColormap(pmap) else entries = pmap->pVisual->ColormapEntries; - ppix = (Pixel *)ALLOCATE_LOCAL( entries * sizeof(Pixel)); - prgb = (xrgb *)ALLOCATE_LOCAL( entries * sizeof(xrgb)); - defs = (xColorItem *)ALLOCATE_LOCAL(entries * sizeof(xColorItem)); + ppix = (Pixel *)xalloc( entries * sizeof(Pixel)); + prgb = (xrgb *)xalloc( entries * sizeof(xrgb)); + defs = (xColorItem *)xalloc(entries * sizeof(xColorItem)); if ( oldmap != NOMAPYET) WalkTree( pmap->pScreen, TellLostMap, &oldmap->mid); @@ -261,9 +261,9 @@ vgaInstallColormap(pmap) WalkTree(pmap->pScreen, TellGainedMap, &pmap->mid); - DEALLOCATE_LOCAL(ppix); - DEALLOCATE_LOCAL(prgb); - DEALLOCATE_LOCAL(defs); + xfree(ppix); + xfree(prgb); + xfree(defs); } diff --git a/hw/xfree86/xaa/xaaBitBlt.c b/hw/xfree86/xaa/xaaBitBlt.c index 6c81f6413..ebba74e55 100644 --- a/hw/xfree86/xaa/xaaBitBlt.c +++ b/hw/xfree86/xaa/xaaBitBlt.c @@ -186,7 +186,7 @@ XAABitBlt( /* Do bit blitting */ numRects = REGION_NUM_RECTS(&rgnDst); if (numRects && width && height) { - if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects * + if(!(pptSrc = (DDXPointPtr)xalloc(numRects * sizeof(DDXPointRec)))) { REGION_UNINIT(pGC->pScreen, &rgnDst); if (freeSrcClip) @@ -201,7 +201,7 @@ XAABitBlt( } (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC, &rgnDst, pptSrc); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); } prgnExposed = NULL; diff --git a/hw/xfree86/xaa/xaaCpyArea.c b/hw/xfree86/xaa/xaaCpyArea.c index 89b4441ab..6c991e100 100644 --- a/hw/xfree86/xaa/xaaCpyArea.c +++ b/hw/xfree86/xaa/xaaCpyArea.c @@ -108,12 +108,12 @@ XAADoBitBlt( if (nbox > 1) { /* keep ordering in each band, reverse order of bands */ - pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); + pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); if(!pboxNew1) return; - pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); if(!pptNew1) { - DEALLOCATE_LOCAL(pboxNew1); + xfree(pboxNew1); return; } pboxBase = pboxNext = pbox+nbox-1; @@ -145,14 +145,14 @@ XAADoBitBlt( if (nbox > 1) { /* reverse order of rects in each band */ - pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); - pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); + pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); if(!pboxNew2 || !pptNew2) { - if (pptNew2) DEALLOCATE_LOCAL(pptNew2); - if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2); + if (pptNew2) xfree(pptNew2); + if (pboxNew2) xfree(pboxNew2); if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); + xfree(pptNew1); + xfree(pboxNew1); } return; } @@ -183,12 +183,12 @@ XAADoBitBlt( xdir, ydir, pGC->alu, pGC->planemask); if (pboxNew2) { - DEALLOCATE_LOCAL(pptNew2); - DEALLOCATE_LOCAL(pboxNew2); + xfree(pptNew2); + xfree(pboxNew2); } if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); + xfree(pptNew1); + xfree(pboxNew1); } } diff --git a/hw/xfree86/xaa/xaaCpyWin.c b/hw/xfree86/xaa/xaaCpyWin.c index 1ff955c6c..ecdc9a3be 100644 --- a/hw/xfree86/xaa/xaaCpyWin.c +++ b/hw/xfree86/xaa/xaaCpyWin.c @@ -59,7 +59,7 @@ XAACopyWindow( pbox = REGION_RECTS(&rgnDst); nbox = REGION_NUM_RECTS(&rgnDst); if(!nbox || - !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) { + !(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) { REGION_UNINIT(pScreen, &rgnDst); return; } @@ -77,6 +77,6 @@ XAACopyWindow( XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, &(infoRec->ScratchGC), &rgnDst, pptSrc); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); REGION_UNINIT(pScreen, &rgnDst); } diff --git a/hw/xfree86/xaa/xaaNonTEText.c b/hw/xfree86/xaa/xaaNonTEText.c index a5608c922..d4661e879 100644 --- a/hw/xfree86/xaa/xaaNonTEText.c +++ b/hw/xfree86/xaa/xaaNonTEText.c @@ -291,7 +291,7 @@ PolyGlyphBltAsSingleBitmap ( pitch = (Right - Left + 31) >> 5; size = (pitch << 2) * (Bottom - Top); - block = (CARD32*)ALLOCATE_LOCAL(size); + block = (CARD32*)xalloc(size); bzero(block, size); topLine = 10000; botLine = -10000; @@ -350,7 +350,7 @@ PolyGlyphBltAsSingleBitmap ( nbox--; pbox++; } - DEALLOCATE_LOCAL(block); + xfree(block); } static void diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c index 86b30ff22..273183e10 100644 --- a/hw/xfree86/xaa/xaaOverlay.c +++ b/hw/xfree86/xaa/xaaOverlay.c @@ -69,7 +69,7 @@ XAACopyWindow8_32( pbox = REGION_RECTS(&rgnDst); nbox = REGION_NUM_RECTS(&rgnDst); if(!nbox || - !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) { + !(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) { REGION_UNINIT(pScreen, &rgnDst); return; } @@ -87,7 +87,7 @@ XAACopyWindow8_32( XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, &(infoRec->ScratchGC), &rgnDst, pptSrc); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); REGION_UNINIT(pScreen, &rgnDst); if(freeReg) REGION_DESTROY(pScreen, borderClip); diff --git a/hw/xfree86/xaa/xaaOverlayDF.c b/hw/xfree86/xaa/xaaOverlayDF.c index bf910982a..47599d7d3 100644 --- a/hw/xfree86/xaa/xaaOverlayDF.c +++ b/hw/xfree86/xaa/xaaOverlayDF.c @@ -358,7 +358,7 @@ XAAOverCopyWindow( nbox = REGION_NUM_RECTS(&rgnDst); if(nbox && - (pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) { + (pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) { pbox = REGION_RECTS(&rgnDst); for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) { @@ -376,7 +376,7 @@ XAAOverCopyWindow( &(infoRec->ScratchGC), &rgnDst, pptSrc); } - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); } REGION_UNINIT(pScreen, &rgnDst); @@ -388,7 +388,7 @@ XAAOverCopyWindow( REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc); nbox = REGION_NUM_RECTS(&rgnDst); if(nbox && - (pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))){ + (pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))){ pbox = REGION_RECTS(&rgnDst); for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) { @@ -399,7 +399,7 @@ XAAOverCopyWindow( SWITCH_DEPTH(pScrn->depth); XAADoBitBlt((DrawablePtr)pRoot, (DrawablePtr)pRoot, &(infoRec->ScratchGC), &rgnDst, pptSrc); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); } } REGION_UNINIT(pScreen, &rgnDst); diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c index 441788cd8..d05aaf22c 100644 --- a/hw/xfree86/xaa/xaaPCache.c +++ b/hw/xfree86/xaa/xaaPCache.c @@ -1557,7 +1557,7 @@ XAACacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix) pad = BitmapBytePad(pCache->w * bpp); dwords = pad >> 2; - dstPtr = data = (unsigned char*)ALLOCATE_LOCAL(pad * pCache->h); + dstPtr = data = (unsigned char*)xalloc(pad * pCache->h); srcPtr = (unsigned char*)pPix->devPrivate.ptr; if(infoRec->ScreenToScreenColorExpandFillFlags & BIT_ORDER_IN_BYTE_MSBFIRST) @@ -1588,7 +1588,7 @@ XAACacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix) pScrn, pCache->x, pCache->y, pCache->w, pCache->h, data, pad, bpp, pScrn->depth); - DEALLOCATE_LOCAL(data); + xfree(data); return pCache; } @@ -1967,7 +1967,7 @@ XAAWriteMono8x8PatternToCache( pad = BitmapBytePad(pCache->w * pScrn->bitsPerPixel); - data = (unsigned char*)ALLOCATE_LOCAL(pad * pCache->h); + data = (unsigned char*)xalloc(pad * pCache->h); if(!data) return; if(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_ORIGIN) { @@ -1991,7 +1991,7 @@ XAAWriteMono8x8PatternToCache( (*infoRec->WritePixmapToCache)(pScrn, pCache->x, pCache->y, pCache->w, pCache->h, data, pad, pScrn->bitsPerPixel, pScrn->depth); - DEALLOCATE_LOCAL(data); + xfree(data); } void @@ -2012,7 +2012,7 @@ XAAWriteColor8x8PatternToCache( if(pixPriv->flags & REDUCIBLE_TO_2_COLOR) { CARD32* ptr; pad = BitmapBytePad(pCache->w); - data = (unsigned char*)ALLOCATE_LOCAL(pad * pCache->h); + data = (unsigned char*)xalloc(pad * pCache->h); if(!data) return; if(infoRec->Color8x8PatternFillFlags & @@ -2037,7 +2037,7 @@ XAAWriteColor8x8PatternToCache( (*infoRec->WriteBitmapToCache)(pScrn, pCache->x, pCache->y, pCache->w, pCache->h, data, pad, pCache->fg, pCache->bg); - DEALLOCATE_LOCAL(data); + xfree(data); return; } @@ -2046,7 +2046,7 @@ XAAWriteColor8x8PatternToCache( w = min(8,pPix->drawable.width); pad = BitmapBytePad(pCache->w * pScrn->bitsPerPixel); - data = (unsigned char*)ALLOCATE_LOCAL(pad * pCache->h); + data = (unsigned char*)xalloc(pad * pCache->h); if(!data) return; /* Write and expand horizontally. */ @@ -2085,7 +2085,7 @@ XAAWriteColor8x8PatternToCache( (*infoRec->WritePixmapToCache)(pScrn, pCache->x, pCache->y, pCache->w, pCache->h, data, pad, pScrn->bitsPerPixel, pScrn->depth); - DEALLOCATE_LOCAL(data); + xfree(data); } diff --git a/hw/xfree86/xaa/xaaPict.c b/hw/xfree86/xaa/xaaPict.c index 55f0f6e99..74e90e3b6 100644 --- a/hw/xfree86/xaa/xaaPict.c +++ b/hw/xfree86/xaa/xaaPict.c @@ -471,7 +471,7 @@ XAACompositeSrcCopy (PicturePtr pSrc, REGION_UNINIT(pScreen, ®ion); return; } - pptSrc = ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + pptSrc = xalloc(sizeof(DDXPointRec) * nbox); if (!pptSrc) { REGION_UNINIT(pScreen, ®ion); return; @@ -489,7 +489,7 @@ XAACompositeSrcCopy (PicturePtr pSrc, XAADoBitBlt(pSrc->pDrawable, pDst->pDrawable, &infoRec->ScratchGC, ®ion, pptSrc); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); REGION_UNINIT(pScreen, ®ion); return; } diff --git a/hw/xfree86/xaa/xaaTEGlyph.c b/hw/xfree86/xaa/xaaTEGlyph.c index c8d65968b..cb60266ea 100644 --- a/hw/xfree86/xaa/xaaTEGlyph.c +++ b/hw/xfree86/xaa/xaaTEGlyph.c @@ -301,7 +301,7 @@ EXPNAME(XAATEGlyphRenderer3)( } dwords = ((3 * w + 31) >> 5) * h; - mem = (CARD32*)ALLOCATE_LOCAL(((w + 31) >> 3) * sizeof(char)); + mem = (CARD32*)xalloc(((w + 31) >> 3) * sizeof(char)); if (!mem) return; (*infoRec->SubsequentCPUToScreenColorExpandFill)(pScrn, x, y, w, h, 0); @@ -321,7 +321,7 @@ EXPNAME(XAATEGlyphRenderer3)( DrawTextScanline3(base, mem, w); } - DEALLOCATE_LOCAL(mem); + xfree(mem); if((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) && (dwords & 1)) { @@ -478,7 +478,7 @@ EXPNAME(XAATEGlyphRendererScanline3)( w += skipleft; x -= skipleft; - mem = (CARD32*)ALLOCATE_LOCAL(((w + 31) >> 3) * sizeof(char)); + mem = (CARD32*)xalloc(((w + 31) >> 3) * sizeof(char)); if (!mem) return; (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)( @@ -495,7 +495,7 @@ EXPNAME(XAATEGlyphRendererScanline3)( bufferNo = 0; } - DEALLOCATE_LOCAL(mem); + xfree(mem); THE_END: diff --git a/hw/xfree86/xf4bpp/mfbimggblt.c b/hw/xfree86/xf4bpp/mfbimggblt.c index bf53f4ce9..73e7ce064 100644 --- a/hw/xfree86/xf4bpp/mfbimggblt.c +++ b/hw/xfree86/xf4bpp/mfbimggblt.c @@ -355,7 +355,7 @@ doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase,infop) int getWidth; /* bits to get from glyph */ #endif - if(!(ppos = (TEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(TEXTPOS)))) + if(!(ppos = (TEXTPOS *)xalloc(nglyph * sizeof(TEXTPOS)))) return; pdstBase = pdstBase + (widthDst * y) + (x >> PWSH); @@ -494,7 +494,7 @@ doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase,infop) } } /* for each glyph */ } /* while nbox-- */ - DEALLOCATE_LOCAL(ppos); + xfree(ppos); break; } default: diff --git a/hw/xfree86/xf4bpp/ppcCpArea.c b/hw/xfree86/xf4bpp/ppcCpArea.c index 891ba4b89..9bdaf89e3 100644 --- a/hw/xfree86/xf4bpp/ppcCpArea.c +++ b/hw/xfree86/xf4bpp/ppcCpArea.c @@ -110,13 +110,13 @@ vga16DoBitblt if (nbox > 1) { /* keep ordering in each band, reverse order of bands */ - pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); + pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); if(!pboxNew1) return; - pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); if(!pptNew1) { - DEALLOCATE_LOCAL(pboxNew1); + xfree(pboxNew1); return; } pboxBase = pboxNext = pbox+nbox-1; @@ -146,16 +146,16 @@ vga16DoBitblt if (nbox > 1) { /* reverse order of rects in each band */ - pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); - pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); + pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); if(!pboxNew2 || !pptNew2) { - if (pptNew2) DEALLOCATE_LOCAL(pptNew2); - if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2); + if (pptNew2) xfree(pptNew2); + if (pboxNew2) xfree(pboxNew2); if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); + xfree(pptNew1); + xfree(pboxNew1); } return; } @@ -207,13 +207,13 @@ vga16DoBitblt } if (pboxNew2) { - DEALLOCATE_LOCAL(pptNew2); - DEALLOCATE_LOCAL(pboxNew2); + xfree(pptNew2); + xfree(pboxNew2); } if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); + xfree(pptNew1); + xfree(pboxNew1); } } @@ -430,7 +430,7 @@ int dstx, dsty; numRects = REGION_NUM_RECTS(&rgnDst); if (numRects && width && height) { - if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects * + if(!(pptSrc = (DDXPointPtr)xalloc(numRects * sizeof(DDXPointRec)))) { REGION_UNINIT(pGC->pScreen, &rgnDst); @@ -448,7 +448,7 @@ int dstx, dsty; vga16DoBitblt(pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask ); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); } prgnExposed = NULL; diff --git a/hw/xfree86/xf4bpp/ppcFillRct.c b/hw/xfree86/xf4bpp/ppcFillRct.c index 4be732fb5..3422c8092 100644 --- a/hw/xfree86/xf4bpp/ppcFillRct.c +++ b/hw/xfree86/xf4bpp/ppcFillRct.c @@ -106,7 +106,7 @@ xf4bppPolyFillRect(pDrawable, pGC, nrectFill, prectInit) numRects = REGION_NUM_RECTS(prgnClip) * nrectFill; if (numRects > NUM_STACK_RECTS) { - pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec)); + pboxClippedBase = (BoxPtr)xalloc(numRects * sizeof(BoxRec)); if (!pboxClippedBase) return; } @@ -211,5 +211,5 @@ xf4bppPolyFillRect(pDrawable, pGC, nrectFill, prectInit) xf4bppFillArea((WindowPtr)pDrawable, pboxClipped-pboxClippedBase, pboxClippedBase, pGC); if (pboxClippedBase != stackRects) - DEALLOCATE_LOCAL(pboxClippedBase); + xfree(pboxClippedBase); } diff --git a/hw/xfree86/xf4bpp/ppcImg.c b/hw/xfree86/xf4bpp/ppcImg.c index 39d39c4a9..33c6b89c5 100644 --- a/hw/xfree86/xf4bpp/ppcImg.c +++ b/hw/xfree86/xf4bpp/ppcImg.c @@ -86,7 +86,7 @@ xf4bppGetImage( pDraw, sx, sy, w, h, format, planeMask, pdstLine ) DoChangeGC( pGC, GCPlaneMask | GCFunction, gcv, 0 ) ; ValidateGC( (DrawablePtr)pPixmap, pGC ) ; - pbits = (char *)ALLOCATE_LOCAL(w); + pbits = (char *)xalloc(w); for ( i = 0 ; i < h ; i++ ) { pt.x = sx ; @@ -102,7 +102,7 @@ xf4bppGetImage( pDraw, sx, sy, w, h, format, planeMask, pdstLine ) pDst += linelength ; } - DEALLOCATE_LOCAL(pbits) ; + xfree(pbits) ; (* pGC->pScreen->DestroyPixmap)( pPixmap ) ; FreeScratchGC( pGC ) ; return ; diff --git a/hw/xfree86/xf4bpp/ppcPixFS.c b/hw/xfree86/xf4bpp/ppcPixFS.c index f24168bb0..dfc648660 100644 --- a/hw/xfree86/xf4bpp/ppcPixFS.c +++ b/hw/xfree86/xf4bpp/ppcPixFS.c @@ -128,13 +128,13 @@ xf4bppSolidPixmapFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) return ; n = nInit * miFindMaxBand(pGC->pCompositeClip) ; - if ( !( pwidthFree = (int *) ALLOCATE_LOCAL( n * sizeof( int ) ) ) ) + if ( !( pwidthFree = (int *) xalloc( n * sizeof( int ) ) ) ) return ; pwidth = pwidthFree ; if ( !( pptFree = (DDXPointRec *) - ALLOCATE_LOCAL( n * sizeof( DDXPointRec ) ) ) ) { - DEALLOCATE_LOCAL( pwidth ) ; + xalloc( n * sizeof( DDXPointRec ) ) ) ) { + xfree( pwidth ) ; return ; } ppt = pptFree ; @@ -160,8 +160,8 @@ xf4bppSolidPixmapFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) *addrl = ( *addrl & npm ) | ( pm & DoRop( alu, fg, *addrl ) ) ; #endif /* PURDUE */ } - DEALLOCATE_LOCAL( pptFree ) ; - DEALLOCATE_LOCAL( pwidthFree ) ; + xfree( pptFree ) ; + xfree( pwidthFree ) ; return ; } @@ -316,8 +316,8 @@ int fSorted ; ppt++ ; pwidth++ ; } - DEALLOCATE_LOCAL( pptFree ) ; - DEALLOCATE_LOCAL( pwidthFree ) ; + xfree( pptFree ) ; + xfree( pwidthFree ) ; return ; } @@ -416,8 +416,8 @@ int fSorted ; #endif /* PURDUE */ } } - DEALLOCATE_LOCAL( pptFree ) ; - DEALLOCATE_LOCAL( pwidthFree ) ; + xfree( pptFree ) ; + xfree( pwidthFree ) ; return ; } @@ -496,7 +496,7 @@ int fSorted ; #endif /* PURDUE */ } } - DEALLOCATE_LOCAL( pptFree ) ; - DEALLOCATE_LOCAL( pwidthFree ) ; + xfree( pptFree ) ; + xfree( pwidthFree ) ; return ; } diff --git a/hw/xfree86/xf4bpp/ppcWinFS.c b/hw/xfree86/xf4bpp/ppcWinFS.c index e19ce0d40..78001d793 100644 --- a/hw/xfree86/xf4bpp/ppcWinFS.c +++ b/hw/xfree86/xf4bpp/ppcWinFS.c @@ -100,13 +100,13 @@ xf4bppSolidWindowFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) return ; n = nInit * miFindMaxBand( pGC->pCompositeClip ) ; - if ( !( pwidthFree = (int *) ALLOCATE_LOCAL( n * sizeof( int ) ) ) ) + if ( !( pwidthFree = (int *) xalloc( n * sizeof( int ) ) ) ) return ; pwidth = pwidthFree ; if ( !( pptFree = (DDXPointRec *) - ALLOCATE_LOCAL( n * sizeof( DDXPointRec ) ) ) ) { - DEALLOCATE_LOCAL( pwidth ) ; + xalloc( n * sizeof( DDXPointRec ) ) ) ) { + xfree( pwidth ) ; return ; } ppt = pptFree ; @@ -122,8 +122,8 @@ xf4bppSolidWindowFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) xf4bppFillSolid( (WindowPtr)pDrawable, fg, alu, pm, ppt->x, ppt->y, *pwidth, 1 ) ; - DEALLOCATE_LOCAL( pptFree ) ; - DEALLOCATE_LOCAL( pwidthFree ) ; + xfree( pptFree ) ; + xfree( pwidthFree ) ; return ; } @@ -180,8 +180,8 @@ int fSorted ; xf4bppFillStipple( (WindowPtr)pDrawable, pTile, fg, alu, pm, ppt->x, ppt->y, *pwidth, 1, xSrc, ySrc ) ; - DEALLOCATE_LOCAL( pptFree ) ; - DEALLOCATE_LOCAL( pwidthFree ) ; + xfree( pptFree ) ; + xfree( pwidthFree ) ; return ; } @@ -232,8 +232,8 @@ int fSorted ; xf4bppOpaqueStipple( (WindowPtr)pDrawable, pGC->stipple, fg, bg, alu, pm, ppt->x, ppt->y, *pwidth, 1, xSrc, ySrc ) ; - DEALLOCATE_LOCAL( pptFree ) ; - DEALLOCATE_LOCAL( pwidthFree ) ; + xfree( pptFree ) ; + xfree( pwidthFree ) ; return ; } @@ -274,7 +274,7 @@ int fSorted ; xf4bppTileRect( (WindowPtr)pDrawable, pGC->tile.pixmap, alu, pm, ppt->x, ppt->y, *pwidth, 1, xSrc, ySrc ) ; - DEALLOCATE_LOCAL( pptFree ) ; - DEALLOCATE_LOCAL( pwidthFree ) ; + xfree( pptFree ) ; + xfree( pwidthFree ) ; return ; } diff --git a/hw/xfree86/xf4bpp/ppcWindow.c b/hw/xfree86/xf4bpp/ppcWindow.c index 8261af183..6165e04b6 100644 --- a/hw/xfree86/xf4bpp/ppcWindow.c +++ b/hw/xfree86/xf4bpp/ppcWindow.c @@ -123,7 +123,7 @@ xf4bppCopyWindow(pWin, ptOldOrg, prgnSrc) /* walk source bottom to top */ /* keep ordering in each band, reverse order of bands */ if ( !( pboxNew = - (BoxPtr) ALLOCATE_LOCAL( sizeof( BoxRec ) * nbox ) ) ) + (BoxPtr) xalloc( sizeof( BoxRec ) * nbox ) ) ) return ; pboxBase = pboxNext = pbox+nbox - 1 ; while ( pboxBase >= pbox ) { @@ -158,7 +158,7 @@ xf4bppCopyWindow(pWin, ptOldOrg, prgnSrc) else if ( dx < 0 ) { /* walk source right to left */ /* reverse order of rects in each band */ - if ( !( pboxNew = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox) ) ) + if ( !( pboxNew = (BoxPtr)xalloc(sizeof(BoxRec) * nbox) ) ) return ; pboxBase = pboxNext = pbox ; while (pboxBase < pbox+nbox) @@ -190,7 +190,7 @@ xf4bppCopyWindow(pWin, ptOldOrg, prgnSrc) /* free up stuff */ if ( pboxNew ) - DEALLOCATE_LOCAL( pboxNew ) ; + xfree( pboxNew ) ; REGION_DESTROY(pWin->drawable.pScreen, prgnDst); } diff --git a/hw/xfree86/xf8_32bpp/cfbcpyarea.c b/hw/xfree86/xf8_32bpp/cfbcpyarea.c index c2eb1a04e..d8f0c6d76 100644 --- a/hw/xfree86/xf8_32bpp/cfbcpyarea.c +++ b/hw/xfree86/xf8_32bpp/cfbcpyarea.c @@ -433,12 +433,12 @@ cfb8_32DoBitBlt( if (nbox > 1) { /* keep ordering in each band, reverse order of bands */ - pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); + pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); if(!pboxNew1) return; - pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); if(!pptNew1) { - DEALLOCATE_LOCAL(pboxNew1); + xfree(pboxNew1); return; } pboxBase = pboxNext = pbox+nbox-1; @@ -470,14 +470,14 @@ cfb8_32DoBitBlt( if (nbox > 1) { /* reverse order of rects in each band */ - pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); - pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); + pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); if(!pboxNew2 || !pptNew2) { - if (pptNew2) DEALLOCATE_LOCAL(pptNew2); - if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2); + if (pptNew2) xfree(pptNew2); + if (pboxNew2) xfree(pboxNew2); if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); + xfree(pptNew1); + xfree(pboxNew1); } return; } @@ -510,12 +510,12 @@ cfb8_32DoBitBlt( (*DoBlt)(SrcPtr,SrcPitch,DstPtr,DstPitch,nbox,pptSrc,pbox,xdir,ydir); if (pboxNew2) { - DEALLOCATE_LOCAL(pptNew2); - DEALLOCATE_LOCAL(pboxNew2); + xfree(pptNew2); + xfree(pboxNew2); } if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); + xfree(pptNew1); + xfree(pboxNew1); } } diff --git a/hw/xfree86/xf8_32bpp/cfbwindow.c b/hw/xfree86/xf8_32bpp/cfbwindow.c index 787cbdec6..2e6057f12 100644 --- a/hw/xfree86/xf8_32bpp/cfbwindow.c +++ b/hw/xfree86/xf8_32bpp/cfbwindow.c @@ -77,7 +77,7 @@ cfb8_32CopyWindow(pWin, ptOldOrg, prgnSrc) pbox = REGION_RECTS(&rgnDst); nbox = REGION_NUM_RECTS(&rgnDst); if(!nbox || - !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) + !(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) { REGION_UNINIT(pScreen, &rgnDst); return; @@ -97,7 +97,7 @@ cfb8_32CopyWindow(pWin, ptOldOrg, prgnSrc) cfbDoBitblt8To8GXcopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, GXcopy, &rgnDst, pptSrc, ~0); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); REGION_UNINIT(pScreen, &rgnDst); if(freeReg) REGION_DESTROY(pScreen, borderClip); From 34cdf06e4ccb243664005cc33009d8759a7f6e4d Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:12:22 +0000 Subject: [PATCH 60/74] fb: Remove usage of alloca Replace with heap storage. --- fb/fbcopy.c | 10 +++++----- fb/fbpseudocolor.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fb/fbcopy.c b/fb/fbcopy.c index 68f403f3f..b8b0b6a8c 100644 --- a/fb/fbcopy.c +++ b/fb/fbcopy.c @@ -326,7 +326,7 @@ fbCopyRegion (DrawablePtr pSrcDrawable, if (nbox > 1) { /* keep ordering in each band, reverse order of bands */ - pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); + pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); if(!pboxNew1) return; pboxBase = pboxNext = pbox+nbox-1; @@ -363,11 +363,11 @@ fbCopyRegion (DrawablePtr pSrcDrawable, if (nbox > 1) { /* reverse order of rects in each band */ - pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); + pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); if(!pboxNew2) { if (pboxNew1) - DEALLOCATE_LOCAL(pboxNew1); + xfree(pboxNew1); return; } pboxBase = pboxNext = pbox; @@ -402,9 +402,9 @@ fbCopyRegion (DrawablePtr pSrcDrawable, reverse, upsidedown, bitPlane, closure); if (pboxNew1) - DEALLOCATE_LOCAL (pboxNew1); + xfree (pboxNew1); if (pboxNew2) - DEALLOCATE_LOCAL (pboxNew2); + xfree (pboxNew2); } RegionPtr diff --git a/fb/fbpseudocolor.c b/fb/fbpseudocolor.c index a15697d43..8a48c3819 100644 --- a/fb/fbpseudocolor.c +++ b/fb/fbpseudocolor.c @@ -500,7 +500,7 @@ xxStoreColors(ColormapPtr pmap, int nColors, xColorItem *pColors) DBG("StoreColors\n"); - expanddefs = ALLOCATE_LOCAL(sizeof(xColorItem) + expanddefs = xalloc(sizeof(xColorItem) * (1 << pScrPriv->myDepth)); if (!expanddefs) return; @@ -527,7 +527,7 @@ xxStoreColors(ColormapPtr pmap, int nColors, xColorItem *pColors) pColors++; } - DEALLOCATE_LOCAL(expanddefs); + xfree(expanddefs); pCmapPriv->dirty = TRUE; pScrPriv->colormapDirty = TRUE; @@ -565,9 +565,9 @@ xxInstallColormap(ColormapPtr pmap) wrap(pScrPriv,pmap->pScreen,InstallColormap,xxInstallColormap); } - pixels = ALLOCATE_LOCAL(sizeof(Pixel) * (1 << pScrPriv->myDepth)); - colors = ALLOCATE_LOCAL(sizeof(xrgb) * (1 << pScrPriv->myDepth)); - defs = ALLOCATE_LOCAL(sizeof(xColorItem) * (1 << pScrPriv->myDepth)); + pixels = xalloc(sizeof(Pixel) * (1 << pScrPriv->myDepth)); + colors = xalloc(sizeof(xrgb) * (1 << pScrPriv->myDepth)); + defs = xalloc(sizeof(xColorItem) * (1 << pScrPriv->myDepth)); if (!pixels || !colors) return; @@ -595,9 +595,9 @@ xxInstallColormap(ColormapPtr pmap) } xxStoreColors(pmap,(1 << pScrPriv->myDepth),defs); - DEALLOCATE_LOCAL(pixels); - DEALLOCATE_LOCAL(colors); - DEALLOCATE_LOCAL(defs); + xfree(pixels); + xfree(colors); + xfree(defs); return; } From 3b77689266e729411229ec83d2a90578ebc1d82f Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:12:34 +0000 Subject: [PATCH 61/74] EXA: Remove usage of alloca Replace with heap allocations. --- exa/exa_accel.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/exa/exa_accel.c b/exa/exa_accel.c index 5fb72d71b..6314b97f0 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -619,7 +619,7 @@ exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, return; } - prect = ALLOCATE_LOCAL(sizeof(xRectangle) * npt); + prect = xalloc(sizeof(xRectangle) * npt); for (i = 0; i < npt; i++) { prect[i].x = ppt[i].x; prect[i].y = ppt[i].y; @@ -631,7 +631,7 @@ exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, prect[i].height = 1; } pGC->ops->PolyFillRect(pDrawable, pGC, npt, prect); - DEALLOCATE_LOCAL(prect); + xfree(prect); } /** @@ -654,7 +654,7 @@ exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, return; } - prect = ALLOCATE_LOCAL(sizeof(xRectangle) * (npt - 1)); + prect = xalloc(sizeof(xRectangle) * (npt - 1)); x1 = ppt[0].x; y1 = ppt[0].y; /* If we have any non-horizontal/vertical, fall back. */ @@ -668,7 +668,7 @@ exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, } if (x1 != x2 && y1 != y2) { - DEALLOCATE_LOCAL(prect); + xfree(prect); ExaCheckPolylines(pDrawable, pGC, mode, npt, ppt); return; } @@ -692,7 +692,7 @@ exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, y1 = y2; } pGC->ops->PolyFillRect(pDrawable, pGC, npt - 1, prect); - DEALLOCATE_LOCAL(prect); + xfree(prect); } /** @@ -723,7 +723,7 @@ exaPolySegment (DrawablePtr pDrawable, GCPtr pGC, int nseg, } } - prect = ALLOCATE_LOCAL(sizeof(xRectangle) * nseg); + prect = xalloc(sizeof(xRectangle) * nseg); for (i = 0; i < nseg; i++) { if (pSeg[i].x1 < pSeg[i].x2) { prect[i].x = pSeg[i].x1; @@ -741,7 +741,7 @@ exaPolySegment (DrawablePtr pDrawable, GCPtr pGC, int nseg, } } pGC->ops->PolyFillRect(pDrawable, pGC, nseg, prect); - DEALLOCATE_LOCAL(prect); + xfree(prect); } static Bool exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion, From 914922fd6100a409a3dfd1c64511ed6bdc344bef Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:12:59 +0000 Subject: [PATCH 62/74] DIX: Remove usage of alloca Replace with heap allocations. --- dix/colormap.c | 40 ++++++++++++++++++++-------------------- dix/devices.c | 4 ++-- dix/dixfonts.c | 8 ++++---- dix/extension.c | 4 ++-- dix/grabs.c | 24 ++++++++++++------------ dix/property.c | 16 ++++++++-------- dix/resource.c | 6 +++--- dix/swaprep.c | 12 ++++++------ 8 files changed, 57 insertions(+), 57 deletions(-) diff --git a/dix/colormap.c b/dix/colormap.c index 73b666971..b27b8bc67 100644 --- a/dix/colormap.c +++ b/dix/colormap.c @@ -751,7 +751,7 @@ UpdateColors (ColormapPtr pmap) pVisual = pmap->pVisual; size = pVisual->ColormapEntries; - defs = (xColorItem *)ALLOCATE_LOCAL(size * sizeof(xColorItem)); + defs = (xColorItem *)xalloc(size * sizeof(xColorItem)); if (!defs) return; n = 0; @@ -801,7 +801,7 @@ UpdateColors (ColormapPtr pmap) } if (n) (*pmap->pScreen->StoreColors)(pmap, n, defs); - DEALLOCATE_LOCAL(defs); + xfree(defs); } /* Get a read-only color from a ColorMap (probably slow for large maps) @@ -1752,14 +1752,14 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont for(p = pixels; p < pixels + c; p++) *p = 0; - ppixRed = (Pixel *)ALLOCATE_LOCAL(npixR * sizeof(Pixel)); - ppixGreen = (Pixel *)ALLOCATE_LOCAL(npixG * sizeof(Pixel)); - ppixBlue = (Pixel *)ALLOCATE_LOCAL(npixB * sizeof(Pixel)); + ppixRed = (Pixel *)xalloc(npixR * sizeof(Pixel)); + ppixGreen = (Pixel *)xalloc(npixG * sizeof(Pixel)); + ppixBlue = (Pixel *)xalloc(npixB * sizeof(Pixel)); if (!ppixRed || !ppixGreen || !ppixBlue) { - if (ppixBlue) DEALLOCATE_LOCAL(ppixBlue); - if (ppixGreen) DEALLOCATE_LOCAL(ppixGreen); - if (ppixRed) DEALLOCATE_LOCAL(ppixRed); + if (ppixBlue) xfree(ppixBlue); + if (ppixGreen) xfree(ppixGreen); + if (ppixRed) xfree(ppixRed); return(BadAlloc); } @@ -1797,9 +1797,9 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont if (okB) for(ppix = ppixBlue, npix = npixB; --npix >= 0; ppix++) pmap->blue[*ppix].refcnt = 0; - DEALLOCATE_LOCAL(ppixBlue); - DEALLOCATE_LOCAL(ppixGreen); - DEALLOCATE_LOCAL(ppixRed); + xfree(ppixBlue); + xfree(ppixGreen); + xfree(ppixRed); return(BadAlloc); } @@ -1841,9 +1841,9 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont for (pDst = pixels; pDst < pixels + c; pDst++) *pDst |= ALPHAMASK(pmap->pVisual); - DEALLOCATE_LOCAL(ppixBlue); - DEALLOCATE_LOCAL(ppixGreen); - DEALLOCATE_LOCAL(ppixRed); + xfree(ppixBlue); + xfree(ppixGreen); + xfree(ppixRed); return (Success); } @@ -1859,7 +1859,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig, npix = c << r; if ((r >= 32) || (npix > pmap->freeRed) || (npix < c)) return(BadAlloc); - if(!(ppixTemp = (Pixel *)ALLOCATE_LOCAL(npix * sizeof(Pixel)))) + if(!(ppixTemp = (Pixel *)xalloc(npix * sizeof(Pixel)))) return(BadAlloc); ok = AllocCP(pmap, pmap->red, c, r, contig, ppixTemp, pmask); @@ -1889,7 +1889,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig, pmap->numPixelsRed[client] += npix; pmap->freeRed -= npix; } - DEALLOCATE_LOCAL(ppixTemp); + xfree(ppixTemp); return (ok ? Success : BadAlloc); } @@ -2089,7 +2089,7 @@ AllocShared (ColormapPtr pmap, Pixel *ppix, int c, int r, int g, int b, npixClientNew = c << (r + g + b); npixShared = (c << r) + (c << g) + (c << b); - psharedList = (SHAREDCOLOR **)ALLOCATE_LOCAL(npixShared * + psharedList = (SHAREDCOLOR **)xalloc(npixShared * sizeof(SHAREDCOLOR *)); if (!psharedList) return FALSE; @@ -2204,7 +2204,7 @@ AllocShared (ColormapPtr pmap, Pixel *ppix, int c, int r, int g, int b, } } } - DEALLOCATE_LOCAL(psharedList); + xfree(psharedList); return TRUE; } @@ -2679,7 +2679,7 @@ IsMapInstalled(Colormap map, WindowPtr pWin) Colormap *pmaps; int imap, nummaps, found; - pmaps = (Colormap *) ALLOCATE_LOCAL( + pmaps = (Colormap *) xalloc( pWin->drawable.pScreen->maxInstalledCmaps * sizeof(Colormap)); if(!pmaps) return(FALSE); @@ -2694,6 +2694,6 @@ IsMapInstalled(Colormap map, WindowPtr pWin) break; } } - DEALLOCATE_LOCAL(pmaps); + xfree(pmaps); return (found); } diff --git a/dix/devices.c b/dix/devices.c index e05444eff..9798b97a6 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -1997,7 +1997,7 @@ ProcGetMotionEvents(ClientPtr client) { if (CompareTimeStamps(stop, currentTime) == LATER) stop = currentTime; - coords = (xTimecoord *)ALLOCATE_LOCAL(mouse->valuator->numMotionEvents + coords = (xTimecoord *)xalloc(mouse->valuator->numMotionEvents * sizeof(xTimecoord)); if (!coords) return BadAlloc; @@ -2031,7 +2031,7 @@ ProcGetMotionEvents(ClientPtr client) (char *)coords); } if (coords) - DEALLOCATE_LOCAL(coords); + xfree(coords); return Success; } diff --git a/dix/dixfonts.c b/dix/dixfonts.c index c21b3ecb3..f214ef5ad 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -777,7 +777,7 @@ finish: reply.nFonts = nnames; reply.sequenceNumber = client->sequence; - bufptr = bufferStart = (char *) ALLOCATE_LOCAL(reply.length << 2); + bufptr = bufferStart = (char *) xalloc(reply.length << 2); if (!bufptr && reply.length) { SendErrorToClient(client, X_ListFonts, 0, 0, BadAlloc); @@ -802,7 +802,7 @@ finish: client->pSwapReplyFunc = ReplySwapVector[X_ListFonts]; WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply); (void) WriteToClient(client, stringLens + nnames, bufferStart); - DEALLOCATE_LOCAL(bufferStart); + xfree(bufferStart); bail: if (c->slept) @@ -1797,7 +1797,7 @@ SetDefaultFontPath(char *path) /* get enough for string, plus values -- use up commas */ len = strlen(path) + 1; - nump = cp = newpath = (unsigned char *) ALLOCATE_LOCAL(len); + nump = cp = newpath = (unsigned char *) xalloc(len); if (!newpath) return BadAlloc; pp = (unsigned char *) path; @@ -1818,7 +1818,7 @@ SetDefaultFontPath(char *path) err = SetFontPathElements(num, newpath, &bad, TRUE); - DEALLOCATE_LOCAL(newpath); + xfree(newpath); return err; } diff --git a/dix/extension.c b/dix/extension.c index 4c0c3d236..282d60ab7 100644 --- a/dix/extension.c +++ b/dix/extension.c @@ -364,7 +364,7 @@ ProcListExtensions(ClientPtr client) total_length += strlen(extensions[i]->aliases[j]) + 1; } reply.length = (total_length + 3) >> 2; - buffer = bufptr = (char *)ALLOCATE_LOCAL(total_length); + buffer = bufptr = (char *)xalloc(total_length); if (!buffer) return(BadAlloc); for (i=0; inoClientException); } diff --git a/dix/grabs.c b/dix/grabs.c index 2210cd05e..70d234857 100644 --- a/dix/grabs.c +++ b/dix/grabs.c @@ -369,16 +369,16 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab) i++; if (!i) return TRUE; - deletes = (GrabPtr *)ALLOCATE_LOCAL(i * sizeof(GrabPtr)); - adds = (GrabPtr *)ALLOCATE_LOCAL(i * sizeof(GrabPtr)); - updates = (Mask ***)ALLOCATE_LOCAL(i * sizeof(Mask **)); - details = (Mask **)ALLOCATE_LOCAL(i * sizeof(Mask *)); + deletes = (GrabPtr *)xalloc(i * sizeof(GrabPtr)); + adds = (GrabPtr *)xalloc(i * sizeof(GrabPtr)); + updates = (Mask ***)xalloc(i * sizeof(Mask **)); + details = (Mask **)xalloc(i * sizeof(Mask *)); if (!deletes || !adds || !updates || !details) { - if (details) DEALLOCATE_LOCAL(details); - if (updates) DEALLOCATE_LOCAL(updates); - if (adds) DEALLOCATE_LOCAL(adds); - if (deletes) DEALLOCATE_LOCAL(deletes); + if (details) xfree(details); + if (updates) xfree(updates); + if (adds) xfree(adds); + if (deletes) xfree(deletes); return FALSE; } ndels = nadds = nups = 0; @@ -473,10 +473,10 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab) *updates[i] = details[i]; } } - DEALLOCATE_LOCAL(details); - DEALLOCATE_LOCAL(updates); - DEALLOCATE_LOCAL(adds); - DEALLOCATE_LOCAL(deletes); + xfree(details); + xfree(updates); + xfree(adds); + xfree(deletes); return ok; #undef UPDATE diff --git a/dix/property.c b/dix/property.c index e281dd765..994d3a7a5 100644 --- a/dix/property.c +++ b/dix/property.c @@ -122,7 +122,7 @@ ProcRotateProperties(ClientPtr client) if (!stuff->nAtoms) return(Success); atoms = (Atom *) & stuff[1]; - props = (PropertyPtr *)ALLOCATE_LOCAL(stuff->nAtoms * sizeof(PropertyPtr)); + props = (PropertyPtr *)xalloc(stuff->nAtoms * sizeof(PropertyPtr)); if (!props) return(BadAlloc); for (i = 0; i < stuff->nAtoms; i++) @@ -131,19 +131,19 @@ ProcRotateProperties(ClientPtr client) DixReadAccess|DixWriteAccess); if (!ValidAtom(atoms[i]) || (XaceErrorOperation == action)) { - DEALLOCATE_LOCAL(props); + xfree(props); client->errorValue = atoms[i]; return BadAtom; } if (XaceIgnoreOperation == action) { - DEALLOCATE_LOCAL(props); + xfree(props); return Success; } for (j = i + 1; j < stuff->nAtoms; j++) if (atoms[j] == atoms[i]) { - DEALLOCATE_LOCAL(props); + xfree(props); return BadMatch; } pProp = wUserProps (pWin); @@ -153,7 +153,7 @@ ProcRotateProperties(ClientPtr client) goto found; pProp = pProp->next; } - DEALLOCATE_LOCAL(props); + xfree(props); return BadMatch; found: props[i] = pProp; @@ -175,7 +175,7 @@ found: props[i]->propertyName = atoms[(i + delta) % stuff->nAtoms]; } } - DEALLOCATE_LOCAL(props); + xfree(props); return Success; } @@ -575,7 +575,7 @@ ProcListProperties(ClientPtr client) numProps++; } if (numProps) - if(!(pAtoms = (Atom *)ALLOCATE_LOCAL(numProps * sizeof(Atom)))) + if(!(pAtoms = (Atom *)xalloc(numProps * sizeof(Atom)))) return(BadAlloc); xlpr.type = X_Reply; @@ -594,7 +594,7 @@ ProcListProperties(ClientPtr client) { client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); - DEALLOCATE_LOCAL(pAtoms); + xfree(pAtoms); } return(client->noClientException); } diff --git a/dix/resource.c b/dix/resource.c index e83c529d3..c8297fb67 100644 --- a/dix/resource.c +++ b/dix/resource.c @@ -507,13 +507,13 @@ RebuildTable(int client) */ j = 2 * clientTable[client].buckets; - tails = (ResourcePtr **)ALLOCATE_LOCAL(j * sizeof(ResourcePtr *)); + tails = (ResourcePtr **)xalloc(j * sizeof(ResourcePtr *)); if (!tails) return; resources = (ResourcePtr *)xalloc(j * sizeof(ResourcePtr)); if (!resources) { - DEALLOCATE_LOCAL(tails); + xfree(tails); return; } for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++) @@ -536,7 +536,7 @@ RebuildTable(int client) *tptr = &res->next; } } - DEALLOCATE_LOCAL(tails); + xfree(tails); clientTable[client].buckets *= 2; xfree(clientTable[client].resources); clientTable[client].resources = resources; diff --git a/dix/swaprep.c b/dix/swaprep.c index 7d3251ae3..91469e17b 100644 --- a/dix/swaprep.c +++ b/dix/swaprep.c @@ -101,7 +101,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf) CARD32 tmpbuf[1]; /* Allocate as big a buffer as we can... */ - while (!(pbufT = (CARD32 *) ALLOCATE_LOCAL(bufsize))) + while (!(pbufT = (CARD32 *) xalloc(bufsize))) { bufsize >>= 1; if (bufsize == 4) @@ -133,7 +133,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf) } if (pbufT != tmpbuf) - DEALLOCATE_LOCAL ((char *) pbufT); + xfree ((char *) pbufT); } /** @@ -149,7 +149,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf) short tmpbuf[2]; /* Allocate as big a buffer as we can... */ - while (!(pbufT = (short *) ALLOCATE_LOCAL(bufsize))) + while (!(pbufT = (short *) xalloc(bufsize))) { bufsize >>= 1; if (bufsize == 4) @@ -181,7 +181,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf) } if (pbufT != tmpbuf) - DEALLOCATE_LOCAL ((char *) pbufT); + xfree ((char *) pbufT); } @@ -1267,7 +1267,7 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo) { char *pInfoTBase; - pInfoTBase = (char *) ALLOCATE_LOCAL(size); + pInfoTBase = (char *) xalloc(size); if (!pInfoTBase) { pClient->noClientException = -1; @@ -1275,7 +1275,7 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo) } SwapConnSetupInfo(pInfo, pInfoTBase); (void)WriteToClient(pClient, (int)size, (char *) pInfoTBase); - DEALLOCATE_LOCAL(pInfoTBase); + xfree(pInfoTBase); } _X_EXPORT void From ca75261beedc3e00767b3812a81b7dac4437f4a1 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:14:04 +0000 Subject: [PATCH 63/74] cfb: Remove usage of alloca Replace with xalloc/xfree. --- cfb/cfbbitblt.c | 8 +++---- cfb/cfbblt.c | 26 ++++++++++----------- cfb/cfbfillrct.c | 4 ++-- cfb/cfbfillsp.c | 60 ++++++++++++++++++++++++------------------------ cfb/cfbglblt8.c | 4 ++-- cfb/cfbpixmap.c | 8 +++---- cfb/cfbsolid.c | 12 +++++----- cfb/cfbtile32.c | 12 +++++----- cfb/cfbwindow.c | 4 ++-- 9 files changed, 69 insertions(+), 69 deletions(-) diff --git a/cfb/cfbbitblt.c b/cfb/cfbbitblt.c index d86f9df11..00bf41367 100644 --- a/cfb/cfbbitblt.c +++ b/cfb/cfbbitblt.c @@ -296,7 +296,7 @@ cfbBitBlt ( numRects = REGION_NUM_RECTS(&rgnDst); if (numRects && width && height) { - if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects * + if(!(pptSrc = (DDXPointPtr)xalloc(numRects * sizeof(DDXPointRec)))) { REGION_UNINIT(pGC->pScreen, &rgnDst); @@ -313,7 +313,7 @@ cfbBitBlt ( } (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); } prgnExposed = NULL; @@ -559,7 +559,7 @@ cfbCopyPlaneReduce ( numRects = REGION_NUM_RECTS(&rgnDst); if (numRects && width && height) { - if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects * + if(!(pptSrc = (DDXPointPtr)xalloc(numRects * sizeof(DDXPointRec)))) { REGION_UNINIT(pGC->pScreen, &rgnDst); @@ -576,7 +576,7 @@ cfbCopyPlaneReduce ( } (*doCopyPlane) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask, bitPlane); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); } prgnExposed = NULL; diff --git a/cfb/cfbblt.c b/cfb/cfbblt.c index 1e577f526..ff34589ff 100644 --- a/cfb/cfbblt.c +++ b/cfb/cfbblt.c @@ -207,13 +207,13 @@ MROP_NAME(cfbDoBitblt)( if (nbox > 1) { /* keep ordering in each band, reverse order of bands */ - pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); + pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); if(!pboxNew1) return; - pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); if(!pptNew1) { - DEALLOCATE_LOCAL(pboxNew1); + xfree(pboxNew1); return; } pboxBase = pboxNext = pbox+nbox-1; @@ -251,16 +251,16 @@ MROP_NAME(cfbDoBitblt)( if (nbox > 1) { /* reverse order of rects in each band */ - pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); - pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); + pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); if(!pboxNew2 || !pptNew2) { - if (pptNew2) DEALLOCATE_LOCAL(pptNew2); - if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2); + if (pptNew2) xfree(pptNew2); + if (pboxNew2) xfree(pboxNew2); if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); + xfree(pptNew1); + xfree(pboxNew1); } return; } @@ -922,12 +922,12 @@ bits1 = *--psrc; --pdst; \ } if (pboxNew2) { - DEALLOCATE_LOCAL(pptNew2); - DEALLOCATE_LOCAL(pboxNew2); + xfree(pptNew2); + xfree(pboxNew2); } if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); + xfree(pptNew1); + xfree(pboxNew1); } } diff --git a/cfb/cfbfillrct.c b/cfb/cfbfillrct.c index 4c78c24b3..fc2d31bdc 100644 --- a/cfb/cfbfillrct.c +++ b/cfb/cfbfillrct.c @@ -196,7 +196,7 @@ cfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit) numRects = REGION_NUM_RECTS(prgnClip) * nrectFill; if (numRects > NUM_STACK_RECTS) { - pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec)); + pboxClippedBase = (BoxPtr)xalloc(numRects * sizeof(BoxRec)); if (!pboxClippedBase) return; } @@ -301,5 +301,5 @@ cfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit) (*BoxFill) (pDrawable, pGC, pboxClipped-pboxClippedBase, pboxClippedBase); if (pboxClippedBase != stackRects) - DEALLOCATE_LOCAL(pboxClippedBase); + xfree(pboxClippedBase); } diff --git a/cfb/cfbfillsp.c b/cfb/cfbfillsp.c index ddd4f1421..36710b612 100644 --- a/cfb/cfbfillsp.c +++ b/cfb/cfbfillsp.c @@ -186,12 +186,12 @@ int fSorted; n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); if ( n == 0 ) return; - pwidth = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - ppt = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidth = (int *)xalloc(n * sizeof(int)); + ppt = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!ppt || !pwidth) { - if (ppt) DEALLOCATE_LOCAL(ppt); - if (pwidth) DEALLOCATE_LOCAL(pwidth); + if (ppt) xfree(ppt); + if (pwidth) xfree(pwidth); return; } n = miClipSpans( cfbGetCompositeClip(pGC), @@ -203,8 +203,8 @@ int fSorted; (*fill) (pDrawable, n, ppt, pwidth, pGC->tile.pixmap, xrot, yrot, pGC->alu, pGC->planemask); - DEALLOCATE_LOCAL(ppt); - DEALLOCATE_LOCAL(pwidth); + xfree(ppt); + xfree(pwidth); } #if PSZ == 8 @@ -251,12 +251,12 @@ int fSorted; n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); if ( n == 0 ) return; - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } @@ -392,8 +392,8 @@ int fSorted; } } } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } #else /* PSZ != 8 */ @@ -434,12 +434,12 @@ int fSorted; n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); if ( n == 0 ) return; - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -599,8 +599,8 @@ int fSorted; ppt++; pwidth++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } #endif /* PSZ == 8 */ @@ -648,12 +648,12 @@ cfb8Stipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) n = nInit * miFindMaxBand(pGC->pCompositeClip); if ( n == 0 ) return; - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -816,8 +816,8 @@ cfb8Stipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) } } } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } void @@ -862,12 +862,12 @@ cfb8OpaqueStipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) n = nInit * miFindMaxBand(pGC->pCompositeClip); if ( n == 0 ) return; - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -997,8 +997,8 @@ cfb8OpaqueStipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) } } } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } #endif /* PSZ == 8 */ diff --git a/cfb/cfbglblt8.c b/cfb/cfbglblt8.c index c4cba0e15..4d964b35d 100644 --- a/cfb/cfbglblt8.c +++ b/cfb/cfbglblt8.c @@ -355,7 +355,7 @@ cfbPolyGlyphBlt8Clipped( } if (!numRects) return; - clips = (CARD32 *)ALLOCATE_LOCAL ((maxAscent + maxDescent) * + clips = (CARD32 *)xalloc ((maxAscent + maxDescent) * sizeof (CARD32)); while (nglyph--) { @@ -471,7 +471,7 @@ cfbPolyGlyphBlt8Clipped( } } } - DEALLOCATE_LOCAL (clips); + xfree (clips); } #endif /* FOUR_BIT_CODE */ diff --git a/cfb/cfbpixmap.c b/cfb/cfbpixmap.c index 36ed5724d..a7be7cc1b 100644 --- a/cfb/cfbpixmap.c +++ b/cfb/cfbpixmap.c @@ -270,7 +270,7 @@ cfbXRotatePixmap(pPix, rw) int size, tsize; tsize = PixmapBytePad(pPix->drawable.width - rot, pPix->drawable.depth); - pwTmp = (CfbBits *) ALLOCATE_LOCAL(pPix->drawable.height * tsize); + pwTmp = (CfbBits *) xalloc(pPix->drawable.height * tsize); if (!pwTmp) return; /* divide pw (the pixmap) in two vertically at (w - rot) and swap */ @@ -288,7 +288,7 @@ cfbXRotatePixmap(pPix, rw) 0, 0, rot, 0, (int)pPix->drawable.width - rot, (int)pPix->drawable.height, tsize, size); - DEALLOCATE_LOCAL(pwTmp); + xfree(pwTmp); #endif } } @@ -328,13 +328,13 @@ cfbYRotatePixmap(pPix, rh) nbyDown = rot * pPix->devKind; nbyUp = (pPix->devKind * pPix->drawable.height) - nbyDown; - if(!(ptmp = (char *)ALLOCATE_LOCAL(nbyUp))) + if(!(ptmp = (char *)xalloc(nbyUp))) return; memmove(ptmp, pbase, nbyUp); /* save the low rows */ memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */ memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rot */ - DEALLOCATE_LOCAL(ptmp); + xfree(ptmp); } void diff --git a/cfb/cfbsolid.c b/cfb/cfbsolid.c index f0da05ef0..6b8238dd9 100644 --- a/cfb/cfbsolid.c +++ b/cfb/cfbsolid.c @@ -811,12 +811,12 @@ RROP_NAME(cfbSolidSpans) (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) devPriv = cfbGetGCPrivate(pGC); RROP_FETCH_GCPRIV(devPriv) n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -1359,7 +1359,7 @@ RROP_NAME(cfbSolidSpans) (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) } #endif } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); RROP_UNDECLARE } diff --git a/cfb/cfbtile32.c b/cfb/cfbtile32.c index 90439adc3..be016a70a 100644 --- a/cfb/cfbtile32.c +++ b/cfb/cfbtile32.c @@ -367,12 +367,12 @@ MROP_NAME(cfbTile32FS)(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) #endif n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -512,6 +512,6 @@ MROP_NAME(cfbTile32FS)(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) } } } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } diff --git a/cfb/cfbwindow.c b/cfb/cfbwindow.c index c4f027b08..234501212 100644 --- a/cfb/cfbwindow.c +++ b/cfb/cfbwindow.c @@ -133,7 +133,7 @@ cfbCopyWindow(pWin, ptOldOrg, prgnSrc) pbox = REGION_RECTS(&rgnDst); nbox = REGION_NUM_RECTS(&rgnDst); - if(!nbox || !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) + if(!nbox || !(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) { REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); return; @@ -148,7 +148,7 @@ cfbCopyWindow(pWin, ptOldOrg, prgnSrc) cfbDoBitbltCopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, GXcopy, &rgnDst, pptSrc, ~0L); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); } From 683ee1776d172035c465aa8fc84ccd53bb8ba7fd Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:14:25 +0000 Subject: [PATCH 64/74] afb: Remove usage of alloca Replace with heap allocations. --- afb/afbbitblt.c | 4 +-- afb/afbblt.c | 26 +++++++-------- afb/afbfillrct.c | 4 +-- afb/afbfillsp.c | 84 ++++++++++++++++++++++++------------------------ afb/afbimggblt.c | 4 +-- afb/afbpixmap.c | 4 +-- afb/afbplygblt.c | 4 +-- afb/afbwindow.c | 4 +-- 8 files changed, 67 insertions(+), 67 deletions(-) diff --git a/afb/afbbitblt.c b/afb/afbbitblt.c index 2e416e356..d8b2ccda5 100644 --- a/afb/afbbitblt.c +++ b/afb/afbbitblt.c @@ -279,7 +279,7 @@ afbBitBlt(register DrawablePtr pSrcDrawable, register DrawablePtr pDstDrawable, /* Do bit blitting */ numRects = REGION_NUM_RECTS(&rgnDst); if (numRects && width && height) { - if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects * + if(!(pptSrc = (DDXPointPtr)xalloc(numRects * sizeof(DDXPointRec)))) { REGION_UNINIT(pGC->pScreen, &rgnDst); if (freeSrcClip) @@ -296,7 +296,7 @@ afbBitBlt(register DrawablePtr pSrcDrawable, register DrawablePtr pDstDrawable, (*doBitBlt)(pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, planemask); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); } prgnExposed = NULL; diff --git a/afb/afbblt.c b/afb/afbblt.c index 9eb4e4732..4e1a49e9d 100644 --- a/afb/afbblt.c +++ b/afb/afbblt.c @@ -132,12 +132,12 @@ MROP_NAME(afbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask) if (nbox > 1) { /* keep ordering in each band, reverse order of bands */ - pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox); + pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec)*nbox); if(!pboxNew1) return; - pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox); + pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec)*nbox); if(!pptNew1) { - DEALLOCATE_LOCAL(pboxNew1); + xfree(pboxNew1); return; } pboxBase = pboxNext = pbox+nbox-1; @@ -169,16 +169,16 @@ MROP_NAME(afbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask) if (nbox > 1) { /* reverse order of rects in each band */ - pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); - pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); + pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); if(!pboxNew2 || !pptNew2) { if (pptNew2) - DEALLOCATE_LOCAL(pptNew2); + xfree(pptNew2); if (pboxNew2) - DEALLOCATE_LOCAL(pboxNew2); + xfree(pboxNew2); if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); + xfree(pptNew1); + xfree(pboxNew1); } return; } @@ -553,11 +553,11 @@ bits1 = *--psrc; --pdst; \ pptSrc++; } if (pboxNew2) { - DEALLOCATE_LOCAL(pptNew2); - DEALLOCATE_LOCAL(pboxNew2); + xfree(pptNew2); + xfree(pboxNew2); } if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); + xfree(pptNew1); + xfree(pboxNew1); } } diff --git a/afb/afbfillrct.c b/afb/afbfillrct.c index 06fb37365..1600deab3 100644 --- a/afb/afbfillrct.c +++ b/afb/afbfillrct.c @@ -111,7 +111,7 @@ afbPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *pre numRects = REGION_NUM_RECTS(prgnClip) * nrectFill; if (numRects > NUM_STACK_RECTS) { - pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec)); + pboxClippedBase = (BoxPtr)xalloc(numRects * sizeof(BoxRec)); if (!pboxClippedBase) return; } @@ -287,5 +287,5 @@ afbPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *pre } } if (pboxClippedBase != stackRects) - DEALLOCATE_LOCAL(pboxClippedBase); + xfree(pboxClippedBase); } diff --git a/afb/afbfillsp.c b/afb/afbfillsp.c index 539c3457c..b00185922 100644 --- a/afb/afbfillsp.c +++ b/afb/afbfillsp.c @@ -109,11 +109,11 @@ afbSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) unsigned char *rrops; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -183,8 +183,8 @@ afbSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) pwidth++; ppt++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } void @@ -219,11 +219,11 @@ afbStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) unsigned char *rrops; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -297,8 +297,8 @@ afbStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) pwidth++; ppt++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } void @@ -333,11 +333,11 @@ afbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) int d; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -428,8 +428,8 @@ afbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) break; } } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } void @@ -465,11 +465,11 @@ afbOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) int d; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -587,8 +587,8 @@ afbOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) break; } } /* switch (rop) */ - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } /* Fill spans with tiles that aren't PPW bits wide */ @@ -626,11 +626,11 @@ afbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) register int d; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -732,8 +732,8 @@ afbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) ppt++; pwidth++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } /* Fill spans with stipples that aren't PPW bits wide */ @@ -772,11 +772,11 @@ afbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) int depthDst; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -877,8 +877,8 @@ afbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) ppt++; pwidth++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } /* Fill spans with OpaqueStipples that aren't PPW bits wide */ @@ -918,11 +918,11 @@ afbUnnaturalOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) int depthDst; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -1124,6 +1124,6 @@ afbUnnaturalOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) ppt++; pwidth++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } diff --git a/afb/afbimggblt.c b/afb/afbimggblt.c index de02aa46a..ca49ee3ba 100644 --- a/afb/afbimggblt.c +++ b/afb/afbimggblt.c @@ -298,7 +298,7 @@ afbImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) int getWidth; /* bits to get from glyph */ #endif - if(!(ppos = (afbTEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(afbTEXTPOS)))) + if(!(ppos = (afbTEXTPOS *)xalloc(nglyph * sizeof(afbTEXTPOS)))) return; pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst); @@ -462,7 +462,7 @@ afbImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) } /* depth */ } /* for each glyph */ } /* while nbox-- */ - DEALLOCATE_LOCAL(ppos); + xfree(ppos); break; } diff --git a/afb/afbpixmap.c b/afb/afbpixmap.c index b0ac80105..d15d86114 100644 --- a/afb/afbpixmap.c +++ b/afb/afbpixmap.c @@ -251,7 +251,7 @@ afbYRotatePixmap(pPix, rh) nbyDown = rh * pPix->devKind; nbyUp = (pPix->devKind * height) - nbyDown; - if(!(ptmp = (char *)ALLOCATE_LOCAL(nbyUp))) + if(!(ptmp = (char *)xalloc(nbyUp))) return; for (d = 0; d < pPix->drawable.depth; d++) { @@ -261,7 +261,7 @@ afbYRotatePixmap(pPix, rh) memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */ memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rh */ } - DEALLOCATE_LOCAL(ptmp); + xfree(ptmp); } void diff --git a/afb/afbplygblt.c b/afb/afbplygblt.c index 289d50e1b..bcb08c7a6 100644 --- a/afb/afbplygblt.c +++ b/afb/afbplygblt.c @@ -278,7 +278,7 @@ afbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) int getWidth; /* bits to get from glyph */ #endif - if(!(ppos = (afbTEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(afbTEXTPOS)))) + if(!(ppos = (afbTEXTPOS *)xalloc(nglyph * sizeof(afbTEXTPOS)))) return; pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst); @@ -453,7 +453,7 @@ afbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) } /* depth */ } /* for each glyph */ } /* while nbox-- */ - DEALLOCATE_LOCAL(ppos); + xfree(ppos); break; } diff --git a/afb/afbwindow.c b/afb/afbwindow.c index 5c2f18aea..61641ee31 100644 --- a/afb/afbwindow.c +++ b/afb/afbwindow.c @@ -141,7 +141,7 @@ afbCopyWindow(pWin, ptOldOrg, prgnSrc) pbox = REGION_RECTS(prgnDst); nbox = REGION_NUM_RECTS(prgnDst); - if(!(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) + if(!(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) return; ppt = pptSrc; @@ -152,7 +152,7 @@ afbCopyWindow(pWin, ptOldOrg, prgnSrc) afbDoBitblt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, GXcopy, prgnDst, pptSrc, ~0); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); REGION_DESTROY(pWin->drawable.pScreen, prgnDst); } From fb32bb9839b615f7297fbfac2050bc216682f01c Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:17:54 +0000 Subject: [PATCH 65/74] Xi: Remove usage of alloca Replace with xalloc/xfree. --- Xi/gtmotion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xi/gtmotion.c b/Xi/gtmotion.c index 51d4248cd..ad2bec391 100644 --- a/Xi/gtmotion.c +++ b/Xi/gtmotion.c @@ -135,7 +135,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client) if (num_events) { size = sizeof(Time) + (axes * sizeof(INT32)); tsize = num_events * size; - coords = (INT32 *) ALLOCATE_LOCAL(tsize); + coords = (INT32 *) xalloc(tsize); if (!coords) return BadAlloc; rep.nEvents = (v->GetMotionProc) (dev, (xTimecoord *) coords, /* XXX */ @@ -161,7 +161,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client) WriteToClient(client, length * 4, (char *)coords); } if (coords) - DEALLOCATE_LOCAL(coords); + xfree(coords); return Success; } From 934281126f6c602fa4bd0c2e29d8c9f44fe532b8 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:18:22 +0000 Subject: [PATCH 66/74] Xext: Remove usage of alloca Replace with heap allocations. --- Xext/mbuf.c | 40 ++++++++++++++++++++-------------------- Xext/mbufbf.c | 4 ++-- Xext/mbufpx.c | 4 ++-- Xext/panoramiXprocs.c | 32 ++++++++++++++++---------------- Xext/saver.c | 4 ++-- Xext/shape.c | 6 +++--- Xext/sync.c | 12 ++++++------ Xext/xace.c | 4 ++-- Xext/xf86bigfont.c | 18 +++++++++--------- Xext/xres.c | 8 ++++---- 10 files changed, 66 insertions(+), 66 deletions(-) diff --git a/Xext/mbuf.c b/Xext/mbuf.c index f9ff0858c..729656048 100644 --- a/Xext/mbuf.c +++ b/Xext/mbuf.c @@ -524,12 +524,12 @@ ProcDisplayImageBuffers (client) return Success; minDelay = stuff->minDelay; ids = (XID *) &stuff[1]; - ppMultibuffers = (MultibuffersPtr *) ALLOCATE_LOCAL(nbuf * sizeof (MultibuffersPtr)); - pMultibuffer = (MultibufferPtr *) ALLOCATE_LOCAL(nbuf * sizeof (MultibufferPtr)); + ppMultibuffers = (MultibuffersPtr *) xalloc(nbuf * sizeof (MultibuffersPtr)); + pMultibuffer = (MultibufferPtr *) xalloc(nbuf * sizeof (MultibufferPtr)); if (!ppMultibuffers || !pMultibuffer) { - if (ppMultibuffers) DEALLOCATE_LOCAL(ppMultibuffers); - if (pMultibuffer) DEALLOCATE_LOCAL(pMultibuffer); + if (ppMultibuffers) xfree(ppMultibuffers); + if (pMultibuffer) xfree(pMultibuffer); client->errorValue = 0; return BadAlloc; } @@ -541,8 +541,8 @@ ProcDisplayImageBuffers (client) MultibufferResType); if (!pMultibuffer[i]) { - DEALLOCATE_LOCAL(ppMultibuffers); - DEALLOCATE_LOCAL(pMultibuffer); + xfree(ppMultibuffers); + xfree(pMultibuffer); client->errorValue = ids[i]; return MultibufferErrorBase + MultibufferBadBuffer; } @@ -551,8 +551,8 @@ MultibufferResType); { if (ppMultibuffers[i] == ppMultibuffers[j]) { - DEALLOCATE_LOCAL(ppMultibuffers); - DEALLOCATE_LOCAL(pMultibuffer); + xfree(ppMultibuffers); + xfree(pMultibuffer); client->errorValue = ids[i]; return BadMatch; } @@ -571,8 +571,8 @@ MultibufferResType); else PerformDisplayRequest (ppMultibuffers, pMultibuffer, nbuf); - DEALLOCATE_LOCAL(ppMultibuffers); - DEALLOCATE_LOCAL(pMultibuffer); + xfree(ppMultibuffers); + xfree(pMultibuffer); return Success; } @@ -665,7 +665,7 @@ ProcGetMBufferAttributes (client) pMultibuffers = (MultibuffersPtr)LookupIDByType (pWin->drawable.id, MultibuffersResType); if (!pMultibuffers) return BadAccess; - ids = (XID *) ALLOCATE_LOCAL (pMultibuffers->numMultibuffer * sizeof (XID)); + ids = (XID *) xalloc (pMultibuffers->numMultibuffer * sizeof (XID)); if (!ids) return BadAlloc; for (i = 0; i < pMultibuffers->numMultibuffer; i++) @@ -688,7 +688,7 @@ ProcGetMBufferAttributes (client) (char *)&rep); WriteToClient (client, (int)(pMultibuffers->numMultibuffer * sizeof (XID)), (char *)ids); - DEALLOCATE_LOCAL((pointer) ids); + xfree((pointer) ids); return client->noClientException; } @@ -803,7 +803,7 @@ ProcGetBufferInfo (client) nInfo += pDepth->numVids; } pInfo = (xMbufBufferInfo *) - ALLOCATE_LOCAL (nInfo * sizeof (xMbufBufferInfo)); + xalloc (nInfo * sizeof (xMbufBufferInfo)); if (!pInfo) return BadAlloc; @@ -839,7 +839,7 @@ ProcGetBufferInfo (client) } WriteToClient (client, sizeof (xMbufGetBufferInfoReply), (pointer) &rep); WriteToClient (client, (int) nInfo * sizeof (xMbufBufferInfo), (pointer) pInfo); - DEALLOCATE_LOCAL ((pointer) pInfo); + xfree ((pointer) pInfo); return client->noClientException; } @@ -1256,7 +1256,7 @@ DisplayImageBuffers (ids, nbuf) MultibuffersPtr *pMultibuffers; int i, j; - pMultibuffer = (MultibufferPtr *) ALLOCATE_LOCAL (nbuf * sizeof *pMultibuffer + + pMultibuffer = (MultibufferPtr *) xalloc (nbuf * sizeof *pMultibuffer + nbuf * sizeof *pMultibuffers); if (!pMultibuffer) return BadAlloc; @@ -1266,19 +1266,19 @@ DisplayImageBuffers (ids, nbuf) pMultibuffer[i] = (MultibufferPtr) LookupIDByType (ids[i], MultibufferResType); if (!pMultibuffer[i]) { - DEALLOCATE_LOCAL (pMultibuffer); + xfree (pMultibuffer); return MultibufferErrorBase + MultibufferBadBuffer; } pMultibuffers[i] = pMultibuffer[i]->pMultibuffers; for (j = 0; j < i; j++) if (pMultibuffers[i] == pMultibuffers[j]) { - DEALLOCATE_LOCAL (pMultibuffer); + xfree (pMultibuffer); return BadMatch; } } PerformDisplayRequest (pMultibuffers, pMultibuffer, nbuf); - DEALLOCATE_LOCAL (pMultibuffer); + xfree (pMultibuffer); return Success; } @@ -1382,7 +1382,7 @@ MultibufferExpose (pMultibuffer, pRegion) numRects = REGION_NUM_RECTS(pRegion); pBox = REGION_RECTS(pRegion); - pEvent = (xEvent *) ALLOCATE_LOCAL(numRects * sizeof(xEvent)); + pEvent = (xEvent *) xalloc(numRects * sizeof(xEvent)); if (pEvent) { pe = pEvent; @@ -1398,7 +1398,7 @@ MultibufferExpose (pMultibuffer, pRegion) } (void) DeliverEventsToMultibuffer (pMultibuffer, pEvent, numRects, ExposureMask); - DEALLOCATE_LOCAL(pEvent); + xfree(pEvent); } } } diff --git a/Xext/mbufbf.c b/Xext/mbufbf.c index b879abcb0..a3b3de79d 100644 --- a/Xext/mbufbf.c +++ b/Xext/mbufbf.c @@ -614,7 +614,7 @@ bufDrawSelectPlane(pScreen, selectPlane, prgn, bufferNum) if (!pGC) return; - prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) * + prect = (xRectangle *)xalloc(REGION_NUM_RECTS(prgn) * sizeof(xRectangle)); if (!prect) { @@ -638,7 +638,7 @@ bufDrawSelectPlane(pScreen, selectPlane, prgn, bufferNum) prect -= numRects; (* pGC->ops->PolyFillRect)(pDrawable, pGC, numRects, prect); - DEALLOCATE_LOCAL(prect); + xfree(prect); FreeScratchGC (pGC); } diff --git a/Xext/mbufpx.c b/Xext/mbufpx.c index a04b97d9d..21d525906 100644 --- a/Xext/mbufpx.c +++ b/Xext/mbufpx.c @@ -263,7 +263,7 @@ MultibufferPaintBackgroundRegion(pWin, pDrawable, pRegion) int nrects = REGION_NUM_RECTS(pRegion); BoxPtr pbox = REGION_RECTS(pRegion); - pRects = (xRectangle *)ALLOCATE_LOCAL(nrects * sizeof(xRectangle)); + pRects = (xRectangle *)xalloc(nrects * sizeof(xRectangle)); if (pRects) { int i; @@ -275,7 +275,7 @@ MultibufferPaintBackgroundRegion(pWin, pDrawable, pRegion) pRects[i].height = pbox->y2 - pbox->y1; } MultibufferPaintBackgroundRectangles(pWin, pDrawable, nrects, pRects); - DEALLOCATE_LOCAL(pRects); + xfree(pRects); } } diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c index 1c53a1e1a..f51f65663 100644 --- a/Xext/panoramiXprocs.c +++ b/Xext/panoramiXprocs.c @@ -1272,7 +1272,7 @@ int PanoramiXPolyPoint(ClientPtr client) isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; npoint = ((client->req_len << 2) - sizeof(xPolyPointReq)) >> 2; if (npoint > 0) { - origPts = (xPoint *) ALLOCATE_LOCAL(npoint * sizeof(xPoint)); + origPts = (xPoint *) xalloc(npoint * sizeof(xPoint)); memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint)); FOR_NSCREENS_FORWARD(j){ @@ -1299,7 +1299,7 @@ int PanoramiXPolyPoint(ClientPtr client) result = (* SavedProcVector[X_PolyPoint])(client); if(result != Success) break; } - DEALLOCATE_LOCAL(origPts); + xfree(origPts); return (result); } else return (client->noClientException); @@ -1330,7 +1330,7 @@ int PanoramiXPolyLine(ClientPtr client) isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; npoint = ((client->req_len << 2) - sizeof(xPolyLineReq)) >> 2; if (npoint > 0){ - origPts = (xPoint *) ALLOCATE_LOCAL(npoint * sizeof(xPoint)); + origPts = (xPoint *) xalloc(npoint * sizeof(xPoint)); memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint)); FOR_NSCREENS_FORWARD(j){ @@ -1357,7 +1357,7 @@ int PanoramiXPolyLine(ClientPtr client) result = (* SavedProcVector[X_PolyLine])(client); if(result != Success) break; } - DEALLOCATE_LOCAL(origPts); + xfree(origPts); return (result); } else return (client->noClientException); @@ -1391,7 +1391,7 @@ int PanoramiXPolySegment(ClientPtr client) if(nsegs & 4) return BadLength; nsegs >>= 3; if (nsegs > 0) { - origSegs = (xSegment *) ALLOCATE_LOCAL(nsegs * sizeof(xSegment)); + origSegs = (xSegment *) xalloc(nsegs * sizeof(xSegment)); memcpy((char *) origSegs, (char *) &stuff[1], nsegs * sizeof(xSegment)); FOR_NSCREENS_FORWARD(j){ @@ -1418,7 +1418,7 @@ int PanoramiXPolySegment(ClientPtr client) result = (* SavedProcVector[X_PolySegment])(client); if(result != Success) break; } - DEALLOCATE_LOCAL(origSegs); + xfree(origSegs); return (result); } else return (client->noClientException); @@ -1453,7 +1453,7 @@ int PanoramiXPolyRectangle(ClientPtr client) if(nrects & 4) return BadLength; nrects >>= 3; if (nrects > 0){ - origRecs = (xRectangle *) ALLOCATE_LOCAL(nrects * sizeof(xRectangle)); + origRecs = (xRectangle *) xalloc(nrects * sizeof(xRectangle)); memcpy((char *)origRecs,(char *)&stuff[1],nrects * sizeof(xRectangle)); FOR_NSCREENS_FORWARD(j){ @@ -1479,7 +1479,7 @@ int PanoramiXPolyRectangle(ClientPtr client) result = (* SavedProcVector[X_PolyRectangle])(client); if(result != Success) break; } - DEALLOCATE_LOCAL(origRecs); + xfree(origRecs); return (result); } else return (client->noClientException); @@ -1513,7 +1513,7 @@ int PanoramiXPolyArc(ClientPtr client) if(narcs % sizeof(xArc)) return BadLength; narcs /= sizeof(xArc); if (narcs > 0){ - origArcs = (xArc *) ALLOCATE_LOCAL(narcs * sizeof(xArc)); + origArcs = (xArc *) xalloc(narcs * sizeof(xArc)); memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc)); FOR_NSCREENS_FORWARD(j){ @@ -1537,7 +1537,7 @@ int PanoramiXPolyArc(ClientPtr client) result = (* SavedProcVector[X_PolyArc])(client); if(result != Success) break; } - DEALLOCATE_LOCAL(origArcs); + xfree(origArcs); return (result); } else return (client->noClientException); @@ -1569,7 +1569,7 @@ int PanoramiXFillPoly(ClientPtr client) count = ((client->req_len << 2) - sizeof(xFillPolyReq)) >> 2; if (count > 0){ - locPts = (DDXPointPtr) ALLOCATE_LOCAL(count * sizeof(DDXPointRec)); + locPts = (DDXPointPtr) xalloc(count * sizeof(DDXPointRec)); memcpy((char *)locPts, (char *)&stuff[1], count * sizeof(DDXPointRec)); FOR_NSCREENS_FORWARD(j){ @@ -1596,7 +1596,7 @@ int PanoramiXFillPoly(ClientPtr client) result = (* SavedProcVector[X_FillPoly])(client); if(result != Success) break; } - DEALLOCATE_LOCAL(locPts); + xfree(locPts); return (result); } else return (client->noClientException); @@ -1630,7 +1630,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client) if(things & 4) return BadLength; things >>= 3; if (things > 0){ - origRects = (xRectangle *) ALLOCATE_LOCAL(things * sizeof(xRectangle)); + origRects = (xRectangle *) xalloc(things * sizeof(xRectangle)); memcpy((char*)origRects,(char*)&stuff[1], things * sizeof(xRectangle)); FOR_NSCREENS_FORWARD(j){ @@ -1655,7 +1655,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client) result = (* SavedProcVector[X_PolyFillRectangle])(client); if(result != Success) break; } - DEALLOCATE_LOCAL(origRects); + xfree(origRects); return (result); } else return (client->noClientException); @@ -1689,7 +1689,7 @@ int PanoramiXPolyFillArc(ClientPtr client) IF_RETURN((narcs % sizeof(xArc)), BadLength); narcs /= sizeof(xArc); if (narcs > 0) { - origArcs = (xArc *) ALLOCATE_LOCAL(narcs * sizeof(xArc)); + origArcs = (xArc *) xalloc(narcs * sizeof(xArc)); memcpy((char *) origArcs, (char *)&stuff[1], narcs * sizeof(xArc)); FOR_NSCREENS_FORWARD(j){ @@ -1714,7 +1714,7 @@ int PanoramiXPolyFillArc(ClientPtr client) result = (* SavedProcVector[X_PolyFillArc])(client); if(result != Success) break; } - DEALLOCATE_LOCAL(origArcs); + xfree(origArcs); return (result); } else return (client->noClientException); diff --git a/Xext/saver.c b/Xext/saver.c index a9f1dd36c..a590583df 100644 --- a/Xext/saver.c +++ b/Xext/saver.c @@ -673,7 +673,7 @@ CreateSaverWindow (pScreen) wantMap = wColormap (pWin); if (wantMap == None) return TRUE; - installedMaps = (Colormap *) ALLOCATE_LOCAL (pScreen->maxInstalledCmaps * + installedMaps = (Colormap *) xalloc (pScreen->maxInstalledCmaps * sizeof (Colormap)); numInstalled = (*pWin->drawable.pScreen->ListInstalledColormaps) (pScreen, installedMaps); @@ -681,7 +681,7 @@ CreateSaverWindow (pScreen) if (installedMaps[i] == wantMap) break; - DEALLOCATE_LOCAL ((char *) installedMaps); + xfree ((char *) installedMaps); if (i < numInstalled) return TRUE; diff --git a/Xext/shape.c b/Xext/shape.c index 928eeee31..6515a10d7 100644 --- a/Xext/shape.c +++ b/Xext/shape.c @@ -1060,7 +1060,7 @@ ProcShapeGetRectangles (client) } if (!region) { nrects = 1; - rects = (xRectangle *) ALLOCATE_LOCAL (sizeof (xRectangle)); + rects = (xRectangle *) xalloc (sizeof (xRectangle)); if (!rects) return BadAlloc; switch (stuff->kind) { @@ -1087,7 +1087,7 @@ ProcShapeGetRectangles (client) BoxPtr box; nrects = REGION_NUM_RECTS(region); box = REGION_RECTS(region); - rects = (xRectangle *) ALLOCATE_LOCAL (nrects * sizeof (xRectangle)); + rects = (xRectangle *) xalloc (nrects * sizeof (xRectangle)); if (!rects && nrects) return BadAlloc; for (i = 0; i < nrects; i++, box++) { @@ -1110,7 +1110,7 @@ ProcShapeGetRectangles (client) } WriteToClient (client, sizeof (rep), (char *) &rep); WriteToClient (client, nrects * sizeof (xRectangle), (char *) rects); - DEALLOCATE_LOCAL (rects); + xfree (rects); return client->noClientException; } diff --git a/Xext/sync.c b/Xext/sync.c index d9b6a9f06..e87e0bd24 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -601,7 +601,7 @@ SyncSendCounterNotifyEvents(client, ppAwait, num_events) if (client->clientGone) return; pev = pEvents = (xSyncCounterNotifyEvent *) - ALLOCATE_LOCAL(num_events * sizeof(xSyncCounterNotifyEvent)); + xalloc(num_events * sizeof(xSyncCounterNotifyEvent)); if (!pEvents) return; UpdateCurrentTime(); @@ -622,7 +622,7 @@ SyncSendCounterNotifyEvents(client, ppAwait, num_events) } /* swapping will be taken care of by this */ WriteEventsToClient(client, num_events, (xEvent *)pEvents); - DEALLOCATE_LOCAL(pEvents); + xfree(pEvents); } @@ -732,7 +732,7 @@ SyncAwaitTriggerFired(pTrigger) pAwaitUnion = (SyncAwaitUnion *)pAwait->pHeader; numwaits = pAwaitUnion->header.num_waitconditions; - ppAwait = (SyncAwait **)ALLOCATE_LOCAL(numwaits * sizeof(SyncAwait *)); + ppAwait = (SyncAwait **)xalloc(numwaits * sizeof(SyncAwait *)); if (!ppAwait) goto bail; @@ -801,7 +801,7 @@ SyncAwaitTriggerFired(pTrigger) if (num_events) SyncSendCounterNotifyEvents(pAwaitUnion->header.client, ppAwait, num_events); - DEALLOCATE_LOCAL(ppAwait); + xfree(ppAwait); bail: /* unblock the client */ @@ -1396,7 +1396,7 @@ ProcSyncListSystemCounters(client) if (len) { - walklist = list = (xSyncSystemCounter *) ALLOCATE_LOCAL(len); + walklist = list = (xSyncSystemCounter *) xalloc(len); if (!list) return BadAlloc; } @@ -1442,7 +1442,7 @@ ProcSyncListSystemCounters(client) if (len) { WriteToClient(client, len, (char *) list); - DEALLOCATE_LOCAL(list); + xfree(list); } return (client->noClientException); diff --git a/Xext/xace.c b/Xext/xace.c index 63856315c..00c3b8f9b 100644 --- a/Xext/xace.c +++ b/Xext/xace.c @@ -437,7 +437,7 @@ XaceCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h, /* convert region to list-of-rectangles for PolyFillRect */ - pRects = (xRectangle *)ALLOCATE_LOCAL(nRects * sizeof(xRectangle *)); + pRects = (xRectangle *)xalloc(nRects * sizeof(xRectangle *)); if (!pRects) { failed = TRUE; @@ -489,7 +489,7 @@ XaceCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h, */ bzero(pBuf, (int)(widthBytesLine * h)); } - if (pRects) DEALLOCATE_LOCAL(pRects); + if (pRects) xfree(pRects); if (pScratchGC) FreeScratchGC(pScratchGC); if (pPix) FreeScratchPixmapHeader(pPix); } diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c index c2f891a7e..b20e82d6e 100644 --- a/Xext/xf86bigfont.c +++ b/Xext/xf86bigfont.c @@ -491,7 +491,7 @@ ProcXF86BigfontQueryFont( } else { #endif pCI = (xCharInfo *) - ALLOCATE_LOCAL(nCharInfos * sizeof(xCharInfo)); + xalloc(nCharInfos * sizeof(xCharInfo)); if (!pCI) return BadAlloc; #ifdef HAS_SHM @@ -554,9 +554,9 @@ ProcXF86BigfontQueryFont( hashModulus = nCharInfos+1; tmp = (CARD16*) - ALLOCATE_LOCAL((4*nCharInfos+1) * sizeof(CARD16)); + xalloc((4*nCharInfos+1) * sizeof(CARD16)); if (!tmp) { - if (!pDesc) DEALLOCATE_LOCAL(pCI); + if (!pDesc) xfree(pCI); return BadAlloc; } pIndex2UniqIndex = tmp; @@ -639,12 +639,12 @@ ProcXF86BigfontQueryFont( + (nCharInfos+1)/2 * 2 * sizeof(CARD16) : 0); xXF86BigfontQueryFontReply* reply = - (xXF86BigfontQueryFontReply *) ALLOCATE_LOCAL(rlength); + (xXF86BigfontQueryFontReply *) xalloc(rlength); char* p; if (!reply) { if (nCharInfos > 0) { - if (shmid == -1) DEALLOCATE_LOCAL(pIndex2UniqIndex); - if (!pDesc) DEALLOCATE_LOCAL(pCI); + if (shmid == -1) xfree(pIndex2UniqIndex); + if (!pDesc) xfree(pCI); } return BadAlloc; } @@ -722,10 +722,10 @@ ProcXF86BigfontQueryFont( } } WriteToClient(client, rlength, (char *)reply); - DEALLOCATE_LOCAL(reply); + xfree(reply); if (nCharInfos > 0) { - if (shmid == -1) DEALLOCATE_LOCAL(pIndex2UniqIndex); - if (!pDesc) DEALLOCATE_LOCAL(pCI); + if (shmid == -1) xfree(pIndex2UniqIndex); + if (!pDesc) xfree(pCI); } return (client->noClientException); } diff --git a/Xext/xres.c b/Xext/xres.c index 1617337bf..32cc9030d 100644 --- a/Xext/xres.c +++ b/Xext/xres.c @@ -63,7 +63,7 @@ ProcXResQueryClients (ClientPtr client) REQUEST_SIZE_MATCH(xXResQueryClientsReq); - current_clients = ALLOCATE_LOCAL((currentMaxClients - 1) * sizeof(int)); + current_clients = xalloc((currentMaxClients - 1) * sizeof(int)); num_clients = 0; for(i = 1; i < currentMaxClients; i++) { @@ -101,7 +101,7 @@ ProcXResQueryClients (ClientPtr client) } } - DEALLOCATE_LOCAL(current_clients); + xfree(current_clients); return (client->noClientException); } @@ -134,7 +134,7 @@ ProcXResQueryClientResources (ClientPtr client) return BadValue; } - counts = ALLOCATE_LOCAL((lastResourceType + 1) * sizeof(int)); + counts = xalloc((lastResourceType + 1) * sizeof(int)); memset(counts, 0, (lastResourceType + 1) * sizeof(int)); @@ -183,7 +183,7 @@ ProcXResQueryClientResources (ClientPtr client) } } - DEALLOCATE_LOCAL(counts); + xfree(counts); return (client->noClientException); } From 1eb6a1d0d2817cd0ce96fb27db3ceb2d0ff024af Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:18:35 +0000 Subject: [PATCH 67/74] XTrap: Remove usage of alloca Replace with xalloc/xfree. --- XTrap/xtrapdi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/XTrap/xtrapdi.c b/XTrap/xtrapdi.c index 23d3bde7f..80124fa73 100644 --- a/XTrap/xtrapdi.c +++ b/XTrap/xtrapdi.c @@ -2030,7 +2030,7 @@ static void GetSendColorCellsRep(ClientPtr client, xResourceReq *req) } nmasks = creq->planes; length = ((long)npixels + (long)nmasks) * sizeof(Pixel); - data = (XETrapDatum *)ALLOCATE_LOCAL(sizeof(XETrapDatum)+length); + data = (XETrapDatum *)xalloc(sizeof(XETrapDatum)+length); if (!data) { SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, @@ -2048,7 +2048,7 @@ static void GetSendColorCellsRep(ClientPtr client, xResourceReq *req) { SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, req->reqType, 0L, retval); - DEALLOCATE_LOCAL(data); + xfree(data); return; } crep = (xAllocColorCellsReply *)&(data->u.reply); @@ -2073,7 +2073,7 @@ static void GetSendColorCellsRep(ClientPtr client, xResourceReq *req) SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, req->reqType, 0L, XETrapErrorBase + BadIO); } - DEALLOCATE_LOCAL(data); + xfree(data); } static void GetSendColorPlanesRep(ClientPtr client, xResourceReq *req) { /* adapted from ProcAllocColorPlanes() in dispatch.c */ @@ -2101,7 +2101,7 @@ static void GetSendColorPlanesRep(ClientPtr client, xResourceReq *req) return; } length = (long)npixels * sizeof(Pixel); - data = (XETrapDatum *)ALLOCATE_LOCAL(sizeof(XETrapDatum)+length); + data = (XETrapDatum *)xalloc(sizeof(XETrapDatum)+length); if (!data) { SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, @@ -2121,7 +2121,7 @@ static void GetSendColorPlanesRep(ClientPtr client, xResourceReq *req) { SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, req->reqType, 0L, retval); - DEALLOCATE_LOCAL(data); + xfree(data); return; } crep->nPixels = npixels; @@ -2146,6 +2146,6 @@ static void GetSendColorPlanesRep(ClientPtr client, xResourceReq *req) SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, req->reqType, 0L, XETrapErrorBase + BadIO); } - DEALLOCATE_LOCAL(data); + xfree(data); } #endif /* COLOR_REPLIES */ From 1179ddea94efae6606162e9a1b0f2bf752ae4dd0 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:36:36 +0000 Subject: [PATCH 68/74] EXA: Remove usage of alloca Replace with heap allocations. --- exa/exa_accel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exa/exa_accel.c b/exa/exa_accel.c index 6314b97f0..ae951ed9a 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -497,7 +497,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask, pGC->fillStyle, pGC->alu)) { - xRectangle *rects = ALLOCATE_LOCAL(nbox * sizeof(xRectangle)); + xRectangle *rects = xalloc(nbox * sizeof(xRectangle)); if (rects) { int i; @@ -510,7 +510,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, } region = RECTS_TO_REGION(pScreen, nbox, rects, CT_YXBANDED); - DEALLOCATE_LOCAL(rects); + xfree(rects); } } From 83e5d9e75d0fa1135e2c9d8b59caee98c3291681 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:36:54 +0000 Subject: [PATCH 69/74] DIX: Remove last alloca call Replace with heap allocations. --- dix/dispatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dix/dispatch.c b/dix/dispatch.c index 1a3b4abf8..5c4f8e487 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -406,7 +406,7 @@ Dispatch(void) InitSelections(); nClients = 0; - clientReady = (int *) ALLOCATE_LOCAL(sizeof(int) * MaxClients); + clientReady = (int *) xalloc(sizeof(int) * MaxClients); if (!clientReady) return; @@ -535,7 +535,7 @@ Dispatch(void) ddxBeforeReset (); #endif KillAllClients(); - DEALLOCATE_LOCAL(clientReady); + xfree(clientReady); dispatchException &= ~DE_RESET; #ifdef XSERVER_DTRACE FreeRequestNames(); From 5e363500c86042c394595e1a6633581eb8fcd1bb Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:38:28 +0000 Subject: [PATCH 70/74] OS: Remove ALLOCATE_LOCAL from os.h Remove ALLOCATE_LOCAL_FALLBACK and DEALLOCATE_LOCAL_FALLBACK from os.h, and remove the include of Xalloca.h as well. --- include/os.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/os.h b/include/os.h index a87b739b9..c53a9ea8b 100644 --- a/include/os.h +++ b/include/os.h @@ -50,9 +50,6 @@ SOFTWARE. #define OS_H #include "misc.h" -#define ALLOCATE_LOCAL_FALLBACK(_size) Xalloc((unsigned long)(_size)) -#define DEALLOCATE_LOCAL_FALLBACK(_ptr) Xfree((pointer)(_ptr)) -#include #include #define NullFID ((FID) 0) From 6ff79ea5f7d3ff0c3b14e39849514784ccd40190 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Mon, 5 Nov 2007 16:46:49 +0100 Subject: [PATCH 71/74] Xephyr: fix some DRI build breakage --- hw/kdrive/ephyr/XF86dri.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/kdrive/ephyr/XF86dri.c b/hw/kdrive/ephyr/XF86dri.c index ae2ec890f..c11da0634 100644 --- a/hw/kdrive/ephyr/XF86dri.c +++ b/hw/kdrive/ephyr/XF86dri.c @@ -57,6 +57,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include #include +#include "GL/internal/dri_interface.h" static XExtensionInfo _xf86dri_info_data; static XExtensionInfo *xf86dri_info = &_xf86dri_info_data; @@ -384,8 +385,7 @@ Bool XF86DRICreateContext(dpy, screen, visual, context, hHWContext) context, hHWContext ); } -GLboolean XF86DRIDestroyContext( __DRInativeDisplay * ndpy, int screen, - __DRIid context ) +Bool XF86DRIDestroyContext( __DRInativeDisplay * ndpy, int screen, __DRIid context) { Display * const dpy = (Display *) ndpy; XExtDisplayInfo *info = find_display (dpy); @@ -406,8 +406,9 @@ GLboolean XF86DRIDestroyContext( __DRInativeDisplay * ndpy, int screen, return True; } -GLboolean XF86DRICreateDrawable( __DRInativeDisplay * ndpy, int screen, - __DRIid drawable, drm_drawable_t * hHWDrawable ) +Bool +XF86DRICreateDrawable (__DRInativeDisplay * ndpy, int screen, + __DRIid drawable, drm_drawable_t * hHWDrawable) { Display * const dpy = (Display *) ndpy; XExtDisplayInfo *info = find_display (dpy); @@ -436,7 +437,7 @@ GLboolean XF86DRICreateDrawable( __DRInativeDisplay * ndpy, int screen, return True; } -GLboolean XF86DRIDestroyDrawable( __DRInativeDisplay * ndpy, int screen, +Bool XF86DRIDestroyDrawable( __DRInativeDisplay * ndpy, int screen, __DRIid drawable ) { Display * const dpy = (Display *) ndpy; From dda10c9066a660b647384179f82e1da8e063264f Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 16:28:35 +0000 Subject: [PATCH 72/74] Remove all traces of external RGB database (and Speedo) Remove all references to an external RGB database (which hasn't been enabled for a very long time). Also get rid of some references to Speedo fonts. --- configure.ac | 10 -- dix/globals.c | 1 - hw/xfree86/Makefile.am | 1 - hw/xfree86/common/xf86Config.c | 15 -- hw/xfree86/common/xf86Configure.c | 2 - hw/xfree86/doc/man/xorg.conf.man.pre | 15 -- hw/xfree86/parser/Files.c | 9 -- hw/xfree86/parser/xf86Parser.h | 1 - hw/xfree86/parser/xf86tokens.h | 1 - hw/xfree86/utils/xorgcfg/expert.c | 18 --- hw/xfree86/utils/xorgcfg/interface.c | 6 +- hw/xfree86/utils/xorgcfg/startx.c | 3 - hw/xfree86/utils/xorgcfg/xorgcfg.man.pre | 4 - hw/xfree86/utils/xorgconfig/xorgconfig.c | 13 -- hw/xfree86/xorgconf.cpp | 6 - hw/xwin/InitOutput.c | 18 --- hw/xwin/winconfig.c | 23 --- hw/xwin/winconfig.h | 1 - hw/xwin/winprocarg.c | 10 -- include/dix-config.h.in | 9 -- include/globals.h | 1 - include/site.h | 3 - include/xorg-server.h.in | 6 - os/oscolor.c | 169 ++--------------------- os/utils.c | 8 -- 25 files changed, 12 insertions(+), 341 deletions(-) diff --git a/configure.ac b/configure.ac index 57132b090..10f580f47 100644 --- a/configure.ac +++ b/configure.ac @@ -454,9 +454,6 @@ AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XK AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]), [ XKBOUTPUT="$withval" ], [ XKBOUTPUT="compiled" ]) -AC_ARG_WITH(rgb-path, AS_HELP_STRING([--with-rgb-path=PATH], [Path to RGB database (default: ${datadir}/X11/rgb)]), - [ RGBPATH="$withval" ], - [ RGBPATH="${datadir}/X11/rgb" ]) AC_ARG_WITH(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH], [Path to server config (default: ${libdir}/xserver)]), [ SERVERCONFIG="$withval" ], [ SERVERCONFIG="${libdir}/xserver" ]) @@ -1000,13 +997,7 @@ if test "x$XDMAUTH" = xyes; then fi fi -AM_CONDITIONAL(USE_RGB_BUILTIN, [test "x$USE_RGB_BUILTIN" = xyes]) -if test "x$USE_RGB_BUILTIN" = xyes; then - AC_DEFINE(USE_RGB_BUILTIN, 1, [Use built-in RGB color database]) -fi - AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path]) -AC_DEFINE_DIR(RGB_DB, RGBPATH, [Default RGB path]) AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path]) AC_DEFINE_DIR(SERVERCONFIGdir, SERVERCONFIG, [Server config path]) AC_DEFINE_DIR(BASE_FONT_PATH, FONTDIR, [Default base font path]) @@ -1042,7 +1033,6 @@ else fi AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes]) -AC_DEFINE(USE_RGB_TXT, 1, [Use rgb.txt directly]) AC_DEFINE(MITMISC, 1, [Support MIT Misc extension]) AC_DEFINE(XTEST, 1, [Support XTest extension]) AC_DEFINE(XSYNC, 1, [Support XSync extension]) diff --git a/dix/globals.c b/dix/globals.c index f86c6026d..d76b604da 100644 --- a/dix/globals.c +++ b/dix/globals.c @@ -136,7 +136,6 @@ Bool screenSaverSuspended = FALSE; char *defaultFontPath = COMPILEDDEFAULTFONTPATH; char *defaultTextFont = COMPILEDDEFAULTFONT; char *defaultCursorFont = COMPILEDCURSORFONT; -char *rgbPath = RGB_DB; char *defaultDisplayClass = COMPILEDDISPLAYCLASS; FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in every compilation of dix code */ diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am index 627703338..4afc3a4e5 100644 --- a/hw/xfree86/Makefile.am +++ b/hw/xfree86/Makefile.am @@ -100,7 +100,6 @@ optionsdir = $(libdir)/X11 dist_options_DATA = Options CPP_FILES_FLAGS = \ - -DRGBPATH=\"$(RGB_DB)\" \ -DLOCALFONTPATH="\"$(BASE_FONT_PATH)/local\"" \ -DMISCFONTPATH="\"$(BASE_FONT_PATH)/misc\"" \ -DT1FONTPATH="\"$(BASE_FONT_PATH)/Type1\"" \ diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index b8929c3dd..638027432 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -699,21 +699,6 @@ configFiles(XF86ConfFilesPtr fileconf) } - /* RgbPath */ - - pathFrom = X_DEFAULT; - - if (xf86coFlag) - pathFrom = X_CMDLINE; - else if (fileconf) { - if (fileconf->file_rgbpath) { - rgbPath = fileconf->file_rgbpath; - pathFrom = X_CONFIG; - } - } - - xf86Msg(pathFrom, "RgbPath set to \"%s\"\n", rgbPath); - if (fileconf && fileconf->file_inputdevs) { xf86InputDeviceList = fileconf->file_inputdevs; xf86Msg(X_CONFIG, "Input device list set to \"%s\"\n", diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index f896c29aa..0cf445cdb 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -605,8 +605,6 @@ configureFilesSection (void) ptr->file_modulepath = strdup(xf86ModulePath); if (defaultFontPath) ptr->file_fontpath = strdup(defaultFontPath); - if (rgbPath) - ptr->file_rgbpath = strdup(rgbPath); return ptr; } diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre index 4064ef6d8..3c657d0f0 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/doc/man/xorg.conf.man.pre @@ -373,7 +373,6 @@ The recommended font path contains the following font path elements: .I __projectroot__/lib/X11/fonts/75dpi/:unscaled .I __projectroot__/lib/X11/fonts/100dpi/:unscaled .I __projectroot__/lib/X11/fonts/Type1/ -.I __projectroot__/lib/X11/fonts/Speedo/ .I __projectroot__/lib/X11/fonts/75dpi/ .I __projectroot__/lib/X11/fonts/100dpi/ .fi @@ -383,20 +382,6 @@ Font path elements that are found to be invalid are removed from the font path when the server starts up. .RE .TP 7 -.BI "RGBPath \*q" path \*q -sets the path name for the RGB color database. -When this entry is not specified in the config file, the server falls back -to the compiled\-in default RGB path, which is: -.PP -.RS 11 -.I __projectroot__/share/X11/rgb -.RE -.PP -Note that an implicit -.I .txt -is added to this path if the server was compiled to use text rather than -binary format RGB color databases. -.TP 7 .BI "ModulePath \*q" path \*q sets the search path for loadable __xservername__ server modules. This path is a comma separated list of directories which the __xservername__ server diff --git a/hw/xfree86/parser/Files.c b/hw/xfree86/parser/Files.c index 8cec2a91a..3777432b1 100644 --- a/hw/xfree86/parser/Files.c +++ b/hw/xfree86/parser/Files.c @@ -69,7 +69,6 @@ static xf86ConfigSymTabRec FilesTab[] = { {ENDSECTION, "endsection"}, {FONTPATH, "fontpath"}, - {RGBPATH, "rgbpath"}, {MODULEPATH, "modulepath"}, {INPUTDEVICES, "inputdevices"}, {LOGFILEPATH, "logfile"}, @@ -122,11 +121,6 @@ xf86parseFilesSection (void) strcat (ptr->file_fontpath, str); xf86conffree (val.str); break; - case RGBPATH: - if (xf86getSubToken (&(ptr->file_comment)) != STRING) - Error (QUOTE_MSG, "RGBPath"); - ptr->file_rgbpath = val.str; - break; case MODULEPATH: if (xf86getSubToken (&(ptr->file_comment)) != STRING) Error (QUOTE_MSG, "ModulePath"); @@ -216,8 +210,6 @@ xf86printFileSection (FILE * cf, XF86ConfFilesPtr ptr) fprintf (cf, "%s", ptr->file_comment); if (ptr->file_logfile) fprintf (cf, "\tLogFile \"%s\"\n", ptr->file_logfile); - if (ptr->file_rgbpath) - fprintf (cf, "\tRgbPath \"%s\"\n", ptr->file_rgbpath); if (ptr->file_modulepath) { s = ptr->file_modulepath; @@ -272,7 +264,6 @@ xf86freeFiles (XF86ConfFilesPtr p) return; TestFree (p->file_logfile); - TestFree (p->file_rgbpath); TestFree (p->file_modulepath); TestFree (p->file_inputdevs); TestFree (p->file_fontpath); diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h index dc30823cc..a078361d3 100644 --- a/hw/xfree86/parser/xf86Parser.h +++ b/hw/xfree86/parser/xf86Parser.h @@ -71,7 +71,6 @@ typedef struct { char *file_logfile; - char *file_rgbpath; char *file_modulepath; char *file_inputdevs; char *file_fontpath; diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h index 822bbb9b7..786dac145 100644 --- a/hw/xfree86/parser/xf86tokens.h +++ b/hw/xfree86/parser/xf86tokens.h @@ -97,7 +97,6 @@ typedef enum { /* File tokens */ FONTPATH, - RGBPATH, MODULEPATH, INPUTDEVICES, LOGFILEPATH, diff --git a/hw/xfree86/utils/xorgcfg/expert.c b/hw/xfree86/utils/xorgcfg/expert.c index 5c22a6e70..bb6960ce7 100644 --- a/hw/xfree86/utils/xorgcfg/expert.c +++ b/hw/xfree86/utils/xorgcfg/expert.c @@ -472,15 +472,6 @@ CreateFiles(TreeNode *files) files->child = node; files->update = UpdateFiles; - if (XF86RGB_path) - value = XF86RGB_path; - else - value = file->file_rgbpath ? file->file_rgbpath : ""; - node->next = NewNode(files, NULL, NULL, files->node, - (TreeData*)XtCalloc(1, sizeof(TreeData))); - node = node->next; - CreateFilesField(node, "RgbPath", value); - w = XtVaCreateManagedWidget("ModulePath", toggleWidgetClass, tree, XtNtreeParent, files->node, NULL); node->next = modulepath = NewNode(files, w, w, files->node, NULL); @@ -523,15 +514,6 @@ UpdateFiles(TreeNode *files) XF86Config->conf_files->file_logfile = XtNewString(str); else XF86Config->conf_files->file_logfile = NULL; - - /* LogFile */ - files = files->next; - XtVaGetValues(files->data->files.text, XtNstring, &str, NULL); - XtFree(XF86Config->conf_files->file_rgbpath); - if (*str) - XF86Config->conf_files->file_rgbpath = XtNewString(str); - else - XF86Config->conf_files->file_rgbpath = NULL; } /* FontPath */ diff --git a/hw/xfree86/utils/xorgcfg/interface.c b/hw/xfree86/utils/xorgcfg/interface.c index 9b22dc7cb..cb39624ca 100644 --- a/hw/xfree86/utils/xorgcfg/interface.c +++ b/hw/xfree86/utils/xorgcfg/interface.c @@ -213,7 +213,6 @@ Usage(void) " -modulepath "__XSERVERNAME__" modules location.\n" " -serverpath X server to start (if $DISPLAY is not defined).\n" " -fontpath Font path for fonts.\n" -" -rgbpath Where the rgb.txt file is located.\n" #ifdef HAS_NCURSES " -textmode Use this option for the text only interface.\n" #endif @@ -270,10 +269,7 @@ main(int argc, char *argv[]) } else if (strcmp(argv[i], "-fontpath") == 0) { if (i + 1 < argc) XF86Font_path = argv[++i]; - } else if (strcmp(argv[i], "-rgbpath") == 0) { - if (i + 1 < argc) - XF86RGB_path = argv[++i]; - } + } #ifdef HAS_NCURSES else if (strcmp(argv[i], "-textmode") == 0) textmode = True; diff --git a/hw/xfree86/utils/xorgcfg/startx.c b/hw/xfree86/utils/xorgcfg/startx.c index 7b730c9aa..507afbf15 100644 --- a/hw/xfree86/utils/xorgcfg/startx.c +++ b/hw/xfree86/utils/xorgcfg/startx.c @@ -73,9 +73,6 @@ startx(void) if (XF86Font_path && ((len = sizeof(commandline) - c_pos) > 0)) c_pos += XmuSnprintf(commandline + c_pos,len, " -fontpath %s",XF86Font_path); - if (XF86RGB_path && ((len = sizeof(commandline) - c_pos) > 0)) - c_pos += XmuSnprintf(commandline + c_pos,len, - " -rgbpath %s",XF86RGB_path); if (system(commandline) != 0) { fprintf(stderr, "Failed to run \"X -configure\".\n"); diff --git a/hw/xfree86/utils/xorgcfg/xorgcfg.man.pre b/hw/xfree86/utils/xorgcfg/xorgcfg.man.pre index 45fbb4969..71e75e2d8 100644 --- a/hw/xfree86/utils/xorgcfg/xorgcfg.man.pre +++ b/hw/xfree86/utils/xorgcfg/xorgcfg.man.pre @@ -84,10 +84,6 @@ __xservername__ binary. Specifies the path to the fonts that should be used by the server started by xorgcfg. .TP 8 -.I -rgbpath -Specifies the path to the rgb.txt file that should be used by the server -started by xorgcfg, if any. -.TP 8 .I -textmode If xorgcfg was compiled with support for ncurses, this option makes xorgcfg enter a text mode interface. diff --git a/hw/xfree86/utils/xorgconfig/xorgconfig.c b/hw/xfree86/utils/xorgconfig/xorgconfig.c index f50b4e225..efabc9d1f 100644 --- a/hw/xfree86/utils/xorgconfig/xorgconfig.c +++ b/hw/xfree86/utils/xorgconfig/xorgconfig.c @@ -1898,22 +1898,10 @@ static char *XF86Config_firstchunk_text = "\n" "Section \"Files\"\n" "\n" -"# The location of the RGB database. Note, this is the name of the\n" -"# file minus the extension (like \".txt\" or \".db\"). There is normally\n" -"# no need to change the default.\n" -"\n" -"# RgbPath \"" TREEROOTSHARE "/rgb\"\n" -"\n" "# Multiple FontPath entries are allowed (which are concatenated together),\n" "# as well as specifying multiple comma-separated entries in one FontPath\n" "# command (or a combination of both methods)\n" "# \n" -#if 0 -"# If you don't have a floating point coprocessor and emacs, Mosaic or other\n" -"# programs take long to start up, try moving the Type1 directory\n" -"# to the end of this list (or comment it out).\n" -#endif -"# \n" "\n"; static char *XF86Config_fontpaths[] = @@ -1923,7 +1911,6 @@ static char *XF86Config_fontpaths[] = "/misc/", "/75dpi/:unscaled", "/100dpi/:unscaled", - "/Speedo/", "/Type1/", "/TrueType/", "/freefont/", diff --git a/hw/xfree86/xorgconf.cpp b/hw/xfree86/xorgconf.cpp index 1995045b8..acf90f13f 100644 --- a/hw/xfree86/xorgconf.cpp +++ b/hw/xfree86/xorgconf.cpp @@ -42,12 +42,6 @@ XCOMM ********************************************************************** Section "Files" -XCOMM The location of the RGB database. Note, this is the name of the -XCOMM file minus the extension (like ".txt" or ".db"). There is normally -XCOMM no need to change the default. - - RgbPath RGBPATH - XCOMM Multiple FontPath entries are allowed (which are concatenated together), XCOMM as well as specifying multiple comma-separated entries in one FontPath XCOMM command (or a combination of both methods) diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index f966d4026..d2159813c 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -600,24 +600,6 @@ winFixupPaths (void) winMsg (font_from, "FontPath set to \"%s\"\n", defaultFontPath); #ifdef RELOCATE_PROJECTROOT - if (1) { - const char *libx11dir = "/usr/X11R6/lib/X11"; - size_t libx11dir_len = strlen(libx11dir); - - if (strncmp(libx11dir, rgbPath, libx11dir_len) == 0) - { - size_t newsize = strlen(rgbPath) - libx11dir_len + basedirlen; - char *compose = malloc(newsize + 1); - strcpy(compose, basedir); - strcat(compose, rgbPath + libx11dir_len); - compose[newsize] = 0; - rgbPath = xstrdup (compose); - free (compose); - - winMsg (X_DEFAULT, "RgbPath set to \"%s\"\n", rgbPath); - } - } - if (getenv("XKEYSYMDB") == NULL) { char buffer[MAX_PATH]; diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c index 2c1877172..a68ead266 100644 --- a/hw/xwin/winconfig.c +++ b/hw/xwin/winconfig.c @@ -65,7 +65,6 @@ WinCmdlineRec g_cmdline = { NULL, /* configFile */ #endif NULL, /* fontPath */ - NULL, /* rgbPath */ #ifdef XWIN_XF86CONFIG NULL, /* keyboard */ #endif @@ -673,20 +672,6 @@ winConfigFiles () } winMsg (from, "FontPath set to \"%s\"\n", defaultFontPath); - /* RGBPath */ - from = X_DEFAULT; - if (g_cmdline.rgbPath) - { - from = X_CMDLINE; - rgbPath = g_cmdline.rgbPath; - } - else if (filesptr != NULL && filesptr->file_rgbpath) - { - from = X_CONFIG; - rgbPath = xstrdup (filesptr->file_rgbpath); - } - winMsg (from, "RgbPath set to \"%s\"\n", rgbPath); - return TRUE; } #else @@ -702,14 +687,6 @@ winConfigFiles () winMsg (X_CMDLINE, "FontPath set to \"%s\"\n", defaultFontPath); } - /* RGBPath */ - if (g_cmdline.rgbPath) - { - from = X_CMDLINE; - rgbPath = g_cmdline.rgbPath; - winMsg (X_CMDLINE, "RgbPath set to \"%s\"\n", rgbPath); - } - return TRUE; } #endif diff --git a/hw/xwin/winconfig.h b/hw/xwin/winconfig.h index 8fd9841d7..4b56d639c 100644 --- a/hw/xwin/winconfig.h +++ b/hw/xwin/winconfig.h @@ -190,7 +190,6 @@ typedef struct char *configFile; #endif char *fontPath; - char *rgbPath; /* input devices - keyboard */ #ifdef XWIN_XF86CONFIG char *keyboard; diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index bd0b99977..7139cbaab 100755 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -1277,16 +1277,6 @@ ddxProcessArgument (int argc, char *argv[], int i) return 0; /* Let DIX parse this again */ } - /* - * Look for the '-co' argument - */ - if (IS_OPTION ("-co")) - { - CHECK_ARGS (1); - g_cmdline.rgbPath = argv[++i]; - return 0; /* Let DIX parse this again */ - } - /* * Look for the '-query' argument */ diff --git a/include/dix-config.h.in b/include/dix-config.h.in index 5635d64ae..d105e511c 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -326,12 +326,6 @@ /* Support UNIX socket connections */ #undef UNIXCONN -/* Use builtin rgb color database */ -#undef USE_RGB_BUILTIN - -/* Use rgb.txt directly */ -#undef USE_RGB_TXT - /* Define to use byteswap macros from */ #undef USE_SYS_ENDIAN_H @@ -464,9 +458,6 @@ /* Define to 1 if unsigned long is 64 bits. */ #undef _XSERVER64 -/* Define to location of RGB database */ -#undef RGB_DB - /* System is BSD-like */ #undef CSRG_BASED diff --git a/include/globals.h b/include/globals.h index e23ce7798..b230dfc37 100644 --- a/include/globals.h +++ b/include/globals.h @@ -16,7 +16,6 @@ extern Bool screenSaverSuspended; #endif extern char *defaultFontPath; -extern char *rgbPath; extern int monitorResolution; extern Bool loadableFonts; extern int defaultColorVisualClass; diff --git a/include/site.h b/include/site.h index 5b9f25815..279cf2d70 100644 --- a/include/site.h +++ b/include/site.h @@ -75,9 +75,6 @@ SOFTWARE. #ifndef COMPILEDDEFAULTFONTPATH #define COMPILEDDEFAULTFONTPATH "/usr/lib/X11/fonts/misc/" #endif -#ifndef RGB_DB -#define RGB_DB "/usr/lib/X11/rgb" -#endif /* * The following constants contain default values for all of the variables diff --git a/include/xorg-server.h.in b/include/xorg-server.h.in index c117dfa33..2a0a5f5e2 100644 --- a/include/xorg-server.h.in +++ b/include/xorg-server.h.in @@ -109,12 +109,6 @@ /* Support UNIX socket connections */ #undef UNIXCONN -/* Use builtin rgb color database */ -#undef USE_RGB_BUILTIN - -/* Use rgb.txt directly */ -#undef USE_RGB_TXT - /* unaligned word accesses behave as expected */ #undef WORKING_UNALIGNED_INT diff --git a/os/oscolor.c b/os/oscolor.c index 6f3a7fa4a..f3ff9beac 100644 --- a/os/oscolor.c +++ b/os/oscolor.c @@ -49,13 +49,20 @@ SOFTWARE. #include #endif -#define USE_RGB_BUILTIN 1 - -#if USE_RGB_BUILTIN - #include #include "os.h" +typedef struct _builtinColor { + unsigned char red; + unsigned char green; + unsigned char blue; + unsigned short name; +} BuiltinColor; + +/* These have to come after the struct definition because despair. */ +#include "oscolor.h" +#define NUM_BUILTIN_COLORS (sizeof (BuiltinColors) / sizeof (BuiltinColors[0])) + static unsigned char OsToLower (unsigned char a) { @@ -90,17 +97,6 @@ OsStrCaseCmp (const unsigned char *s1, const unsigned char *s2, int l2) return c2 - c1; } -typedef struct _builtinColor { - unsigned char red; - unsigned char green; - unsigned char blue; - unsigned short name; -} BuiltinColor; - -#include "oscolor.h" - -#define NUM_BUILTIN_COLORS (sizeof (BuiltinColors) / sizeof (BuiltinColors[0])) - Bool OsInitColors(void) { @@ -141,146 +137,3 @@ OsLookupColor(int screen, } return FALSE; } - -#else - -/* - * This file builds the server's internal database mapping color names to - * RGB tuples by reading in an rgb.txt file. This is still slightly foolish, - * rgb.txt hasn't changed in years, we should really include a precompiled - * version into the server. - */ - -#include -#include "os.h" -#include "opaque.h" - -#define HASHSIZE 63 - -typedef struct _dbEntry * dbEntryPtr; -typedef struct _dbEntry { - dbEntryPtr link; - unsigned short red; - unsigned short green; - unsigned short blue; - char name[1]; /* some compilers complain if [0] */ -} dbEntry; - -extern void CopyISOLatin1Lowered( - unsigned char * /*dest*/, - unsigned char * /*source*/, - int /*length*/); - -static dbEntryPtr hashTab[HASHSIZE]; - -static dbEntryPtr -lookup(char *name, int len, Bool create) -{ - unsigned int h = 0, g; - dbEntryPtr entry, *prev = NULL; - char *str = name; - - if (!(name = (char*)xalloc(len +1))) return NULL; - CopyISOLatin1Lowered((unsigned char *)name, (unsigned char *)str, len); - name[len] = '\0'; - - for(str = name; *str; str++) { - h = (h << 4) + *str; - if ((g = h) & 0xf0000000) h ^= (g >> 24); - h &= g; - } - h %= HASHSIZE; - - if ( (entry = hashTab[h]) ) - { - for( ; entry; prev = (dbEntryPtr*)entry, entry = entry->link ) - if (! strcmp(name, entry->name) ) break; - } - else - prev = &(hashTab[h]); - - if (!entry && create && (entry = (dbEntryPtr)xalloc(sizeof(dbEntry) +len))) - { - *prev = entry; - entry->link = NULL; - strcpy( entry->name, name ); - } - - xfree(name); - - return entry; -} - -Bool -OsInitColors(void) -{ - FILE *rgb; - char *path; - char line[BUFSIZ]; - char name[BUFSIZ]; - int red, green, blue, lineno = 0; - dbEntryPtr entry; - - static Bool was_here = FALSE; - - if (!was_here) - { - path = (char*)xalloc(strlen(rgbPath) +5); - strcpy(path, rgbPath); - strcat(path, ".txt"); - if (!(rgb = fopen(path, "r"))) - { - ErrorF( "Couldn't open RGB_DB '%s'\n", rgbPath ); - xfree(path); - return FALSE; - } - - while(fgets(line, sizeof(line), rgb)) - { - lineno++; - if (sscanf(line,"%d %d %d %[^\n]\n", &red, &green, &blue, name) == 4) - { - if (red >= 0 && red <= 0xff && - green >= 0 && green <= 0xff && - blue >= 0 && blue <= 0xff) - { - if ((entry = lookup(name, strlen(name), TRUE))) - { - entry->red = (red * 65535) / 255; - entry->green = (green * 65535) / 255; - entry->blue = (blue * 65535) / 255; - } - } - else - ErrorF("Value out of range: %s:%d\n", path, lineno); - } - else if (*line && *line != '#' && *line != '!') - ErrorF("Syntax Error: %s:%d\n", path, lineno); - } - - fclose(rgb); - xfree(path); - - was_here = TRUE; - } - return TRUE; -} - -Bool -OsLookupColor(int screen, char *name, unsigned int len, - unsigned short *pred, unsigned short *pgreen, unsigned short *pblue) -{ - dbEntryPtr entry; - - if ((entry = lookup(name, len, FALSE))) - { - *pred = entry->red; - *pgreen = entry->green; - *pblue = entry->blue; - return TRUE; - } - - return FALSE; -} - -#endif /* USE_RGB_BUILTIN */ diff --git a/os/utils.c b/os/utils.c index 6fc1f7d43..322814669 100644 --- a/os/utils.c +++ b/os/utils.c @@ -577,7 +577,6 @@ void UseMsg(void) ErrorF("-c turns off key-click\n"); ErrorF("c # key-click volume (0-100)\n"); ErrorF("-cc int default color visual class\n"); - ErrorF("-co file color database file\n"); #ifdef COMMANDLINE_CHALLENGED_OPERATING_SYSTEMS ErrorF("-config file read options from file\n"); #endif @@ -783,13 +782,6 @@ ProcessCommandLine(int argc, char *argv[]) else UseMsg(); } - else if ( strcmp( argv[i], "-co") == 0) - { - if(++i < argc) - rgbPath = argv[i]; - else - UseMsg(); - } else if ( strcmp( argv[i], "-core") == 0) { CoreDump = TRUE; From 4113f040c587fc536adc693d7ee5a4c0a60b75d4 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Mon, 5 Nov 2007 17:33:01 +0100 Subject: [PATCH 73/74] GL: fix crash at mesa destruction time * GL/glx/glxglcore.c: (_glXMesaScreenDestroy): delete the same amount of visuals that those which were created in createMesaVisuals(). --- GL/glx/glxglcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GL/glx/glxglcore.c b/GL/glx/glxglcore.c index 4cc00a360..0750e1282 100644 --- a/GL/glx/glxglcore.c +++ b/GL/glx/glxglcore.c @@ -265,7 +265,7 @@ __glXMesaScreenDestroy(__GLXscreen *screen) int i; if (mesaScreen->xm_vis) { - for (i = 0; i < mesaScreen->num_vis; i++) { + for (i = 0; i < mesaScreen->base.numFBConfigs; i++) { if (mesaScreen->xm_vis[i]) XMesaDestroyVisual(mesaScreen->xm_vis[i]); } From 58332894c061ae96d6a457f65266660f5f65e88b Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 5 Nov 2007 17:17:25 -0500 Subject: [PATCH 74/74] Export the server ABI versions from xorg-server.pc --- configure.ac | 11 +++++++++++ xorg-server.pc.in | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/configure.ac b/configure.ac index 10f580f47..a09a5c2bc 100644 --- a/configure.ac +++ b/configure.ac @@ -1536,6 +1536,17 @@ dnl has it in libc), or if libdl is needed to get it. AC_SUBST([sdkdir]) AC_SUBST([extdir]) AC_SUBST([logdir]) + + # stuff the ABI versions into the pc file too + extract_abi() { + grep ^.define.*${1}_VERSION ${srcdir}/hw/xfree86/common/xf86Module.h | tr '(),' ' .' | awk '{ print $4$5 }' + } + abi_ansic=`extract_abi ANSIC` + abi_videodrv=`extract_abi VIDEODRV` + abi_xinput=`extract_abi XINPUT` + abi_extension=`extract_abi EXTENSION` + abi_font=`extract_abi FONT` + AC_SUBST([abi_ansic abi_videodrv abi_xinput abi_extension abi_font]) fi AM_CONDITIONAL([XORG], [test "x$XORG" = xyes]) AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes]) diff --git a/xorg-server.pc.in b/xorg-server.pc.in index c1cdb7d2a..53b4ed28c 100644 --- a/xorg-server.pc.in +++ b/xorg-server.pc.in @@ -5,6 +5,12 @@ includedir=@includedir@ moduledir=@moduledir@ sdkdir=@sdkdir@ +abi_ansic=@abi_ansic@ +abi_videodrv=@abi_videodrv@ +abi_xinput=@abi_xinput@ +abi_extension=@abi_extension@ +abi_font=@abi_font@ + Name: xorg-server Description: Modular X.Org X Server Version: @PACKAGE_VERSION@