From 30bcaa966d6b00f1630609a78db18dee683cc43d Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 25 Oct 2007 18:48:06 -0400 Subject: 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(-) (limited to 'GL') 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; -- cgit v1.2.3 From f62277d421023b3150d3a1accb00a8206ab2bde3 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 25 Oct 2007 18:48:39 -0400 Subject: Clean up unused pVisual part of __GLXcontext. --- GL/glx/glxcmds.c | 4 +--- GL/glx/glxcontext.h | 5 ----- 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'GL') 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. */ -- cgit v1.2.3 From 80d8a3e1767609a92b0b85a7e92cea5f0748038a Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 26 Oct 2007 10:19:57 -0400 Subject: Quiet glx visual debug info. --- GL/glx/glxscreens.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'GL') 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; -- cgit v1.2.3 From 497aba894904b08b15bb19916e2a163f96212a7d Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 26 Oct 2007 11:25:57 -0400 Subject: 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(-) (limited to 'GL') 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; } -- cgit v1.2.3 From 692654b4300e61a9481e6fa588bcb44a3c3ca150 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Mon, 29 Oct 2007 18:13:58 -0400 Subject: 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 | 57 +++++++++++++++++++++++++++++------------- hw/xfree86/common/xf86Config.c | 2 +- hw/xfree86/dri/xf86dri.c | 2 -- 3 files changed, 41 insertions(+), 20 deletions(-) (limited to 'GL') 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); } -static void -addMinimalSet(__GLXscreen *pGlxScreen) +typedef struct { + GLboolean doubleBuffer; + GLboolean depthBuffer; +} FBConfigTemplateRec, *FBConfigTemplatePtr; + +static __GLcontextModes * +pickFBConfig(__GLXscreen *pGlxScreen, FBConfigTemplatePtr template, int class) { __GLcontextModes *config; - VisualPtr visuals; - int depth; for (config = pGlxScreen->fbconfigs; config != NULL; config = config->next) { if (config->visualRating != GLX_NONE) continue; - if (config->doubleBufferMode && config->depthBits > 0) - break; + 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; } - if (config == NULL) - config = pGlxScreen->fbconfigs; - pGlxScreen->visuals = xcalloc(1, sizeof (__GLcontextModes *)); + return NULL; +} + +static void +addMinimalSet(__GLXscreen *pGlxScreen) +{ + __GLcontextModes *config; + VisualPtr visuals; + int i; + FBConfigTemplateRec best = { GL_TRUE, GL_TRUE }; + FBConfigTemplateRec minimal = { GL_FALSE, GL_FALSE }; + + 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); -- cgit v1.2.3 From f2e310132fbe1520c1b5f3da4faa2d2d47835e72 Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Wed, 31 Oct 2007 14:15:35 -0700 Subject: 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(-) (limited to 'GL') 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); -- cgit v1.2.3 From 4113f040c587fc536adc693d7ee5a4c0a60b75d4 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Mon, 5 Nov 2007 17:33:01 +0100 Subject: 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(-) (limited to 'GL') 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]); } -- cgit v1.2.3