diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2013-06-07 17:28:57 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2013-06-07 17:28:57 +0000 |
commit | c0190187060808fe0ad2a09b31f4244757572ff9 (patch) | |
tree | b028697436476ae3ff34218b0b233a233d8a7818 /xserver/dix/dispatch.c | |
parent | 33eda071f5846d332b428de759c5b1649e9cf1ba (diff) |
Update to X server 1.14.1. Tested by many during t2k13. Thanks.
Diffstat (limited to 'xserver/dix/dispatch.c')
-rw-r--r-- | xserver/dix/dispatch.c | 462 |
1 files changed, 313 insertions, 149 deletions
diff --git a/xserver/dix/dispatch.c b/xserver/dix/dispatch.c index d97180548..8d6173525 100644 --- a/xserver/dix/dispatch.c +++ b/xserver/dix/dispatch.c @@ -223,7 +223,11 @@ UpdateCurrentTimeIf(void) #define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */ #define SMART_SCHEDULE_MAX_SLICE 200 /* ms */ +#if defined(WIN32) && !defined(__CYGWIN__) +Bool SmartScheduleDisable = TRUE; +#else Bool SmartScheduleDisable = FALSE; +#endif long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; @@ -466,8 +470,6 @@ Dispatch(void) static int VendorRelease = VENDOR_RELEASE; static char *VendorString = VENDOR_NAME; -static const int padlength[4] = { 0, 3, 2, 1 }; - void SetVendorRelease(int release) { @@ -528,7 +530,7 @@ CreateConnectionBlock(void) memmove(pBuf, VendorString, (int) setup.nbytesVendor); sizesofar += setup.nbytesVendor; pBuf += setup.nbytesVendor; - i = padlength[setup.nbytesVendor & 3]; + i = padding_for_int32(setup.nbytesVendor); sizesofar += i; while (--i >= 0) *pBuf++ = 0; @@ -926,10 +928,9 @@ GetGeometry(ClientPtr client, xGetGeometryReply * rep) int ProcGetGeometry(ClientPtr client) { - xGetGeometryReply rep; + xGetGeometryReply rep = { .type = X_Reply }; int status; - memset(&rep, 0, sizeof(xGetGeometryReply)); if ((status = GetGeometry(client, &rep)) != Success) return status; @@ -951,14 +952,13 @@ ProcQueryTree(ClientPtr client) rc = dixLookupWindow(&pWin, stuff->id, client, DixListAccess); if (rc != Success) return rc; - memset(&reply, 0, sizeof(xQueryTreeReply)); - reply.type = X_Reply; - reply.root = pWin->drawable.pScreen->root->drawable.id; - reply.sequenceNumber = client->sequence; - if (pWin->parent) - reply.parent = pWin->parent->drawable.id; - else - reply.parent = (Window) None; + + reply = (xQueryTreeReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .root = pWin->drawable.pScreen->root->drawable.id, + .parent = (pWin->parent) ? pWin->parent->drawable.id : (Window) None + }; pHead = RealChildHead(pWin); for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) numChildren++; @@ -1003,13 +1003,12 @@ ProcInternAtom(ClientPtr client) tchar = (char *) &stuff[1]; atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists); if (atom != BAD_RESOURCE) { - xInternAtomReply reply; - - memset(&reply, 0, sizeof(xInternAtomReply)); - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.atom = atom; + xInternAtomReply reply = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .atom = atom + }; WriteReplyToClient(client, sizeof(xInternAtomReply), &reply); return Success; } @@ -1021,21 +1020,21 @@ int ProcGetAtomName(ClientPtr client) { const char *str; - xGetAtomNameReply reply; - int len; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); if ((str = NameForAtom(stuff->id))) { - len = strlen(str); - memset(&reply, 0, sizeof(xGetAtomNameReply)); - reply.type = X_Reply; - reply.length = bytes_to_int32(len); - reply.sequenceNumber = client->sequence; - reply.nameLength = len; + int len = strlen(str); + xGetAtomNameReply reply = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(len), + .nameLength = len + }; + WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply); - (void) WriteToClient(client, len, str); + WriteToClient(client, len, str); return Success; } else { @@ -1123,10 +1122,12 @@ ProcTranslateCoords(ClientPtr client) rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixGetAttrAccess); if (rc != Success) return rc; - memset(&rep, 0, sizeof(xTranslateCoordsReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; + + rep = (xTranslateCoordsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; if (!SAME_SCREENS(pWin->drawable, pDst->drawable)) { rep.sameScreen = xFalse; rep.child = None; @@ -1288,17 +1289,19 @@ ProcQueryTextExtents(ClientPtr client) } if (!QueryTextExtents(pFont, length, (unsigned char *) &stuff[1], &info)) return BadAlloc; - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.drawDirection = info.drawDirection; - reply.fontAscent = info.fontAscent; - reply.fontDescent = info.fontDescent; - reply.overallAscent = info.overallAscent; - reply.overallDescent = info.overallDescent; - reply.overallWidth = info.overallWidth; - reply.overallLeft = info.overallLeft; - reply.overallRight = info.overallRight; + reply = (xQueryTextExtentsReply) { + .type = X_Reply, + .drawDirection = info.drawDirection, + .sequenceNumber = client->sequence, + .length = 0, + .fontAscent = info.fontAscent, + .fontDescent = info.fontDescent, + .overallAscent = info.overallAscent, + .overallDescent = info.overallDescent, + .overallWidth = info.overallWidth, + .overallLeft = info.overallLeft, + .overallRight = info.overallRight + }; WriteReplyToClient(client, sizeof(xQueryTextExtentsReply), &reply); return Success; } @@ -2143,8 +2146,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, BitsPerPixel(pDraw->depth), ClientOrder(client)); /* Don't split me, gcc pukes when you do */ - (void) WriteToClient(client, - (int) (nlines * widthBytesLine), pBuf); + WriteToClient(client, (int) (nlines * widthBytesLine), pBuf); } linesDone += nlines; } @@ -2179,9 +2181,8 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, 1, ClientOrder(client)); /* Don't split me, gcc pukes when you do */ - (void) WriteToClient(client, - (int) (nlines * widthBytesLine), - pBuf); + WriteToClient(client, (int) (nlines * widthBytesLine), + pBuf); } linesDone += nlines; } @@ -2453,7 +2454,7 @@ ProcListInstalledColormaps(ClientPtr client) preply->type = X_Reply; preply->sequenceNumber = client->sequence; nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps) - (pWin->drawable.pScreen, (Colormap *) & preply[1]); + (pWin->drawable.pScreen, (Colormap *) &preply[1]); preply->nColormaps = nummaps; preply->length = nummaps; WriteReplyToClient(client, sizeof(xListInstalledColormapsReply), preply); @@ -2468,7 +2469,6 @@ ProcAllocColor(ClientPtr client) { ColormapPtr pmap; int rc; - xAllocColorReply acr; REQUEST(xAllocColorReq); @@ -2476,13 +2476,15 @@ ProcAllocColor(ClientPtr client) rc = dixLookupResourceByType((pointer *) &pmap, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { - acr.type = X_Reply; - acr.length = 0; - acr.sequenceNumber = client->sequence; - acr.red = stuff->red; - acr.green = stuff->green; - acr.blue = stuff->blue; - acr.pixel = 0; + xAllocColorReply acr = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .red = stuff->red, + .green = stuff->green, + .blue = stuff->blue, + .pixel = 0 + }; if ((rc = AllocColor(pmap, &acr.red, &acr.green, &acr.blue, &acr.pixel, client->index))) return rc; @@ -2511,12 +2513,11 @@ ProcAllocNamedColor(ClientPtr client) rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { - xAllocNamedColorReply ancr; - - ancr.type = X_Reply; - ancr.length = 0; - ancr.sequenceNumber = client->sequence; - + xAllocNamedColorReply ancr = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; if (OsLookupColor (pcmp->pScreen->myNum, (char *) &stuff[1], stuff->nbytes, &ancr.exactRed, &ancr.exactGreen, &ancr.exactBlue)) { @@ -2557,7 +2558,6 @@ ProcAllocColorCells(ClientPtr client) rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { - xAllocColorCellsReply accr; int npixels, nmasks; long length; Pixel *ppixels, *pmasks; @@ -2587,11 +2587,13 @@ ProcAllocColorCells(ClientPtr client) if (noPanoramiXExtension || !pcmp->pScreen->myNum) #endif { - accr.type = X_Reply; - accr.length = bytes_to_int32(length); - accr.sequenceNumber = client->sequence; - accr.nPixels = npixels; - accr.nMasks = nmasks; + xAllocColorCellsReply accr = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(length), + .nPixels = npixels, + .nMasks = nmasks + }; WriteReplyToClient(client, sizeof(xAllocColorCellsReply), &accr); client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, length, ppixels); @@ -2631,9 +2633,11 @@ ProcAllocColorPlanes(ClientPtr client) client->errorValue = stuff->contiguous; return BadValue; } - acpr.type = X_Reply; - acpr.sequenceNumber = client->sequence; - acpr.nPixels = npixels; + acpr = (xAllocColorPlanesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .nPixels = npixels + }; length = (long) npixels *sizeof(Pixel); ppixels = malloc(length); @@ -2771,11 +2775,12 @@ ProcQueryColors(ClientPtr client) free(prgbs); return rc; } - memset(&qcr, 0, sizeof(xQueryColorsReply)); - qcr.type = X_Reply; - qcr.length = bytes_to_int32(count * sizeof(xrgb)); - qcr.sequenceNumber = client->sequence; - qcr.nColors = count; + qcr = (xQueryColorsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(count * sizeof(xrgb)), + .nColors = count + }; WriteReplyToClient(client, sizeof(xQueryColorsReply), &qcr); if (count) { client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend; @@ -2803,17 +2808,22 @@ ProcLookupColor(ClientPtr client) rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP, client, DixReadAccess); if (rc == Success) { - xLookupColorReply lcr; + CARD16 exactRed, exactGreen, exactBlue; if (OsLookupColor (pcmp->pScreen->myNum, (char *) &stuff[1], stuff->nbytes, - &lcr.exactRed, &lcr.exactGreen, &lcr.exactBlue)) { - lcr.type = X_Reply; - lcr.length = 0; - lcr.sequenceNumber = client->sequence; - lcr.screenRed = lcr.exactRed; - lcr.screenGreen = lcr.exactGreen; - lcr.screenBlue = lcr.exactBlue; + &exactRed, &exactGreen, &exactBlue)) { + xLookupColorReply lcr = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .exactRed = exactRed, + .exactGreen = exactGreen, + .exactBlue = exactBlue, + .screenRed = exactRed, + .screenGreen = exactGreen, + .screenBlue = exactBlue + }; (*pcmp->pScreen->ResolveColor) (&lcr.screenRed, &lcr.screenGreen, &lcr.screenBlue, pcmp->pVisual); @@ -2993,12 +3003,13 @@ ProcQueryBestSize(ClientPtr client) return rc; (*pScreen->QueryBestSize) (stuff->class, &stuff->width, &stuff->height, pScreen); - memset(&reply, 0, sizeof(xQueryBestSizeReply)); - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.width = stuff->width; - reply.height = stuff->height; + reply = (xQueryBestSizeReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .width = stuff->width, + .height = stuff->height + }; WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply); return Success; } @@ -3078,13 +3089,15 @@ ProcGetScreenSaver(ClientPtr client) return rc; } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.timeout = ScreenSaverTime / MILLI_PER_SECOND; - rep.interval = ScreenSaverInterval / MILLI_PER_SECOND; - rep.preferBlanking = ScreenSaverBlanking; - rep.allowExposures = ScreenSaverAllowExposures; + rep = (xGetScreenSaverReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .timeout = ScreenSaverTime / MILLI_PER_SECOND, + .interval = ScreenSaverInterval / MILLI_PER_SECOND, + .preferBlanking = ScreenSaverBlanking, + .allowExposures = ScreenSaverAllowExposures + }; WriteReplyToClient(client, sizeof(xGetScreenSaverReply), &rep); return Success; } @@ -3111,6 +3124,7 @@ ProcListHosts(ClientPtr client) { xListHostsReply reply; int len, nHosts, result; + BOOL enabled; pointer pdata; /* REQUEST(xListHostsReq); */ @@ -3122,13 +3136,17 @@ ProcListHosts(ClientPtr client) if (result != Success) return result; - result = GetHosts(&pdata, &nHosts, &len, &reply.enabled); + result = GetHosts(&pdata, &nHosts, &len, &enabled); if (result != Success) return result; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.nHosts = nHosts; - reply.length = bytes_to_int32(len); + + reply = (xListHostsReply) { + .type = X_Reply, + .enabled = enabled, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(len), + .nHosts = nHosts + }; WriteReplyToClient(client, sizeof(xListHostsReply), &reply); if (nHosts) { client->pSwapReplyFunc = (ReplySwapPtr) SLHostsExtend; @@ -3243,15 +3261,16 @@ ProcGetFontPath(ClientPtr client) if (rc != Success) return rc; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = bytes_to_int32(stringLens + numpaths); - reply.nPaths = numpaths; + reply = (xGetFontPathReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(stringLens + numpaths), + .nPaths = numpaths + }; WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply); if (stringLens || numpaths) - (void) WriteToClient(client, stringLens + numpaths, - (char *) bufferStart); + WriteToClient(client, stringLens + numpaths, bufferStart); return Success; } @@ -3484,14 +3503,16 @@ ProcInitialConnection(ClientPtr client) REQUEST(xReq); xConnClientPrefix *prefix; int whichbyte = 1; + char order; - prefix = (xConnClientPrefix *) ((char *) stuff + sz_xReq); - if ((prefix->byteOrder != 'l') && (prefix->byteOrder != 'B')) - return client->noClientException = -1; - if (((*(char *) &whichbyte) && (prefix->byteOrder == 'B')) || - (!(*(char *) &whichbyte) && (prefix->byteOrder == 'l'))) { - client->swapped = TRUE; - SwapConnClientPrefix(prefix); + prefix = (xConnClientPrefix *) ((char *)stuff + sz_xReq); + order = prefix->byteOrder; + if (order != 'l' && order != 'B' && order != 'r' && order != 'R') + return client->noClientException = -1; + if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) || + (!(*(char *) &whichbyte) && (order == 'l' || order == 'r'))) { + client->swapped = TRUE; + SwapConnClientPrefix(prefix); } stuff->reqType = 2; stuff->length += bytes_to_int32(prefix->nbytesAuthProto) + @@ -3499,6 +3520,9 @@ ProcInitialConnection(ClientPtr client) if (client->swapped) { swaps(&stuff->length); } + if (order == 'r' || order == 'R') { + client->local = FALSE; + } ResetCurrentRequest(client); return Success; } @@ -3523,8 +3547,8 @@ SendConnSetup(ClientPtr client, const char *reason) if (client->swapped) WriteSConnSetupPrefix(client, &csp); else - (void) WriteToClient(client, sz_xConnSetupPrefix, (char *) &csp); - (void) WriteToClient(client, (int) csp.lengthReason, reason); + WriteToClient(client, sz_xConnSetupPrefix, &csp); + WriteToClient(client, (int) csp.lengthReason, reason); return client->noClientException = -1; } @@ -3577,10 +3601,9 @@ SendConnSetup(ClientPtr client, const char *reason) lConnectionInfo); } else { - (void) WriteToClient(client, sizeof(xConnSetupPrefix), - (char *) lconnSetupPrefix); - (void) WriteToClient(client, (int) (lconnSetupPrefix->length << 2), - lConnectionInfo); + WriteToClient(client, sizeof(xConnSetupPrefix), lconnSetupPrefix); + WriteToClient(client, (int) (lconnSetupPrefix->length << 2), + lConnectionInfo); } client->clientState = ClientStateRunning; if (ClientStateCallback) { @@ -3623,14 +3646,13 @@ void SendErrorToClient(ClientPtr client, unsigned majorCode, unsigned minorCode, XID resId, int errorCode) { - xError rep; - - memset(&rep, 0, sizeof(xError)); - rep.type = X_Error; - rep.errorCode = errorCode; - rep.majorCode = majorCode; - rep.minorCode = minorCode; - rep.resourceID = resId; + xError rep = { + .type = X_Error, + .errorCode = errorCode, + .resourceID = resId, + .minorCode = minorCode, + .majorCode = majorCode + }; WriteEventsToClient(client, 1, (xEvent *) &rep); } @@ -3724,35 +3746,29 @@ with its screen number, a pointer to its ScreenRec, argc, and argv. */ -int -AddScreen(Bool (*pfnInit) (int /*index */ , - ScreenPtr /*pScreen */ , - int /*argc */ , - char ** /*argv */ - ), int argc, char **argv) +static int init_screen(ScreenPtr pScreen, int i, Bool gpu) { - - int i; int scanlinepad, format, depth, bitsPerPixel, j, k; - ScreenPtr pScreen; - i = screenInfo.numScreens; - if (i == MAXSCREENS) - return -1; - - pScreen = (ScreenPtr) calloc(1, sizeof(ScreenRec)); - if (!pScreen) - return -1; + dixInitScreenSpecificPrivates(pScreen); if (!dixAllocatePrivates(&pScreen->devPrivates, PRIVATE_SCREEN)) { - free(pScreen); return -1; } pScreen->myNum = i; + if (gpu) { + pScreen->myNum += GPU_SCREEN_OFFSET; + pScreen->isGPU = TRUE; + } pScreen->totalPixmapSize = 0; /* computed in CreateScratchPixmapForScreen */ pScreen->ClipNotify = 0; /* for R4 ddx compatibility */ pScreen->CreateScreenResources = 0; + xorg_list_init(&pScreen->pixmap_dirty_list); + xorg_list_init(&pScreen->unattached_list); + xorg_list_init(&pScreen->output_slave_list); + xorg_list_init(&pScreen->offload_slave_list); + /* * This loop gets run once for every Screen that gets added, * but thats ok. If the ddx layer initializes the formats @@ -3783,7 +3799,33 @@ AddScreen(Bool (*pfnInit) (int /*index */ , PixmapWidthPaddingInfo[depth].notPower2 = 0; } } + return 0; +} + +int +AddScreen(Bool (*pfnInit) (ScreenPtr /*pScreen */ , + int /*argc */ , + char ** /*argv */ + ), int argc, char **argv) +{ + + int i; + ScreenPtr pScreen; + Bool ret; + + i = screenInfo.numScreens; + if (i == MAXSCREENS) + return -1; + + pScreen = (ScreenPtr) calloc(1, sizeof(ScreenRec)); + if (!pScreen) + return -1; + ret = init_screen(pScreen, i, FALSE); + if (ret != 0) { + free(pScreen); + return ret; + } /* This is where screen specific stuff gets initialized. Load the screen structure, call the hardware, whatever. This is also where the default colormap should be allocated and @@ -3794,7 +3836,8 @@ AddScreen(Bool (*pfnInit) (int /*index */ , */ screenInfo.screens[i] = pScreen; screenInfo.numScreens++; - if (!(*pfnInit) (i, pScreen, argc, argv)) { + if (!(*pfnInit) (pScreen, argc, argv)) { + dixFreeScreenSpecificPrivates(pScreen); dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN); free(pScreen); screenInfo.numScreens--; @@ -3808,3 +3851,124 @@ AddScreen(Bool (*pfnInit) (int /*index */ , return i; } + +int +AddGPUScreen(Bool (*pfnInit) (ScreenPtr /*pScreen */ , + int /*argc */ , + char ** /*argv */ + ), + int argc, char **argv) +{ + int i; + ScreenPtr pScreen; + Bool ret; + + i = screenInfo.numGPUScreens; + if (i == MAXGPUSCREENS) + return -1; + + pScreen = (ScreenPtr) calloc(1, sizeof(ScreenRec)); + if (!pScreen) + return -1; + + ret = init_screen(pScreen, i, TRUE); + if (ret != 0) { + free(pScreen); + return ret; + } + + /* This is where screen specific stuff gets initialized. Load the + screen structure, call the hardware, whatever. + This is also where the default colormap should be allocated and + also pixel values for blackPixel, whitePixel, and the cursor + Note that InitScreen is NOT allowed to modify argc, argv, or + any of the strings pointed to by argv. They may be passed to + multiple screens. + */ + screenInfo.gpuscreens[i] = pScreen; + screenInfo.numGPUScreens++; + if (!(*pfnInit) (pScreen, argc, argv)) { + dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN); + free(pScreen); + screenInfo.numGPUScreens--; + return -1; + } + + update_desktop_dimensions(); + + return i; +} + +void +RemoveGPUScreen(ScreenPtr pScreen) +{ + int idx, j; + if (!pScreen->isGPU) + return; + + idx = pScreen->myNum - GPU_SCREEN_OFFSET; + for (j = idx; j < screenInfo.numGPUScreens - 1; j++) { + screenInfo.gpuscreens[j] = screenInfo.gpuscreens[j + 1]; + screenInfo.gpuscreens[j]->myNum = j + GPU_SCREEN_OFFSET; + } + screenInfo.numGPUScreens--; + + /* this gets freed later in the resource list, but without + * the screen existing it causes crashes - so remove it here */ + if (pScreen->defColormap) + FreeResource(pScreen->defColormap, RT_COLORMAP); + free(pScreen); + +} + +void +AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr new) +{ + assert(new->isGPU); + assert(!new->current_master); + xorg_list_add(&new->unattached_head, &pScreen->unattached_list); + new->current_master = pScreen; +} + +void +DetachUnboundGPU(ScreenPtr slave) +{ + assert(slave->isGPU); + xorg_list_del(&slave->unattached_head); + slave->current_master = NULL; +} + +void +AttachOutputGPU(ScreenPtr pScreen, ScreenPtr new) +{ + assert(new->isGPU); + assert(!new->current_master); + xorg_list_add(&new->output_head, &pScreen->output_slave_list); + new->current_master = pScreen; +} + +void +DetachOutputGPU(ScreenPtr slave) +{ + assert(slave->isGPU); + xorg_list_del(&slave->output_head); + slave->current_master = NULL; +} + +void +AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr new) +{ + assert(new->isGPU); + assert(!new->current_master); + xorg_list_add(&new->offload_head, &pScreen->offload_slave_list); + new->current_master = pScreen; +} + +void +DetachOffloadGPU(ScreenPtr slave) +{ + assert(slave->isGPU); + xorg_list_del(&slave->offload_head); + slave->current_master = NULL; +} + |