diff options
Diffstat (limited to 'xc/programs/Xserver/dix/dispatch.c')
-rw-r--r-- | xc/programs/Xserver/dix/dispatch.c | 224 |
1 files changed, 13 insertions, 211 deletions
diff --git a/xc/programs/Xserver/dix/dispatch.c b/xc/programs/Xserver/dix/dispatch.c index 2a64d0381..9250a65ab 100644 --- a/xc/programs/Xserver/dix/dispatch.c +++ b/xc/programs/Xserver/dix/dispatch.c @@ -64,7 +64,7 @@ SOFTWARE. * * *****************************************************************/ -/* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.15 1999/11/19 13:53:36 hohndel Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.18 2000/02/12 03:39:39 dawes Exp $ */ #ifdef PANORAMIX_DEBUG #include <stdio.h> @@ -251,7 +251,6 @@ FlushClientCaches(id) } } } - #ifdef SMART_SCHEDULE #define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */ @@ -853,15 +852,10 @@ int ProcQueryTree(client) register ClientPtr client; { - xQueryTreeReply reply; int numChildren = 0; register WindowPtr pChild, pWin, pHead; Window *childIDs = (Window *)NULL; -#ifdef PANORAMIX - PanoramiXWindow *pPanoramiXWin = PanoramiXWinRoot; - int j, thisScreen; -#endif REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); @@ -876,55 +870,6 @@ ProcQueryTree(client) reply.parent = pWin->parent->drawable.id; else reply.parent = (Window)None; -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) { - thisScreen = 0; - for (j = 0; j <= PanoramiXNumScreens - 1; j++) { - if ( pWin->winSize.extents.x1 < (panoramiXdataPtr[j].x + panoramiXdataPtr[j].width)) { - thisScreen = j; - break; - } - } - } - if ( !noPanoramiXExtension && thisScreen ) { - PANORAMIXFIND_ID(pPanoramiXWin, pWin->drawable.id); - IF_RETURN(!pPanoramiXWin, BadWindow); - pWin = (WindowPtr)SecurityLookupWindow(pPanoramiXWin->info[thisScreen].id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - pHead = RealChildHead(pWin); - for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) - numChildren++; - if (numChildren) - { - int curChild = 0; - childIDs = (Window *) ALLOCATE_LOCAL(numChildren * sizeof(Window)); - if (!childIDs) - return BadAlloc; - for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) { - pPanoramiXWin = PanoramiXWinRoot; - PANORAMIXFIND_ID_BY_SCRNUM(pPanoramiXWin, pChild->drawable.id, thisScreen); - IF_RETURN(!pPanoramiXWin, BadWindow); - childIDs[curChild++] = pPanoramiXWin->info[0].id; - } - } /* numChildren */ - }else { /* otherwise its screen 0, and nothing changes */ - pHead = RealChildHead(pWin); - for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) - numChildren++; - if (numChildren) - { - int curChild = 0; - - childIDs = (Window *) ALLOCATE_LOCAL(numChildren * sizeof(Window)); - if (!childIDs) - return BadAlloc; - for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) - childIDs[curChild++] = pChild->drawable.id; - } - } -#else pHead = RealChildHead(pWin); for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) numChildren++; @@ -938,7 +883,6 @@ ProcQueryTree(client) for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) childIDs[curChild++] = pChild->drawable.id; } -#endif reply.nChildren = numChildren; reply.length = (numChildren * sizeof(Window)) >> 2; @@ -2018,6 +1962,7 @@ ProcPolyFillRectangle(client) if (things & 4) return(BadLength); things >>= 3; + if (things) (*pGC->ops->PolyFillRect) (pDraw, pGC, things, (xRectangle *) &stuff[1]); @@ -2074,9 +2019,6 @@ ProcPutImage(client) (stuff->leftPad >= (unsigned int)screenInfo.bitmapScanlinePad)) return BadMatch; length = BitmapBytePad(stuff->width + stuff->leftPad); -#ifdef INTERNAL_VS_EXTERNAL_PADDING - lengthProto = BitmapBytePadProto(stuff->width + stuff->leftPad); -#endif } else if (stuff->format == XYPixmap) { @@ -2085,19 +2027,12 @@ ProcPutImage(client) return BadMatch; length = BitmapBytePad(stuff->width + stuff->leftPad); length *= stuff->depth; -#ifdef INTERNAL_VS_EXTERNAL_PADDING - lengthProto = BitmapBytePadProto(stuff->width + stuff->leftPad); - lengthProto *= stuff->depth; -#endif } else if (stuff->format == ZPixmap) { if ((pDraw->depth != stuff->depth) || (stuff->leftPad != 0)) return BadMatch; length = PixmapBytePad(stuff->width, stuff->depth); -#ifdef INTERNAL_VS_EXTERNAL_PADDING - lengthProto = PixmapBytePadProto(stuff->width, stuff->depth); -#endif } else { @@ -2105,50 +2040,8 @@ ProcPutImage(client) return BadValue; } -#ifdef INTERNAL_VS_EXTERNAL_PADDING - /* handle 64 bit case where protocol may pad to 32 and we want 64 */ - if ( length != lengthProto ) { - register int i; - char * stuffptr, /* pointer into protocol data */ - * tmpptr; /* new location to copy to */ - - if(!(tmpImage = (char *) ALLOCATE_LOCAL(length*stuff->height))) - return (BadAlloc); - - bzero(tmpImage,length*stuff->height); - - if ( stuff->format == XYPixmap ) { - int lineBytes = BitmapBytePad(stuff->width + stuff->leftPad); - int lineBytesProto = - BitmapBytePadProto(stuff->width + stuff->leftPad); - int depth = stuff->depth; - - stuffptr = (char *)&stuff[1]; - tmpptr = tmpImage; - for ( i = 0; i < stuff->height*stuff->depth; - stuffptr += lineBytesProto,tmpptr += lineBytes, i++) - memmove(tmpptr,stuffptr,lineBytesProto); - } - else { - for ( i = 0,stuffptr = (char *)&stuff[1],tmpptr=tmpImage; - i < stuff->height; - stuffptr += lengthProto,tmpptr += length, i++) - memmove(tmpptr,stuffptr,lengthProto); - } - } - - /* handle 64-bit case where stuff is not 64-bit aligned */ - else if ((unsigned long)&stuff[1] & (sizeof(long)-1)) { - if(!(tmpImage = (char *) ALLOCATE_LOCAL(length*stuff->height))) - return (BadAlloc); - memmove(tmpImage,(char *)&stuff[1],length*stuff->height); - } - else - tmpImage = (char *)&stuff[1]; -#else tmpImage = (char *)&stuff[1]; lengthProto = length; -#endif /* INTERNAL_VS_EXTERNAL_PADDING */ if (((((lengthProto * stuff->height) + (unsigned)3) >> 2) + (sizeof(xPutImageReq) >> 2)) != client->req_len) @@ -2158,12 +2051,6 @@ ProcPutImage(client) stuff->width, stuff->height, stuff->leftPad, stuff->format, tmpImage); -#ifdef INTERNAL_VS_EXTERNAL_PADDING - /* free up our temporary space if used */ - if (tmpImage != (char *)&stuff[1]) - DEALLOCATE_LOCAL(tmpImage); -#endif /* INTERNAL_VS_EXTERNAL_PADDING */ - return (client->noClientException); } @@ -2181,9 +2068,6 @@ DoGetImage(client, format, drawable, x, y, width, height, planemask, im_return) int nlines, linesPerBuf; register int linesDone; long widthBytesLine, length; -#ifdef INTERNAL_VS_EXTERNAL_PADDING - long widthBytesLineProto, lengthProto; -#endif Mask plane; char *pBuf; xGetImageReply xgi; @@ -2234,10 +2118,6 @@ DoGetImage(client, format, drawable, x, y, width, height, planemask, im_return) widthBytesLine = PixmapBytePad(width, pDraw->depth); length = widthBytesLine * height; -#ifdef INTERNAL_VS_EXTERNAL_PADDING - widthBytesLineProto = PixmapBytePadProto(width, pDraw->depth); - lengthProto = widthBytesLineProto * height; -#endif } else { @@ -2247,18 +2127,9 @@ DoGetImage(client, format, drawable, x, y, width, height, planemask, im_return) length = widthBytesLine * height * Ones(planemask & (plane | (plane - 1))); -#ifdef INTERNAL_VS_EXTERNAL_PADDING - widthBytesLineProto = BitmapBytePadProto(width); - lengthProto = widthBytesLineProto * height * - Ones(planemask & (plane | (plane - 1))); -#endif } -#ifdef INTERNAL_VS_EXTERNAL_PADDING - xgi.length = lengthProto; -#else xgi.length = length; -#endif if (im_return) { pBuf = (char *)xalloc(sz_xGetImageReply + length); @@ -2341,35 +2212,13 @@ DoGetImage(client, format, drawable, x, y, width, height, planemask, im_return) nlines, format, pBuf); #endif -#ifdef INTERNAL_VS_EXTERNAL_PADDING - /* for 64-bit server, convert image to pad to 32 bits */ - if ( widthBytesLine != widthBytesLineProto ) { - register char * bufPtr, * protoPtr; - register int i; - - for (i = 1, - bufPtr = pBuf + widthBytesLine, - protoPtr = pBuf + widthBytesLineProto; - i < nlines; - bufPtr += widthBytesLine, - protoPtr += widthBytesLineProto, - i++) - memmove(protoPtr, bufPtr, widthBytesLineProto); - } -#endif /* Note that this is NOT a call to WriteSwappedDataToClient, as we do NOT byte swap */ if (!im_return) /* Don't split me, gcc pukes when you do */ -#ifdef INTERNAL_VS_EXTERNAL_PADDING - (void)WriteToClient(client, - (int)(nlines * widthBytesLineProto), - pBuf); -#else (void)WriteToClient(client, (int)(nlines * widthBytesLine), pBuf); -#endif linesDone += nlines; } } @@ -2399,41 +2248,15 @@ DoGetImage(client, format, drawable, x, y, width, height, planemask, im_return) nlines, format, pBuf); #endif -#ifdef INTERNAL_VS_EXTERNAL_PADDING - /* for 64-bit server, convert image to pad to 32 bits */ - if ( widthBytesLine != widthBytesLineProto ) { - register char * bufPtr, * protoPtr; - register int i; - - for (i = 1, - bufPtr = pBuf + widthBytesLine, - protoPtr = pBuf + widthBytesLineProto; - i < nlines; - bufPtr += widthBytesLine, - protoPtr += widthBytesLineProto, - i++) - memmove(protoPtr, bufPtr, widthBytesLineProto); - } -#endif /* Note: NOT a call to WriteSwappedDataToClient, as we do NOT byte swap */ if (im_return) { -#ifdef INTERNAL_VS_EXTERNAL_PADDING - pBuf += nlines * widthBytesLineProto; -#else pBuf += nlines * widthBytesLine; -#endif } else /* Don't split me, gcc pukes when you do */ -#ifdef INTERNAL_VS_EXTERNAL_PADDING - (void)WriteToClient(client, - (int)(nlines * widthBytesLineProto), - pBuf); -#else (void)WriteToClient(client, (int)(nlines * widthBytesLine), pBuf); -#endif linesDone += nlines; } } @@ -2772,7 +2595,7 @@ ProcAllocColor(client) return (retval); } #ifdef PANORAMIX - if (noPanoramiXExtension) + if (noPanoramiXExtension || !pmap->pScreen->myNum) #endif WriteReplyToClient(client, sizeof(xAllocColorReply), &acr); return (client->noClientException); @@ -2831,7 +2654,7 @@ ProcAllocNamedColor (client) return(retval); } #ifdef PANORAMIX - if (noPanoramiXExtension) + if (noPanoramiXExtension || !pcmp->pScreen->myNum) #endif WriteReplyToClient(client, sizeof (xAllocNamedColorReply), &ancr); return (client->noClientException); @@ -2901,7 +2724,7 @@ ProcAllocColorCells (client) return(retval); } #ifdef PANORAMIX - if (noPanoramiXExtension) + if (noPanoramiXExtension || !pcmp->pScreen->myNum) #endif { accr.type = X_Reply; @@ -2979,9 +2802,14 @@ ProcAllocColorPlanes(client) return(retval); } acpr.length = length >> 2; - WriteReplyToClient(client, sizeof(xAllocColorPlanesReply), &acpr); - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, length, ppixels); +#ifdef PANORAMIX + if (noPanoramiXExtension || !pcmp->pScreen->myNum) +#endif + { + WriteReplyToClient(client, sizeof(xAllocColorPlanesReply), &acpr); + client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; + WriteSwappedDataToClient(client, length, ppixels); + } DEALLOCATE_LOCAL(ppixels); return (client->noClientException); } @@ -3693,16 +3521,6 @@ void CloseDownClient(client) register ClientPtr client; { -#ifdef PANORAMIX - PanoramiXGC *pPanoramiXFreeGC; - PanoramiXGC *pPanoramiXFreeGCback = NULL; - PanoramiXWindow *pPanoramiXFreeWin; - PanoramiXWindow *pPanoramiXFreeWinback = NULL; - PanoramiXCmap *pPanoramiXFreeCmap; - PanoramiXCmap *pPanoramiXFreeCmapback = NULL; - PanoramiXPmap *pPanoramiXFreePmap; - PanoramiXPmap *pPanoramiXFreePmapback = NULL; -#endif Bool really_close_down = client->clientGone || client->closeDownMode == DestroyAll; @@ -3776,9 +3594,6 @@ CloseDownClient(client) CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); } FreeClientResources(client); -#ifdef PANORAMIX - PANORAMIX_FREE(client); -#endif if (client->index < nextFreeClientID) nextFreeClientID = client->index; clients[client->index] = NullClient; @@ -3939,16 +3754,6 @@ NextAvailableClient(ospriv) register int i; register ClientPtr client; xReq data; -#ifdef PANORAMIX - PanoramiXGC *pPanoramiXFreeGC; - PanoramiXGC *pPanoramiXFreeGCback = NULL; - PanoramiXWindow *pPanoramiXFreeWin; - PanoramiXWindow *pPanoramiXFreeWinback = NULL; - PanoramiXCmap *pPanoramiXFreeCmap; - PanoramiXCmap *pPanoramiXFreeCmapback = NULL; - PanoramiXPmap *pPanoramiXFreePmap; - PanoramiXPmap *pPanoramiXFreePmapback = NULL; -#endif i = nextFreeClientID; if (i == MAXCLIENTS) @@ -3968,9 +3773,6 @@ NextAvailableClient(ospriv) if (!InsertFakeRequest(client, (char *)&data, sz_xReq)) { FreeClientResources(client); -#ifdef PANORAMIX - PANORAMIX_FREE(client); -#endif xfree(client); return (ClientPtr)NULL; } |