Compare commits
71 Commits
scaling-mr
...
server-1.1
Author | SHA1 | Date |
---|---|---|
Julien Cristau | ff76b219f6 | |
Olivier Fourdan | 8f61533b16 | |
Olivier Fourdan | 747cea16c4 | |
Chris Wilson | 0722a8043c | |
Adam Jackson | f7e3478fe7 | |
Dave Airlie | 645ae07fac | |
Dave Airlie | cdcf9e9510 | |
Nikhil Mahale | 5c4da56345 | |
Keith Packard | f39ac527ba | |
Julien Cristau | 16f157cbf6 | |
Julien Cristau | 9b037af041 | |
Keith Packard | f7ff55a374 | |
Keith Packard | 8e7c4380a5 | |
Keith Packard | 1069ca9929 | |
Keith Packard | 044764b5c6 | |
Robert Morell | 73b1880eb3 | |
Adam Jackson | 912df16404 | |
Adam Jackson | 92de7a90a1 | |
Adam Jackson | 44ed4a6547 | |
Adam Jackson | fe9672204a | |
Adam Jackson | 525db4433b | |
Adam Jackson | cbf197e1c9 | |
Adam Jackson | 7590915c9d | |
Julien Cristau | 20bc891f76 | |
Adam Jackson | 233429c1d8 | |
Adam Jackson | e7dc700de9 | |
Adam Jackson | 25e0fe2b59 | |
Adam Jackson | de17ad13eb | |
Adam Jackson | 1d496e046e | |
Alan Coopersmith | 5a4760babd | |
Alan Coopersmith | efacb60e01 | |
Alan Coopersmith | 3b4aa58d56 | |
Alan Coopersmith | 4f30f4dd47 | |
Alan Coopersmith | 18c7f1e49b | |
Julien Cristau | 0ad9121071 | |
Alan Coopersmith | df64ac7206 | |
Alan Coopersmith | ea45001614 | |
Alan Coopersmith | e3a1255a72 | |
Alan Coopersmith | c092c31c83 | |
Alan Coopersmith | 3d8e2731b5 | |
Alan Coopersmith | 4d3d93c68b | |
Alan Coopersmith | d88c66541e | |
Alan Coopersmith | db386cd6a1 | |
Alan Coopersmith | 2883994f9f | |
Alan Coopersmith | c2515e9dfd | |
Alan Coopersmith | cbfdb284c9 | |
Alan Coopersmith | b022d4ef9d | |
Alan Coopersmith | f1365eb0ec | |
Keith Packard | 07b01bb5bd | |
Mario Kleiner | d1bd02fb67 | |
Mario Kleiner | 77ef968c86 | |
Keith Packard | f1fc86d61e | |
Alan Coopersmith | 386329ec72 | |
Alex Orange | a471a15c77 | |
Julien Cristau | 4393c7f1ba | |
Julien Cristau | 151ec89574 | |
Chris Wilson | a4d9637504 | |
Axel Davy | a7c207cc8e | |
Axel Davy | 27600a6b20 | |
Peter Hutterer | 0e62f275aa | |
Takashi Iwai | f7ca20cacf | |
Julien Cristau | 0e0951ce3e | |
Julien Cristau | b501462e5d | |
Julien Cristau | 3ce47886c5 | |
Keith Packard | c48d07cf0e | |
Thierry Reding | fbe977941a | |
Thierry Reding | 484b881ecd | |
Jeremy Huddleston Sequoia | af2e9e3bb1 | |
Jeremy Huddleston Sequoia | b7a24467f7 | |
Jeremy Huddleston Sequoia | a793483e38 | |
Keith Packard | 3c0431b891 |
15
Xext/shm.c
15
Xext/shm.c
|
@ -248,21 +248,20 @@ ShmDestroyPixmap(PixmapPtr pPixmap)
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = pPixmap->drawable.pScreen;
|
ScreenPtr pScreen = pPixmap->drawable.pScreen;
|
||||||
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
|
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
|
||||||
|
void *shmdesc = NULL;
|
||||||
Bool ret;
|
Bool ret;
|
||||||
|
|
||||||
if (pPixmap->refcnt == 1) {
|
if (pPixmap->refcnt == 1)
|
||||||
ShmDescPtr shmdesc;
|
shmdesc = dixLookupPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey);
|
||||||
|
|
||||||
shmdesc = (ShmDescPtr) dixLookupPrivate(&pPixmap->devPrivates,
|
|
||||||
shmPixmapPrivateKey);
|
|
||||||
if (shmdesc)
|
|
||||||
ShmDetachSegment((void *) shmdesc, pPixmap->drawable.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
pScreen->DestroyPixmap = screen_priv->destroyPixmap;
|
pScreen->DestroyPixmap = screen_priv->destroyPixmap;
|
||||||
ret = (*pScreen->DestroyPixmap) (pPixmap);
|
ret = (*pScreen->DestroyPixmap) (pPixmap);
|
||||||
screen_priv->destroyPixmap = pScreen->DestroyPixmap;
|
screen_priv->destroyPixmap = pScreen->DestroyPixmap;
|
||||||
pScreen->DestroyPixmap = ShmDestroyPixmap;
|
pScreen->DestroyPixmap = ShmDestroyPixmap;
|
||||||
|
|
||||||
|
if (shmdesc)
|
||||||
|
ShmDetachSegment(shmdesc, pPixmap->drawable.id);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -167,6 +167,7 @@ static int
|
||||||
SProcXCMiscGetXIDList(ClientPtr client)
|
SProcXCMiscGetXIDList(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXCMiscGetXIDListReq);
|
REQUEST(xXCMiscGetXIDListReq);
|
||||||
|
REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->count);
|
swapl(&stuff->count);
|
||||||
|
|
|
@ -1207,6 +1207,7 @@ static int
|
||||||
SProcXvQueryExtension(ClientPtr client)
|
SProcXvQueryExtension(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvQueryExtensionReq);
|
REQUEST(xvQueryExtensionReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvQueryExtensionReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
return XvProcVector[xv_QueryExtension] (client);
|
return XvProcVector[xv_QueryExtension] (client);
|
||||||
}
|
}
|
||||||
|
@ -1215,6 +1216,7 @@ static int
|
||||||
SProcXvQueryAdaptors(ClientPtr client)
|
SProcXvQueryAdaptors(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvQueryAdaptorsReq);
|
REQUEST(xvQueryAdaptorsReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvQueryAdaptorsReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
return XvProcVector[xv_QueryAdaptors] (client);
|
return XvProcVector[xv_QueryAdaptors] (client);
|
||||||
|
@ -1224,6 +1226,7 @@ static int
|
||||||
SProcXvQueryEncodings(ClientPtr client)
|
SProcXvQueryEncodings(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvQueryEncodingsReq);
|
REQUEST(xvQueryEncodingsReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvQueryEncodingsReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
return XvProcVector[xv_QueryEncodings] (client);
|
return XvProcVector[xv_QueryEncodings] (client);
|
||||||
|
@ -1233,6 +1236,7 @@ static int
|
||||||
SProcXvGrabPort(ClientPtr client)
|
SProcXvGrabPort(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvGrabPortReq);
|
REQUEST(xvGrabPortReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvGrabPortReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->time);
|
swapl(&stuff->time);
|
||||||
|
@ -1243,6 +1247,7 @@ static int
|
||||||
SProcXvUngrabPort(ClientPtr client)
|
SProcXvUngrabPort(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvUngrabPortReq);
|
REQUEST(xvUngrabPortReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvUngrabPortReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->time);
|
swapl(&stuff->time);
|
||||||
|
@ -1253,6 +1258,7 @@ static int
|
||||||
SProcXvPutVideo(ClientPtr client)
|
SProcXvPutVideo(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvPutVideoReq);
|
REQUEST(xvPutVideoReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvPutVideoReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
|
@ -1272,6 +1278,7 @@ static int
|
||||||
SProcXvPutStill(ClientPtr client)
|
SProcXvPutStill(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvPutStillReq);
|
REQUEST(xvPutStillReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvPutStillReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
|
@ -1291,6 +1298,7 @@ static int
|
||||||
SProcXvGetVideo(ClientPtr client)
|
SProcXvGetVideo(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvGetVideoReq);
|
REQUEST(xvGetVideoReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvGetVideoReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
|
@ -1310,6 +1318,7 @@ static int
|
||||||
SProcXvGetStill(ClientPtr client)
|
SProcXvGetStill(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvGetStillReq);
|
REQUEST(xvGetStillReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvGetStillReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
|
@ -1329,6 +1338,7 @@ static int
|
||||||
SProcXvPutImage(ClientPtr client)
|
SProcXvPutImage(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvPutImageReq);
|
REQUEST(xvPutImageReq);
|
||||||
|
REQUEST_AT_LEAST_SIZE(xvPutImageReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
|
@ -1352,6 +1362,7 @@ static int
|
||||||
SProcXvShmPutImage(ClientPtr client)
|
SProcXvShmPutImage(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvShmPutImageReq);
|
REQUEST(xvShmPutImageReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvShmPutImageReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
|
@ -1379,6 +1390,7 @@ static int
|
||||||
SProcXvSelectVideoNotify(ClientPtr client)
|
SProcXvSelectVideoNotify(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvSelectVideoNotifyReq);
|
REQUEST(xvSelectVideoNotifyReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
return XvProcVector[xv_SelectVideoNotify] (client);
|
return XvProcVector[xv_SelectVideoNotify] (client);
|
||||||
|
@ -1388,6 +1400,7 @@ static int
|
||||||
SProcXvSelectPortNotify(ClientPtr client)
|
SProcXvSelectPortNotify(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvSelectPortNotifyReq);
|
REQUEST(xvSelectPortNotifyReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvSelectPortNotifyReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
return XvProcVector[xv_SelectPortNotify] (client);
|
return XvProcVector[xv_SelectPortNotify] (client);
|
||||||
|
@ -1397,6 +1410,7 @@ static int
|
||||||
SProcXvStopVideo(ClientPtr client)
|
SProcXvStopVideo(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvStopVideoReq);
|
REQUEST(xvStopVideoReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvStopVideoReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
|
@ -1407,6 +1421,7 @@ static int
|
||||||
SProcXvSetPortAttribute(ClientPtr client)
|
SProcXvSetPortAttribute(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvSetPortAttributeReq);
|
REQUEST(xvSetPortAttributeReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvSetPortAttributeReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->attribute);
|
swapl(&stuff->attribute);
|
||||||
|
@ -1418,6 +1433,7 @@ static int
|
||||||
SProcXvGetPortAttribute(ClientPtr client)
|
SProcXvGetPortAttribute(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvGetPortAttributeReq);
|
REQUEST(xvGetPortAttributeReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvGetPortAttributeReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->attribute);
|
swapl(&stuff->attribute);
|
||||||
|
@ -1428,6 +1444,7 @@ static int
|
||||||
SProcXvQueryBestSize(ClientPtr client)
|
SProcXvQueryBestSize(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvQueryBestSizeReq);
|
REQUEST(xvQueryBestSizeReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvQueryBestSizeReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swaps(&stuff->vid_w);
|
swaps(&stuff->vid_w);
|
||||||
|
@ -1441,6 +1458,7 @@ static int
|
||||||
SProcXvQueryPortAttributes(ClientPtr client)
|
SProcXvQueryPortAttributes(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvQueryPortAttributesReq);
|
REQUEST(xvQueryPortAttributesReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvQueryPortAttributesReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
return XvProcVector[xv_QueryPortAttributes] (client);
|
return XvProcVector[xv_QueryPortAttributes] (client);
|
||||||
|
@ -1450,6 +1468,7 @@ static int
|
||||||
SProcXvQueryImageAttributes(ClientPtr client)
|
SProcXvQueryImageAttributes(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvQueryImageAttributesReq);
|
REQUEST(xvQueryImageAttributesReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvQueryImageAttributesReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
swapl(&stuff->id);
|
swapl(&stuff->id);
|
||||||
|
@ -1462,6 +1481,7 @@ static int
|
||||||
SProcXvListImageFormats(ClientPtr client)
|
SProcXvListImageFormats(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xvListImageFormatsReq);
|
REQUEST(xvListImageFormatsReq);
|
||||||
|
REQUEST_SIZE_MATCH(xvListImageFormatsReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->port);
|
swapl(&stuff->port);
|
||||||
return XvProcVector[xv_ListImageFormats] (client);
|
return XvProcVector[xv_ListImageFormats] (client);
|
||||||
|
|
|
@ -78,7 +78,7 @@ SProcXChangeDeviceControl(ClientPtr client)
|
||||||
|
|
||||||
REQUEST(xChangeDeviceControlReq);
|
REQUEST(xChangeDeviceControlReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
|
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
|
||||||
swaps(&stuff->control);
|
swaps(&stuff->control);
|
||||||
ctl = (xDeviceCtl *) &stuff[1];
|
ctl = (xDeviceCtl *) &stuff[1];
|
||||||
swaps(&ctl->control);
|
swaps(&ctl->control);
|
||||||
|
@ -115,7 +115,7 @@ ProcXChangeDeviceControl(ClientPtr client)
|
||||||
xDeviceEnableCtl *e;
|
xDeviceEnableCtl *e;
|
||||||
|
|
||||||
REQUEST(xChangeDeviceControlReq);
|
REQUEST(xChangeDeviceControlReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
|
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
|
||||||
|
|
||||||
len = stuff->length - bytes_to_int32(sizeof(xChangeDeviceControlReq));
|
len = stuff->length - bytes_to_int32(sizeof(xChangeDeviceControlReq));
|
||||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||||
|
@ -192,6 +192,10 @@ ProcXChangeDeviceControl(ClientPtr client)
|
||||||
break;
|
break;
|
||||||
case DEVICE_ENABLE:
|
case DEVICE_ENABLE:
|
||||||
e = (xDeviceEnableCtl *) &stuff[1];
|
e = (xDeviceEnableCtl *) &stuff[1];
|
||||||
|
if ((len != bytes_to_int32(sizeof(xDeviceEnableCtl)))) {
|
||||||
|
ret = BadLength;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (IsXTestDevice(dev, NULL))
|
if (IsXTestDevice(dev, NULL))
|
||||||
status = !Success;
|
status = !Success;
|
||||||
|
|
|
@ -467,6 +467,8 @@ ProcXChangeFeedbackControl(ClientPtr client)
|
||||||
xStringFeedbackCtl *f = ((xStringFeedbackCtl *) &stuff[1]);
|
xStringFeedbackCtl *f = ((xStringFeedbackCtl *) &stuff[1]);
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
|
if (len < bytes_to_int32(sizeof(xStringFeedbackCtl)))
|
||||||
|
return BadLength;
|
||||||
swaps(&f->num_keysyms);
|
swaps(&f->num_keysyms);
|
||||||
}
|
}
|
||||||
if (len !=
|
if (len !=
|
||||||
|
|
|
@ -135,6 +135,9 @@ ProcXSendExtensionEvent(ClientPtr client)
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
if (stuff->num_events == 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
/* The client's event type must be one defined by an extension. */
|
/* The client's event type must be one defined by an extension. */
|
||||||
|
|
||||||
first = ((xEvent *) &stuff[1]);
|
first = ((xEvent *) &stuff[1]);
|
||||||
|
|
|
@ -48,6 +48,7 @@ int
|
||||||
SProcXIAllowEvents(ClientPtr client)
|
SProcXIAllowEvents(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXIAllowEventsReq);
|
REQUEST(xXIAllowEventsReq);
|
||||||
|
REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swaps(&stuff->deviceid);
|
swaps(&stuff->deviceid);
|
||||||
|
@ -55,6 +56,7 @@ SProcXIAllowEvents(ClientPtr client)
|
||||||
if (stuff->length > 3) {
|
if (stuff->length > 3) {
|
||||||
xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq *) stuff;
|
xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq *) stuff;
|
||||||
|
|
||||||
|
REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq);
|
||||||
swapl(&req_xi22->touchid);
|
swapl(&req_xi22->touchid);
|
||||||
swapl(&req_xi22->grab_window);
|
swapl(&req_xi22->grab_window);
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,11 +57,11 @@ int
|
||||||
SProcXIChangeCursor(ClientPtr client)
|
SProcXIChangeCursor(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXIChangeCursorReq);
|
REQUEST(xXIChangeCursorReq);
|
||||||
|
REQUEST_SIZE_MATCH(xXIChangeCursorReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->win);
|
swapl(&stuff->win);
|
||||||
swapl(&stuff->cursor);
|
swapl(&stuff->cursor);
|
||||||
swaps(&stuff->deviceid);
|
swaps(&stuff->deviceid);
|
||||||
REQUEST_SIZE_MATCH(xXIChangeCursorReq);
|
|
||||||
return (ProcXIChangeCursor(client));
|
return (ProcXIChangeCursor(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -411,7 +411,7 @@ int
|
||||||
ProcXIChangeHierarchy(ClientPtr client)
|
ProcXIChangeHierarchy(ClientPtr client)
|
||||||
{
|
{
|
||||||
xXIAnyHierarchyChangeInfo *any;
|
xXIAnyHierarchyChangeInfo *any;
|
||||||
int required_len = sizeof(xXIChangeHierarchyReq);
|
size_t len; /* length of data remaining in request */
|
||||||
int rc = Success;
|
int rc = Success;
|
||||||
int flags[MAXDEVICES] = { 0 };
|
int flags[MAXDEVICES] = { 0 };
|
||||||
|
|
||||||
|
@ -421,21 +421,46 @@ ProcXIChangeHierarchy(ClientPtr client)
|
||||||
if (!stuff->num_changes)
|
if (!stuff->num_changes)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
if (stuff->length > (INT_MAX >> 2))
|
||||||
|
return BadAlloc;
|
||||||
|
len = (stuff->length << 2) - sizeof(xXIAnyHierarchyChangeInfo);
|
||||||
|
|
||||||
any = (xXIAnyHierarchyChangeInfo *) &stuff[1];
|
any = (xXIAnyHierarchyChangeInfo *) &stuff[1];
|
||||||
while (stuff->num_changes--) {
|
while (stuff->num_changes--) {
|
||||||
|
if (len < sizeof(xXIAnyHierarchyChangeInfo)) {
|
||||||
|
rc = BadLength;
|
||||||
|
goto unwind;
|
||||||
|
}
|
||||||
|
|
||||||
SWAPIF(swaps(&any->type));
|
SWAPIF(swaps(&any->type));
|
||||||
SWAPIF(swaps(&any->length));
|
SWAPIF(swaps(&any->length));
|
||||||
|
|
||||||
required_len += any->length;
|
if ((any->length > (INT_MAX >> 2)) || (len < (any->length << 2)))
|
||||||
if ((stuff->length * 4) < required_len)
|
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
#define CHANGE_SIZE_MATCH(type) \
|
||||||
|
do { \
|
||||||
|
if ((len < sizeof(type)) || (any->length != (sizeof(type) >> 2))) { \
|
||||||
|
rc = BadLength; \
|
||||||
|
goto unwind; \
|
||||||
|
} \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
switch (any->type) {
|
switch (any->type) {
|
||||||
case XIAddMaster:
|
case XIAddMaster:
|
||||||
{
|
{
|
||||||
xXIAddMasterInfo *c = (xXIAddMasterInfo *) any;
|
xXIAddMasterInfo *c = (xXIAddMasterInfo *) any;
|
||||||
|
|
||||||
|
/* Variable length, due to appended name string */
|
||||||
|
if (len < sizeof(xXIAddMasterInfo)) {
|
||||||
|
rc = BadLength;
|
||||||
|
goto unwind;
|
||||||
|
}
|
||||||
SWAPIF(swaps(&c->name_len));
|
SWAPIF(swaps(&c->name_len));
|
||||||
|
if (c->name_len > (len - sizeof(xXIAddMasterInfo))) {
|
||||||
|
rc = BadLength;
|
||||||
|
goto unwind;
|
||||||
|
}
|
||||||
|
|
||||||
rc = add_master(client, c, flags);
|
rc = add_master(client, c, flags);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
@ -446,6 +471,7 @@ ProcXIChangeHierarchy(ClientPtr client)
|
||||||
{
|
{
|
||||||
xXIRemoveMasterInfo *r = (xXIRemoveMasterInfo *) any;
|
xXIRemoveMasterInfo *r = (xXIRemoveMasterInfo *) any;
|
||||||
|
|
||||||
|
CHANGE_SIZE_MATCH(xXIRemoveMasterInfo);
|
||||||
rc = remove_master(client, r, flags);
|
rc = remove_master(client, r, flags);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
goto unwind;
|
goto unwind;
|
||||||
|
@ -455,6 +481,7 @@ ProcXIChangeHierarchy(ClientPtr client)
|
||||||
{
|
{
|
||||||
xXIDetachSlaveInfo *c = (xXIDetachSlaveInfo *) any;
|
xXIDetachSlaveInfo *c = (xXIDetachSlaveInfo *) any;
|
||||||
|
|
||||||
|
CHANGE_SIZE_MATCH(xXIDetachSlaveInfo);
|
||||||
rc = detach_slave(client, c, flags);
|
rc = detach_slave(client, c, flags);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
goto unwind;
|
goto unwind;
|
||||||
|
@ -464,6 +491,7 @@ ProcXIChangeHierarchy(ClientPtr client)
|
||||||
{
|
{
|
||||||
xXIAttachSlaveInfo *c = (xXIAttachSlaveInfo *) any;
|
xXIAttachSlaveInfo *c = (xXIAttachSlaveInfo *) any;
|
||||||
|
|
||||||
|
CHANGE_SIZE_MATCH(xXIAttachSlaveInfo);
|
||||||
rc = attach_slave(client, c, flags);
|
rc = attach_slave(client, c, flags);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
goto unwind;
|
goto unwind;
|
||||||
|
@ -471,6 +499,7 @@ ProcXIChangeHierarchy(ClientPtr client)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
len -= any->length * 4;
|
||||||
any = (xXIAnyHierarchyChangeInfo *) ((char *) any + any->length * 4);
|
any = (xXIAnyHierarchyChangeInfo *) ((char *) any + any->length * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,7 @@ int
|
||||||
SProcXIGetClientPointer(ClientPtr client)
|
SProcXIGetClientPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXIGetClientPointerReq);
|
REQUEST(xXIGetClientPointerReq);
|
||||||
|
REQUEST_SIZE_MATCH(xXIGetClientPointerReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->win);
|
swapl(&stuff->win);
|
||||||
|
|
|
@ -47,6 +47,11 @@ int
|
||||||
SProcXIGrabDevice(ClientPtr client)
|
SProcXIGrabDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXIGrabDeviceReq);
|
REQUEST(xXIGrabDeviceReq);
|
||||||
|
/*
|
||||||
|
* Check here for at least the length of the struct we swap, then
|
||||||
|
* let ProcXIGrabDevice check the full size after we swap mask_len.
|
||||||
|
*/
|
||||||
|
REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swaps(&stuff->deviceid);
|
swaps(&stuff->deviceid);
|
||||||
|
@ -71,7 +76,7 @@ ProcXIGrabDevice(ClientPtr client)
|
||||||
unsigned int pointer_mode;
|
unsigned int pointer_mode;
|
||||||
|
|
||||||
REQUEST(xXIGrabDeviceReq);
|
REQUEST(xXIGrabDeviceReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq);
|
REQUEST_FIXED_SIZE(xXIGrabDeviceReq, ((size_t) stuff->mask_len) * 4);
|
||||||
|
|
||||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
|
@ -131,6 +136,7 @@ int
|
||||||
SProcXIUngrabDevice(ClientPtr client)
|
SProcXIUngrabDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXIUngrabDeviceReq);
|
REQUEST(xXIUngrabDeviceReq);
|
||||||
|
REQUEST_SIZE_MATCH(xXIUngrabDeviceReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swaps(&stuff->deviceid);
|
swaps(&stuff->deviceid);
|
||||||
|
@ -148,6 +154,7 @@ ProcXIUngrabDevice(ClientPtr client)
|
||||||
TimeStamp time;
|
TimeStamp time;
|
||||||
|
|
||||||
REQUEST(xXIUngrabDeviceReq);
|
REQUEST(xXIUngrabDeviceReq);
|
||||||
|
REQUEST_SIZE_MATCH(xXIUngrabDeviceReq);
|
||||||
|
|
||||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
|
|
|
@ -53,6 +53,7 @@ SProcXIPassiveGrabDevice(ClientPtr client)
|
||||||
uint32_t *mods;
|
uint32_t *mods;
|
||||||
|
|
||||||
REQUEST(xXIPassiveGrabDeviceReq);
|
REQUEST(xXIPassiveGrabDeviceReq);
|
||||||
|
REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swaps(&stuff->deviceid);
|
swaps(&stuff->deviceid);
|
||||||
|
@ -63,6 +64,8 @@ SProcXIPassiveGrabDevice(ClientPtr client)
|
||||||
swaps(&stuff->mask_len);
|
swaps(&stuff->mask_len);
|
||||||
swaps(&stuff->num_modifiers);
|
swaps(&stuff->num_modifiers);
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq,
|
||||||
|
((uint32_t) stuff->mask_len + stuff->num_modifiers) *4);
|
||||||
mods = (uint32_t *) &stuff[1] + stuff->mask_len;
|
mods = (uint32_t *) &stuff[1] + stuff->mask_len;
|
||||||
|
|
||||||
for (i = 0; i < stuff->num_modifiers; i++, mods++) {
|
for (i = 0; i < stuff->num_modifiers; i++, mods++) {
|
||||||
|
@ -92,7 +95,8 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
||||||
int mask_len;
|
int mask_len;
|
||||||
|
|
||||||
REQUEST(xXIPassiveGrabDeviceReq);
|
REQUEST(xXIPassiveGrabDeviceReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq);
|
REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq,
|
||||||
|
((uint32_t) stuff->mask_len + stuff->num_modifiers) * 4);
|
||||||
|
|
||||||
if (stuff->deviceid == XIAllDevices)
|
if (stuff->deviceid == XIAllDevices)
|
||||||
dev = inputInfo.all_devices;
|
dev = inputInfo.all_devices;
|
||||||
|
@ -252,6 +256,7 @@ SProcXIPassiveUngrabDevice(ClientPtr client)
|
||||||
uint32_t *modifiers;
|
uint32_t *modifiers;
|
||||||
|
|
||||||
REQUEST(xXIPassiveUngrabDeviceReq);
|
REQUEST(xXIPassiveUngrabDeviceReq);
|
||||||
|
REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->grab_window);
|
swapl(&stuff->grab_window);
|
||||||
|
@ -259,6 +264,8 @@ SProcXIPassiveUngrabDevice(ClientPtr client)
|
||||||
swapl(&stuff->detail);
|
swapl(&stuff->detail);
|
||||||
swaps(&stuff->num_modifiers);
|
swaps(&stuff->num_modifiers);
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xXIPassiveUngrabDeviceReq,
|
||||||
|
((uint32_t) stuff->num_modifiers) << 2);
|
||||||
modifiers = (uint32_t *) &stuff[1];
|
modifiers = (uint32_t *) &stuff[1];
|
||||||
|
|
||||||
for (i = 0; i < stuff->num_modifiers; i++, modifiers++)
|
for (i = 0; i < stuff->num_modifiers; i++, modifiers++)
|
||||||
|
@ -277,7 +284,8 @@ ProcXIPassiveUngrabDevice(ClientPtr client)
|
||||||
int i, rc;
|
int i, rc;
|
||||||
|
|
||||||
REQUEST(xXIPassiveUngrabDeviceReq);
|
REQUEST(xXIPassiveUngrabDeviceReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq);
|
REQUEST_FIXED_SIZE(xXIPassiveUngrabDeviceReq,
|
||||||
|
((uint32_t) stuff->num_modifiers) << 2);
|
||||||
|
|
||||||
if (stuff->deviceid == XIAllDevices)
|
if (stuff->deviceid == XIAllDevices)
|
||||||
dev = inputInfo.all_devices;
|
dev = inputInfo.all_devices;
|
||||||
|
|
|
@ -1013,10 +1013,9 @@ int
|
||||||
SProcXListDeviceProperties(ClientPtr client)
|
SProcXListDeviceProperties(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xListDevicePropertiesReq);
|
REQUEST(xListDevicePropertiesReq);
|
||||||
|
REQUEST_SIZE_MATCH(xListDevicePropertiesReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xListDevicePropertiesReq);
|
|
||||||
return (ProcXListDeviceProperties(client));
|
return (ProcXListDeviceProperties(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1037,10 +1036,10 @@ int
|
||||||
SProcXDeleteDeviceProperty(ClientPtr client)
|
SProcXDeleteDeviceProperty(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDeleteDevicePropertyReq);
|
REQUEST(xDeleteDevicePropertyReq);
|
||||||
|
REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->property);
|
swapl(&stuff->property);
|
||||||
REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
|
|
||||||
return (ProcXDeleteDeviceProperty(client));
|
return (ProcXDeleteDeviceProperty(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1048,13 +1047,13 @@ int
|
||||||
SProcXGetDeviceProperty(ClientPtr client)
|
SProcXGetDeviceProperty(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xGetDevicePropertyReq);
|
REQUEST(xGetDevicePropertyReq);
|
||||||
|
REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->property);
|
swapl(&stuff->property);
|
||||||
swapl(&stuff->type);
|
swapl(&stuff->type);
|
||||||
swapl(&stuff->longOffset);
|
swapl(&stuff->longOffset);
|
||||||
swapl(&stuff->longLength);
|
swapl(&stuff->longLength);
|
||||||
REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
|
|
||||||
return (ProcXGetDeviceProperty(client));
|
return (ProcXGetDeviceProperty(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1253,11 +1252,10 @@ int
|
||||||
SProcXIListProperties(ClientPtr client)
|
SProcXIListProperties(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXIListPropertiesReq);
|
REQUEST(xXIListPropertiesReq);
|
||||||
|
REQUEST_SIZE_MATCH(xXIListPropertiesReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swaps(&stuff->deviceid);
|
swaps(&stuff->deviceid);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXIListPropertiesReq);
|
|
||||||
return (ProcXIListProperties(client));
|
return (ProcXIListProperties(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1279,11 +1277,11 @@ int
|
||||||
SProcXIDeleteProperty(ClientPtr client)
|
SProcXIDeleteProperty(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXIDeletePropertyReq);
|
REQUEST(xXIDeletePropertyReq);
|
||||||
|
REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swaps(&stuff->deviceid);
|
swaps(&stuff->deviceid);
|
||||||
swapl(&stuff->property);
|
swapl(&stuff->property);
|
||||||
REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
|
|
||||||
return (ProcXIDeleteProperty(client));
|
return (ProcXIDeleteProperty(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1291,6 +1289,7 @@ int
|
||||||
SProcXIGetProperty(ClientPtr client)
|
SProcXIGetProperty(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXIGetPropertyReq);
|
REQUEST(xXIGetPropertyReq);
|
||||||
|
REQUEST_SIZE_MATCH(xXIGetPropertyReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swaps(&stuff->deviceid);
|
swaps(&stuff->deviceid);
|
||||||
|
@ -1298,7 +1297,6 @@ SProcXIGetProperty(ClientPtr client)
|
||||||
swapl(&stuff->type);
|
swapl(&stuff->type);
|
||||||
swapl(&stuff->offset);
|
swapl(&stuff->offset);
|
||||||
swapl(&stuff->len);
|
swapl(&stuff->len);
|
||||||
REQUEST_SIZE_MATCH(xXIGetPropertyReq);
|
|
||||||
return (ProcXIGetProperty(client));
|
return (ProcXIGetProperty(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ int
|
||||||
SProcXIQueryDevice(ClientPtr client)
|
SProcXIQueryDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXIQueryDeviceReq);
|
REQUEST(xXIQueryDeviceReq);
|
||||||
|
REQUEST_SIZE_MATCH(xXIQueryDeviceReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swaps(&stuff->deviceid);
|
swaps(&stuff->deviceid);
|
||||||
|
|
|
@ -63,6 +63,8 @@ int
|
||||||
SProcXIQueryPointer(ClientPtr client)
|
SProcXIQueryPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXIQueryPointerReq);
|
REQUEST(xXIQueryPointerReq);
|
||||||
|
REQUEST_SIZE_MATCH(xXIQueryPointerReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swaps(&stuff->deviceid);
|
swaps(&stuff->deviceid);
|
||||||
swapl(&stuff->win);
|
swapl(&stuff->win);
|
||||||
|
|
|
@ -114,6 +114,7 @@ int
|
||||||
SProcXISelectEvents(ClientPtr client)
|
SProcXISelectEvents(ClientPtr client)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
int len;
|
||||||
xXIEventMask *evmask;
|
xXIEventMask *evmask;
|
||||||
|
|
||||||
REQUEST(xXISelectEventsReq);
|
REQUEST(xXISelectEventsReq);
|
||||||
|
@ -122,10 +123,17 @@ SProcXISelectEvents(ClientPtr client)
|
||||||
swapl(&stuff->win);
|
swapl(&stuff->win);
|
||||||
swaps(&stuff->num_masks);
|
swaps(&stuff->num_masks);
|
||||||
|
|
||||||
|
len = stuff->length - bytes_to_int32(sizeof(xXISelectEventsReq));
|
||||||
evmask = (xXIEventMask *) &stuff[1];
|
evmask = (xXIEventMask *) &stuff[1];
|
||||||
for (i = 0; i < stuff->num_masks; i++) {
|
for (i = 0; i < stuff->num_masks; i++) {
|
||||||
|
if (len < bytes_to_int32(sizeof(xXIEventMask)))
|
||||||
|
return BadLength;
|
||||||
|
len -= bytes_to_int32(sizeof(xXIEventMask));
|
||||||
swaps(&evmask->deviceid);
|
swaps(&evmask->deviceid);
|
||||||
swaps(&evmask->mask_len);
|
swaps(&evmask->mask_len);
|
||||||
|
if (len < evmask->mask_len)
|
||||||
|
return BadLength;
|
||||||
|
len -= evmask->mask_len;
|
||||||
evmask =
|
evmask =
|
||||||
(xXIEventMask *) (((char *) &evmask[1]) + evmask->mask_len * 4);
|
(xXIEventMask *) (((char *) &evmask[1]) + evmask->mask_len * 4);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,10 +51,11 @@ int
|
||||||
SProcXISetClientPointer(ClientPtr client)
|
SProcXISetClientPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXISetClientPointerReq);
|
REQUEST(xXISetClientPointerReq);
|
||||||
|
REQUEST_SIZE_MATCH(xXISetClientPointerReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->win);
|
swapl(&stuff->win);
|
||||||
swaps(&stuff->deviceid);
|
swaps(&stuff->deviceid);
|
||||||
REQUEST_SIZE_MATCH(xXISetClientPointerReq);
|
|
||||||
return (ProcXISetClientPointer(client));
|
return (ProcXISetClientPointer(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,8 @@ int
|
||||||
SProcXISetFocus(ClientPtr client)
|
SProcXISetFocus(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXISetFocusReq);
|
REQUEST(xXISetFocusReq);
|
||||||
|
REQUEST_AT_LEAST_SIZE(xXISetFocusReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swaps(&stuff->deviceid);
|
swaps(&stuff->deviceid);
|
||||||
swapl(&stuff->focus);
|
swapl(&stuff->focus);
|
||||||
|
@ -56,6 +58,8 @@ int
|
||||||
SProcXIGetFocus(ClientPtr client)
|
SProcXIGetFocus(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXIGetFocusReq);
|
REQUEST(xXIGetFocusReq);
|
||||||
|
REQUEST_AT_LEAST_SIZE(xXIGetFocusReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swaps(&stuff->deviceid);
|
swaps(&stuff->deviceid);
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,8 @@ int
|
||||||
SProcXIWarpPointer(ClientPtr client)
|
SProcXIWarpPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXIWarpPointerReq);
|
REQUEST(xXIWarpPointerReq);
|
||||||
|
REQUEST_SIZE_MATCH(xXIWarpPointerReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->src_win);
|
swapl(&stuff->src_win);
|
||||||
swapl(&stuff->dst_win);
|
swapl(&stuff->dst_win);
|
||||||
|
|
|
@ -69,6 +69,24 @@ static const char *itoa(int i)
|
||||||
return itoa_buf;
|
return itoa_buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Bool
|
||||||
|
check_seat(struct udev_device *udev_device)
|
||||||
|
{
|
||||||
|
const char *dev_seat;
|
||||||
|
|
||||||
|
dev_seat = udev_device_get_property_value(udev_device, "ID_SEAT");
|
||||||
|
if (!dev_seat)
|
||||||
|
dev_seat = "seat0";
|
||||||
|
|
||||||
|
if (SeatId && strcmp(dev_seat, SeatId))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (!SeatId && strcmp(dev_seat, "seat0"))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
device_added(struct udev_device *udev_device)
|
device_added(struct udev_device *udev_device)
|
||||||
{
|
{
|
||||||
|
@ -83,7 +101,6 @@ device_added(struct udev_device *udev_device)
|
||||||
struct udev_list_entry *set, *entry;
|
struct udev_list_entry *set, *entry;
|
||||||
struct udev_device *parent;
|
struct udev_device *parent;
|
||||||
int rc;
|
int rc;
|
||||||
const char *dev_seat;
|
|
||||||
dev_t devnum;
|
dev_t devnum;
|
||||||
|
|
||||||
path = udev_device_get_devnode(udev_device);
|
path = udev_device_get_devnode(udev_device);
|
||||||
|
@ -93,14 +110,7 @@ device_added(struct udev_device *udev_device)
|
||||||
if (!path || !syspath)
|
if (!path || !syspath)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dev_seat = udev_device_get_property_value(udev_device, "ID_SEAT");
|
if (!check_seat(udev_device))
|
||||||
if (!dev_seat)
|
|
||||||
dev_seat = "seat0";
|
|
||||||
|
|
||||||
if (SeatId && strcmp(dev_seat, SeatId))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!SeatId && strcmp(dev_seat, "seat0"))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
devnum = udev_device_get_devnum(udev_device);
|
devnum = udev_device_get_devnum(udev_device);
|
||||||
|
@ -506,6 +516,8 @@ config_udev_odev_probe(config_odev_probe_proc_ptr probe_callback)
|
||||||
goto no_probe;
|
goto no_probe;
|
||||||
else if (strncmp(sysname, "card", 4) != 0)
|
else if (strncmp(sysname, "card", 4) != 0)
|
||||||
goto no_probe;
|
goto no_probe;
|
||||||
|
else if (!check_seat(udev_device))
|
||||||
|
goto no_probe;
|
||||||
|
|
||||||
config_udev_odev_setup_attribs(path, syspath, major(devnum),
|
config_udev_odev_setup_attribs(path, syspath, major(devnum),
|
||||||
minor(devnum), probe_callback);
|
minor(devnum), probe_callback);
|
||||||
|
|
|
@ -26,8 +26,8 @@ dnl
|
||||||
dnl Process this file with autoconf to create configure.
|
dnl Process this file with autoconf to create configure.
|
||||||
|
|
||||||
AC_PREREQ(2.60)
|
AC_PREREQ(2.60)
|
||||||
AC_INIT([xorg-server], 1.16.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
|
AC_INIT([xorg-server], 1.16.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
|
||||||
RELEASE_DATE="2014-07-16"
|
RELEASE_DATE="2014-12-20"
|
||||||
RELEASE_NAME="Marionberry Pie"
|
RELEASE_NAME="Marionberry Pie"
|
||||||
AC_CONFIG_SRCDIR([Makefile.am])
|
AC_CONFIG_SRCDIR([Makefile.am])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
@ -2610,6 +2610,7 @@ hw/kdrive/linux/Makefile
|
||||||
hw/kdrive/src/Makefile
|
hw/kdrive/src/Makefile
|
||||||
hw/xwayland/Makefile
|
hw/xwayland/Makefile
|
||||||
test/Makefile
|
test/Makefile
|
||||||
|
test/xi1/Makefile
|
||||||
test/xi2/Makefile
|
test/xi2/Makefile
|
||||||
xserver.ent
|
xserver.ent
|
||||||
xorg-server.pc
|
xorg-server.pc
|
||||||
|
|
17
dbe/dbe.c
17
dbe/dbe.c
|
@ -450,18 +450,21 @@ ProcDbeSwapBuffers(ClientPtr client)
|
||||||
DbeSwapInfoPtr swapInfo;
|
DbeSwapInfoPtr swapInfo;
|
||||||
xDbeSwapInfo *dbeSwapInfo;
|
xDbeSwapInfo *dbeSwapInfo;
|
||||||
int error;
|
int error;
|
||||||
register int i, j;
|
unsigned int i, j;
|
||||||
int nStuff;
|
unsigned int nStuff;
|
||||||
|
int nStuff_i; /* DDX API requires int for nStuff */
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq);
|
REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq);
|
||||||
nStuff = stuff->n; /* use local variable for performance. */
|
nStuff = stuff->n; /* use local variable for performance. */
|
||||||
|
|
||||||
if (nStuff == 0) {
|
if (nStuff == 0) {
|
||||||
|
REQUEST_SIZE_MATCH(xDbeSwapBuffersReq);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nStuff > UINT32_MAX / sizeof(DbeSwapInfoRec))
|
if (nStuff > UINT32_MAX / sizeof(DbeSwapInfoRec))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
REQUEST_FIXED_SIZE(xDbeSwapBuffersReq, nStuff * sizeof(xDbeSwapInfo));
|
||||||
|
|
||||||
/* Get to the swap info appended to the end of the request. */
|
/* Get to the swap info appended to the end of the request. */
|
||||||
dbeSwapInfo = (xDbeSwapInfo *) &stuff[1];
|
dbeSwapInfo = (xDbeSwapInfo *) &stuff[1];
|
||||||
|
@ -525,9 +528,10 @@ ProcDbeSwapBuffers(ClientPtr client)
|
||||||
* could deal with cross-screen synchronization.
|
* could deal with cross-screen synchronization.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
while (nStuff > 0) {
|
nStuff_i = nStuff;
|
||||||
|
while (nStuff_i > 0) {
|
||||||
pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(swapInfo[0].pWindow);
|
pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(swapInfo[0].pWindow);
|
||||||
error = (*pDbeScreenPriv->SwapBuffers) (client, &nStuff, swapInfo);
|
error = (*pDbeScreenPriv->SwapBuffers) (client, &nStuff_i, swapInfo);
|
||||||
if (error != Success) {
|
if (error != Success) {
|
||||||
free(swapInfo);
|
free(swapInfo);
|
||||||
return error;
|
return error;
|
||||||
|
@ -914,13 +918,16 @@ static int
|
||||||
SProcDbeSwapBuffers(ClientPtr client)
|
SProcDbeSwapBuffers(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDbeSwapBuffersReq);
|
REQUEST(xDbeSwapBuffersReq);
|
||||||
register int i;
|
unsigned int i;
|
||||||
xDbeSwapInfo *pSwapInfo;
|
xDbeSwapInfo *pSwapInfo;
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq);
|
REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq);
|
||||||
|
|
||||||
swapl(&stuff->n);
|
swapl(&stuff->n);
|
||||||
|
if (stuff->n > UINT32_MAX / sizeof(DbeSwapInfoRec))
|
||||||
|
return BadAlloc;
|
||||||
|
REQUEST_FIXED_SIZE(xDbeSwapBuffersReq, stuff->n * sizeof(xDbeSwapInfo));
|
||||||
|
|
||||||
if (stuff->n != 0) {
|
if (stuff->n != 0) {
|
||||||
pSwapInfo = (xDbeSwapInfo *) stuff + 1;
|
pSwapInfo = (xDbeSwapInfo *) stuff + 1;
|
||||||
|
|
|
@ -416,7 +416,7 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent)
|
||||||
XISendDeviceHierarchyEvent(flags);
|
XISendDeviceHierarchyEvent(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsMaster(dev))
|
if (!IsMaster(dev) && !IsFloating(dev))
|
||||||
XkbPushLockedStateToSlaves(GetMaster(dev, MASTER_KEYBOARD), 0, 0);
|
XkbPushLockedStateToSlaves(GetMaster(dev, MASTER_KEYBOARD), 0, 0);
|
||||||
RecalculateMasterButtons(dev);
|
RecalculateMasterButtons(dev);
|
||||||
|
|
||||||
|
|
|
@ -1956,6 +1956,9 @@ ProcPutImage(ClientPtr client)
|
||||||
tmpImage = (char *) &stuff[1];
|
tmpImage = (char *) &stuff[1];
|
||||||
lengthProto = length;
|
lengthProto = length;
|
||||||
|
|
||||||
|
if (stuff->height != 0 && lengthProto >= (INT32_MAX / stuff->height))
|
||||||
|
return BadLength;
|
||||||
|
|
||||||
if ((bytes_to_int32(lengthProto * stuff->height) +
|
if ((bytes_to_int32(lengthProto * stuff->height) +
|
||||||
bytes_to_int32(sizeof(xPutImageReq))) != client->req_len)
|
bytes_to_int32(sizeof(xPutImageReq))) != client->req_len)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
20
dix/region.c
20
dix/region.c
|
@ -169,7 +169,6 @@ Equipment Corporation.
|
||||||
((r1)->y1 <= (r2)->y1) && \
|
((r1)->y1 <= (r2)->y1) && \
|
||||||
((r1)->y2 >= (r2)->y2) )
|
((r1)->y2 >= (r2)->y2) )
|
||||||
|
|
||||||
#define xallocData(n) malloc(RegionSizeof(n))
|
|
||||||
#define xfreeData(reg) if ((reg)->data && (reg)->data->size) free((reg)->data)
|
#define xfreeData(reg) if ((reg)->data && (reg)->data->size) free((reg)->data)
|
||||||
|
|
||||||
#define RECTALLOC_BAIL(pReg,n,bail) \
|
#define RECTALLOC_BAIL(pReg,n,bail) \
|
||||||
|
@ -205,8 +204,9 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
|
||||||
#define DOWNSIZE(reg,numRects) \
|
#define DOWNSIZE(reg,numRects) \
|
||||||
if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \
|
if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \
|
||||||
{ \
|
{ \
|
||||||
RegDataPtr NewData; \
|
size_t NewSize = RegionSizeof(numRects); \
|
||||||
NewData = (RegDataPtr)realloc((reg)->data, RegionSizeof(numRects)); \
|
RegDataPtr NewData = \
|
||||||
|
(NewSize > 0) ? realloc((reg)->data, NewSize) : NULL ; \
|
||||||
if (NewData) \
|
if (NewData) \
|
||||||
{ \
|
{ \
|
||||||
NewData->size = (numRects); \
|
NewData->size = (numRects); \
|
||||||
|
@ -345,17 +345,20 @@ Bool
|
||||||
RegionRectAlloc(RegionPtr pRgn, int n)
|
RegionRectAlloc(RegionPtr pRgn, int n)
|
||||||
{
|
{
|
||||||
RegDataPtr data;
|
RegDataPtr data;
|
||||||
|
size_t rgnSize;
|
||||||
|
|
||||||
if (!pRgn->data) {
|
if (!pRgn->data) {
|
||||||
n++;
|
n++;
|
||||||
pRgn->data = xallocData(n);
|
rgnSize = RegionSizeof(n);
|
||||||
|
pRgn->data = (rgnSize > 0) ? malloc(rgnSize) : NULL;
|
||||||
if (!pRgn->data)
|
if (!pRgn->data)
|
||||||
return RegionBreak(pRgn);
|
return RegionBreak(pRgn);
|
||||||
pRgn->data->numRects = 1;
|
pRgn->data->numRects = 1;
|
||||||
*RegionBoxptr(pRgn) = pRgn->extents;
|
*RegionBoxptr(pRgn) = pRgn->extents;
|
||||||
}
|
}
|
||||||
else if (!pRgn->data->size) {
|
else if (!pRgn->data->size) {
|
||||||
pRgn->data = xallocData(n);
|
rgnSize = RegionSizeof(n);
|
||||||
|
pRgn->data = (rgnSize > 0) ? malloc(rgnSize) : NULL;
|
||||||
if (!pRgn->data)
|
if (!pRgn->data)
|
||||||
return RegionBreak(pRgn);
|
return RegionBreak(pRgn);
|
||||||
pRgn->data->numRects = 0;
|
pRgn->data->numRects = 0;
|
||||||
|
@ -367,7 +370,8 @@ RegionRectAlloc(RegionPtr pRgn, int n)
|
||||||
n = 250;
|
n = 250;
|
||||||
}
|
}
|
||||||
n += pRgn->data->numRects;
|
n += pRgn->data->numRects;
|
||||||
data = (RegDataPtr) realloc(pRgn->data, RegionSizeof(n));
|
rgnSize = RegionSizeof(n);
|
||||||
|
data = (rgnSize > 0) ? realloc(pRgn->data, rgnSize) : NULL;
|
||||||
if (!data)
|
if (!data)
|
||||||
return RegionBreak(pRgn);
|
return RegionBreak(pRgn);
|
||||||
pRgn->data = data;
|
pRgn->data = data;
|
||||||
|
@ -1312,6 +1316,7 @@ RegionFromRects(int nrects, xRectangle *prect, int ctype)
|
||||||
{
|
{
|
||||||
|
|
||||||
RegionPtr pRgn;
|
RegionPtr pRgn;
|
||||||
|
size_t rgnSize;
|
||||||
RegDataPtr pData;
|
RegDataPtr pData;
|
||||||
BoxPtr pBox;
|
BoxPtr pBox;
|
||||||
int i;
|
int i;
|
||||||
|
@ -1338,7 +1343,8 @@ RegionFromRects(int nrects, xRectangle *prect, int ctype)
|
||||||
}
|
}
|
||||||
return pRgn;
|
return pRgn;
|
||||||
}
|
}
|
||||||
pData = xallocData(nrects);
|
rgnSize = RegionSizeof(nrects);
|
||||||
|
pData = (rgnSize > 0) ? malloc(rgnSize) : NULL;
|
||||||
if (!pData) {
|
if (!pData) {
|
||||||
RegionBreak(pRgn);
|
RegionBreak(pRgn);
|
||||||
return pRgn;
|
return pRgn;
|
||||||
|
|
|
@ -321,6 +321,7 @@ static int
|
||||||
sproc_dri3_query_version(ClientPtr client)
|
sproc_dri3_query_version(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDRI3QueryVersionReq);
|
REQUEST(xDRI3QueryVersionReq);
|
||||||
|
REQUEST_SIZE_MATCH(xDRI3QueryVersionReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->majorVersion);
|
swapl(&stuff->majorVersion);
|
||||||
|
@ -332,6 +333,7 @@ static int
|
||||||
sproc_dri3_open(ClientPtr client)
|
sproc_dri3_open(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDRI3OpenReq);
|
REQUEST(xDRI3OpenReq);
|
||||||
|
REQUEST_SIZE_MATCH(xDRI3OpenReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
|
@ -343,6 +345,7 @@ static int
|
||||||
sproc_dri3_pixmap_from_buffer(ClientPtr client)
|
sproc_dri3_pixmap_from_buffer(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDRI3PixmapFromBufferReq);
|
REQUEST(xDRI3PixmapFromBufferReq);
|
||||||
|
REQUEST_SIZE_MATCH(xDRI3PixmapFromBufferReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->pixmap);
|
swapl(&stuff->pixmap);
|
||||||
|
@ -358,6 +361,7 @@ static int
|
||||||
sproc_dri3_buffer_from_pixmap(ClientPtr client)
|
sproc_dri3_buffer_from_pixmap(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDRI3BufferFromPixmapReq);
|
REQUEST(xDRI3BufferFromPixmapReq);
|
||||||
|
REQUEST_SIZE_MATCH(xDRI3BufferFromPixmapReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->pixmap);
|
swapl(&stuff->pixmap);
|
||||||
|
@ -368,6 +372,7 @@ static int
|
||||||
sproc_dri3_fence_from_fd(ClientPtr client)
|
sproc_dri3_fence_from_fd(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDRI3FenceFromFDReq);
|
REQUEST(xDRI3FenceFromFDReq);
|
||||||
|
REQUEST_SIZE_MATCH(xDRI3FenceFromFDReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
|
@ -379,6 +384,7 @@ static int
|
||||||
sproc_dri3_fd_from_fence(ClientPtr client)
|
sproc_dri3_fd_from_fence(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDRI3FDFromFenceReq);
|
REQUEST(xDRI3FDFromFenceReq);
|
||||||
|
REQUEST_SIZE_MATCH(xDRI3FDFromFenceReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
|
|
20
fb/fbseg.c
20
fb/fbseg.c
|
@ -65,12 +65,6 @@ fbBresSolid(DrawablePtr pDrawable,
|
||||||
if (axis == X_AXIS) {
|
if (axis == X_AXIS) {
|
||||||
bits = 0;
|
bits = 0;
|
||||||
while (len--) {
|
while (len--) {
|
||||||
if (e >= 0) {
|
|
||||||
WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, bits));
|
|
||||||
bits = 0;
|
|
||||||
dst += dstStride;
|
|
||||||
e += e3;
|
|
||||||
}
|
|
||||||
bits |= mask;
|
bits |= mask;
|
||||||
mask = fbBresShiftMask(mask, signdx, dstBpp);
|
mask = fbBresShiftMask(mask, signdx, dstBpp);
|
||||||
if (!mask) {
|
if (!mask) {
|
||||||
|
@ -80,12 +74,23 @@ fbBresSolid(DrawablePtr pDrawable,
|
||||||
mask = mask0;
|
mask = mask0;
|
||||||
}
|
}
|
||||||
e += e1;
|
e += e1;
|
||||||
|
if (e >= 0) {
|
||||||
|
if (bits) {
|
||||||
|
WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, bits));
|
||||||
|
bits = 0;
|
||||||
|
}
|
||||||
|
dst += dstStride;
|
||||||
|
e += e3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (bits)
|
if (bits)
|
||||||
WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, bits));
|
WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, bits));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
while (len--) {
|
while (len--) {
|
||||||
|
WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, mask));
|
||||||
|
dst += dstStride;
|
||||||
|
e += e1;
|
||||||
if (e >= 0) {
|
if (e >= 0) {
|
||||||
e += e3;
|
e += e3;
|
||||||
mask = fbBresShiftMask(mask, signdx, dstBpp);
|
mask = fbBresShiftMask(mask, signdx, dstBpp);
|
||||||
|
@ -94,9 +99,6 @@ fbBresSolid(DrawablePtr pDrawable,
|
||||||
mask = mask0;
|
mask = mask0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, mask));
|
|
||||||
dst += dstStride;
|
|
||||||
e += e1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ fbCreateWindow(WindowPtr pWin)
|
||||||
{
|
{
|
||||||
dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(pWin),
|
dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(pWin),
|
||||||
fbGetScreenPixmap(pWin->drawable.pScreen));
|
fbGetScreenPixmap(pWin->drawable.pScreen));
|
||||||
if (pWin->drawable.bitsPerPixel == 32)
|
if (pWin->drawable.bitsPerPixel == 32 && pWin->drawable.depth <= 24)
|
||||||
pWin->drawable.bitsPerPixel =
|
pWin->drawable.bitsPerPixel =
|
||||||
fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp;
|
fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -1450,8 +1450,8 @@ glamor_composite_clipped_region(CARD8 op,
|
||||||
|| source_pixmap->drawable.height != height)))) {
|
|| source_pixmap->drawable.height != height)))) {
|
||||||
temp_src =
|
temp_src =
|
||||||
glamor_convert_gradient_picture(screen, source,
|
glamor_convert_gradient_picture(screen, source,
|
||||||
extent->x1 + x_source - x_dest,
|
extent->x1 + x_source - x_dest - dest->pDrawable->x,
|
||||||
extent->y1 + y_source - y_dest,
|
extent->y1 + y_source - y_dest - dest->pDrawable->y,
|
||||||
width, height);
|
width, height);
|
||||||
if (!temp_src) {
|
if (!temp_src) {
|
||||||
temp_src = source;
|
temp_src = source;
|
||||||
|
@ -1459,8 +1459,8 @@ glamor_composite_clipped_region(CARD8 op,
|
||||||
}
|
}
|
||||||
temp_src_priv =
|
temp_src_priv =
|
||||||
glamor_get_pixmap_private((PixmapPtr) (temp_src->pDrawable));
|
glamor_get_pixmap_private((PixmapPtr) (temp_src->pDrawable));
|
||||||
x_temp_src = -extent->x1 + x_dest;
|
x_temp_src = -extent->x1 + x_dest + dest->pDrawable->x;
|
||||||
y_temp_src = -extent->y1 + y_dest;
|
y_temp_src = -extent->y1 + y_dest + dest->pDrawable->y;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask
|
if (mask
|
||||||
|
@ -1474,8 +1474,8 @@ glamor_composite_clipped_region(CARD8 op,
|
||||||
* to do reduce one convertion. */
|
* to do reduce one convertion. */
|
||||||
temp_mask =
|
temp_mask =
|
||||||
glamor_convert_gradient_picture(screen, mask,
|
glamor_convert_gradient_picture(screen, mask,
|
||||||
extent->x1 + x_mask - x_dest,
|
extent->x1 + x_mask - x_dest - dest->pDrawable->x,
|
||||||
extent->y1 + y_mask - y_dest,
|
extent->y1 + y_mask - y_dest - dest->pDrawable->y,
|
||||||
width, height);
|
width, height);
|
||||||
if (!temp_mask) {
|
if (!temp_mask) {
|
||||||
temp_mask = mask;
|
temp_mask = mask;
|
||||||
|
@ -1483,8 +1483,8 @@ glamor_composite_clipped_region(CARD8 op,
|
||||||
}
|
}
|
||||||
temp_mask_priv =
|
temp_mask_priv =
|
||||||
glamor_get_pixmap_private((PixmapPtr) (temp_mask->pDrawable));
|
glamor_get_pixmap_private((PixmapPtr) (temp_mask->pDrawable));
|
||||||
x_temp_mask = -extent->x1 + x_dest;
|
x_temp_mask = -extent->x1 + x_dest + dest->pDrawable->x;
|
||||||
y_temp_mask = -extent->y1 + y_dest;
|
y_temp_mask = -extent->y1 + y_dest + dest->pDrawable->y;
|
||||||
}
|
}
|
||||||
/* Do two-pass PictOpOver componentAlpha, until we enable
|
/* Do two-pass PictOpOver componentAlpha, until we enable
|
||||||
* dual source color blending.
|
* dual source color blending.
|
||||||
|
|
|
@ -33,18 +33,22 @@ static int
|
||||||
set_client_info(__GLXclientState * cl, xGLXSetClientInfoARBReq * req,
|
set_client_info(__GLXclientState * cl, xGLXSetClientInfoARBReq * req,
|
||||||
unsigned bytes_per_version)
|
unsigned bytes_per_version)
|
||||||
{
|
{
|
||||||
|
ClientPtr client = cl->client;
|
||||||
char *gl_extensions;
|
char *gl_extensions;
|
||||||
char *glx_extensions;
|
char *glx_extensions;
|
||||||
|
int size;
|
||||||
|
|
||||||
|
REQUEST_AT_LEAST_SIZE(xGLXSetClientInfoARBReq);
|
||||||
|
|
||||||
/* Verify that the size of the packet matches the size inferred from the
|
/* Verify that the size of the packet matches the size inferred from the
|
||||||
* sizes specified for the various fields.
|
* sizes specified for the various fields.
|
||||||
*/
|
*/
|
||||||
const unsigned expected_size = sz_xGLXSetClientInfoARBReq
|
size = sz_xGLXSetClientInfoARBReq;
|
||||||
+ (req->numVersions * bytes_per_version)
|
size = safe_add(size, safe_mul(req->numVersions, bytes_per_version));
|
||||||
+ __GLX_PAD(req->numGLExtensionBytes)
|
size = safe_add(size, safe_pad(req->numGLExtensionBytes));
|
||||||
+ __GLX_PAD(req->numGLXExtensionBytes);
|
size = safe_add(size, safe_pad(req->numGLXExtensionBytes));
|
||||||
|
|
||||||
if (req->length != (expected_size / 4))
|
if (size < 0 || req->length != (size / 4))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
/* Verify that the actual length of the GL extension string matches what's
|
/* Verify that the actual length of the GL extension string matches what's
|
||||||
|
@ -80,8 +84,11 @@ __glXDisp_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc)
|
||||||
int
|
int
|
||||||
__glXDispSwap_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
|
ClientPtr client = cl->client;
|
||||||
xGLXSetClientInfoARBReq *req = (xGLXSetClientInfoARBReq *) pc;
|
xGLXSetClientInfoARBReq *req = (xGLXSetClientInfoARBReq *) pc;
|
||||||
|
|
||||||
|
REQUEST_AT_LEAST_SIZE(xGLXSetClientInfoARBReq);
|
||||||
|
|
||||||
req->length = bswap_16(req->length);
|
req->length = bswap_16(req->length);
|
||||||
req->numVersions = bswap_32(req->numVersions);
|
req->numVersions = bswap_32(req->numVersions);
|
||||||
req->numGLExtensionBytes = bswap_32(req->numGLExtensionBytes);
|
req->numGLExtensionBytes = bswap_32(req->numGLExtensionBytes);
|
||||||
|
@ -99,8 +106,11 @@ __glXDisp_SetClientInfo2ARB(__GLXclientState * cl, GLbyte * pc)
|
||||||
int
|
int
|
||||||
__glXDispSwap_SetClientInfo2ARB(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_SetClientInfo2ARB(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
|
ClientPtr client = cl->client;
|
||||||
xGLXSetClientInfoARBReq *req = (xGLXSetClientInfoARBReq *) pc;
|
xGLXSetClientInfoARBReq *req = (xGLXSetClientInfoARBReq *) pc;
|
||||||
|
|
||||||
|
REQUEST_AT_LEAST_SIZE(xGLXSetClientInfoARBReq);
|
||||||
|
|
||||||
req->length = bswap_16(req->length);
|
req->length = bswap_16(req->length);
|
||||||
req->numVersions = bswap_32(req->numVersions);
|
req->numVersions = bswap_32(req->numVersions);
|
||||||
req->numGLExtensionBytes = bswap_32(req->numGLExtensionBytes);
|
req->numGLExtensionBytes = bswap_32(req->numGLExtensionBytes);
|
||||||
|
|
|
@ -2023,7 +2023,7 @@ __glXDisp_Render(__GLXclientState * cl, GLbyte * pc)
|
||||||
left = (req->length << 2) - sz_xGLXRenderReq;
|
left = (req->length << 2) - sz_xGLXRenderReq;
|
||||||
while (left > 0) {
|
while (left > 0) {
|
||||||
__GLXrenderSizeData entry;
|
__GLXrenderSizeData entry;
|
||||||
int extra;
|
int extra = 0;
|
||||||
__GLXdispatchRenderProcPtr proc;
|
__GLXdispatchRenderProcPtr proc;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
@ -2042,6 +2042,9 @@ __glXDisp_Render(__GLXclientState * cl, GLbyte * pc)
|
||||||
cmdlen = hdr->length;
|
cmdlen = hdr->length;
|
||||||
opcode = hdr->opcode;
|
opcode = hdr->opcode;
|
||||||
|
|
||||||
|
if (left < cmdlen)
|
||||||
|
return BadLength;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Check for core opcodes and grab entry data.
|
** Check for core opcodes and grab entry data.
|
||||||
*/
|
*/
|
||||||
|
@ -2055,24 +2058,21 @@ __glXDisp_Render(__GLXclientState * cl, GLbyte * pc)
|
||||||
return __glXError(GLXBadRenderRequest);
|
return __glXError(GLXBadRenderRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cmdlen < entry.bytes) {
|
||||||
|
return BadLength;
|
||||||
|
}
|
||||||
|
|
||||||
if (entry.varsize) {
|
if (entry.varsize) {
|
||||||
/* variable size command */
|
/* variable size command */
|
||||||
extra = (*entry.varsize) (pc + __GLX_RENDER_HDR_SIZE,
|
extra = (*entry.varsize) (pc + __GLX_RENDER_HDR_SIZE,
|
||||||
client->swapped);
|
client->swapped,
|
||||||
|
left - __GLX_RENDER_HDR_SIZE);
|
||||||
if (extra < 0) {
|
if (extra < 0) {
|
||||||
extra = 0;
|
|
||||||
}
|
|
||||||
if (cmdlen != __GLX_PAD(entry.bytes + extra)) {
|
|
||||||
return BadLength;
|
return BadLength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
/* constant size command */
|
if (cmdlen != safe_pad(safe_add(entry.bytes, extra))) {
|
||||||
if (cmdlen != __GLX_PAD(entry.bytes)) {
|
|
||||||
return BadLength;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (left < cmdlen) {
|
|
||||||
return BadLength;
|
return BadLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2108,6 +2108,8 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
|
||||||
|
|
||||||
__GLX_DECLARE_SWAP_VARIABLES;
|
__GLX_DECLARE_SWAP_VARIABLES;
|
||||||
|
|
||||||
|
REQUEST_AT_LEAST_SIZE(xGLXRenderLargeReq);
|
||||||
|
|
||||||
req = (xGLXRenderLargeReq *) pc;
|
req = (xGLXRenderLargeReq *) pc;
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
__GLX_SWAP_SHORT(&req->length);
|
__GLX_SWAP_SHORT(&req->length);
|
||||||
|
@ -2123,12 +2125,14 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
|
||||||
__glXResetLargeCommandStatus(cl);
|
__glXResetLargeCommandStatus(cl);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
if (safe_pad(req->dataBytes) < 0)
|
||||||
|
return BadLength;
|
||||||
dataBytes = req->dataBytes;
|
dataBytes = req->dataBytes;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Check the request length.
|
** Check the request length.
|
||||||
*/
|
*/
|
||||||
if ((req->length << 2) != __GLX_PAD(dataBytes) + sz_xGLXRenderLargeReq) {
|
if ((req->length << 2) != safe_pad(dataBytes) + sz_xGLXRenderLargeReq) {
|
||||||
client->errorValue = req->length;
|
client->errorValue = req->length;
|
||||||
/* Reset in case this isn't 1st request. */
|
/* Reset in case this isn't 1st request. */
|
||||||
__glXResetLargeCommandStatus(cl);
|
__glXResetLargeCommandStatus(cl);
|
||||||
|
@ -2138,7 +2142,8 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
|
||||||
|
|
||||||
if (cl->largeCmdRequestsSoFar == 0) {
|
if (cl->largeCmdRequestsSoFar == 0) {
|
||||||
__GLXrenderSizeData entry;
|
__GLXrenderSizeData entry;
|
||||||
int extra;
|
int extra = 0;
|
||||||
|
int left = (req->length << 2) - sz_xGLXRenderLargeReq;
|
||||||
size_t cmdlen;
|
size_t cmdlen;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
@ -2151,13 +2156,17 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
|
||||||
return __glXError(GLXBadLargeRequest);
|
return __glXError(GLXBadLargeRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dataBytes < __GLX_RENDER_LARGE_HDR_SIZE)
|
||||||
|
return BadLength;
|
||||||
|
|
||||||
hdr = (__GLXrenderLargeHeader *) pc;
|
hdr = (__GLXrenderLargeHeader *) pc;
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
__GLX_SWAP_INT(&hdr->length);
|
__GLX_SWAP_INT(&hdr->length);
|
||||||
__GLX_SWAP_INT(&hdr->opcode);
|
__GLX_SWAP_INT(&hdr->opcode);
|
||||||
}
|
}
|
||||||
cmdlen = hdr->length;
|
|
||||||
opcode = hdr->opcode;
|
opcode = hdr->opcode;
|
||||||
|
if ((cmdlen = safe_pad(hdr->length)) < 0)
|
||||||
|
return BadLength;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Check for core opcodes and grab entry data.
|
** Check for core opcodes and grab entry data.
|
||||||
|
@ -2175,21 +2184,18 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
|
||||||
** will be in the 1st request, so it's okay to do this.
|
** will be in the 1st request, so it's okay to do this.
|
||||||
*/
|
*/
|
||||||
extra = (*entry.varsize) (pc + __GLX_RENDER_LARGE_HDR_SIZE,
|
extra = (*entry.varsize) (pc + __GLX_RENDER_LARGE_HDR_SIZE,
|
||||||
client->swapped);
|
client->swapped,
|
||||||
|
left - __GLX_RENDER_LARGE_HDR_SIZE);
|
||||||
if (extra < 0) {
|
if (extra < 0) {
|
||||||
extra = 0;
|
|
||||||
}
|
|
||||||
/* large command's header is 4 bytes longer, so add 4 */
|
|
||||||
if (cmdlen != __GLX_PAD(entry.bytes + 4 + extra)) {
|
|
||||||
return BadLength;
|
return BadLength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
/* constant size command */
|
/* the +4 is safe because we know entry.bytes is small */
|
||||||
if (cmdlen != __GLX_PAD(entry.bytes + 4)) {
|
if (cmdlen != safe_pad(safe_add(entry.bytes + 4, extra))) {
|
||||||
return BadLength;
|
return BadLength;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Make enough space in the buffer, then copy the entire request.
|
** Make enough space in the buffer, then copy the entire request.
|
||||||
*/
|
*/
|
||||||
|
@ -2216,6 +2222,7 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
|
||||||
** We are receiving subsequent (i.e. not the first) requests of a
|
** We are receiving subsequent (i.e. not the first) requests of a
|
||||||
** multi request command.
|
** multi request command.
|
||||||
*/
|
*/
|
||||||
|
int bytesSoFar; /* including this packet */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Check the request number and the total request count.
|
** Check the request number and the total request count.
|
||||||
|
@ -2234,11 +2241,18 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
|
||||||
/*
|
/*
|
||||||
** Check that we didn't get too much data.
|
** Check that we didn't get too much data.
|
||||||
*/
|
*/
|
||||||
if ((cl->largeCmdBytesSoFar + dataBytes) > cl->largeCmdBytesTotal) {
|
if ((bytesSoFar = safe_add(cl->largeCmdBytesSoFar, dataBytes)) < 0) {
|
||||||
client->errorValue = dataBytes;
|
client->errorValue = dataBytes;
|
||||||
__glXResetLargeCommandStatus(cl);
|
__glXResetLargeCommandStatus(cl);
|
||||||
return __glXError(GLXBadLargeRequest);
|
return __glXError(GLXBadLargeRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bytesSoFar > cl->largeCmdBytesTotal) {
|
||||||
|
client->errorValue = dataBytes;
|
||||||
|
__glXResetLargeCommandStatus(cl);
|
||||||
|
return __glXError(GLXBadLargeRequest);
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes);
|
memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes);
|
||||||
cl->largeCmdBytesSoFar += dataBytes;
|
cl->largeCmdBytesSoFar += dataBytes;
|
||||||
cl->largeCmdRequestsSoFar++;
|
cl->largeCmdRequestsSoFar++;
|
||||||
|
@ -2250,17 +2264,16 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
|
||||||
** This is the last request; it must have enough bytes to complete
|
** This is the last request; it must have enough bytes to complete
|
||||||
** the command.
|
** the command.
|
||||||
*/
|
*/
|
||||||
/* NOTE: the two pad macros have been added below; they are needed
|
/* NOTE: the pad macro below is needed because the client library
|
||||||
** because the client library pads the total byte count, but not
|
** pads the total byte count, but not the per-request byte counts.
|
||||||
** the per-request byte counts. The Protocol Encoding says the
|
** The Protocol Encoding says the total byte count should not be
|
||||||
** total byte count should not be padded, so a proposal will be
|
** padded, so a proposal will be made to the ARB to relax the
|
||||||
** made to the ARB to relax the padding constraint on the total
|
** padding constraint on the total byte count, thus preserving
|
||||||
** byte count, thus preserving backward compatibility. Meanwhile,
|
** backward compatibility. Meanwhile, the padding done below
|
||||||
** the padding done below fixes a bug that did not allow
|
** fixes a bug that did not allow large commands of odd sizes to
|
||||||
** large commands of odd sizes to be accepted by the server.
|
** be accepted by the server.
|
||||||
*/
|
*/
|
||||||
if (__GLX_PAD(cl->largeCmdBytesSoFar) !=
|
if (safe_pad(cl->largeCmdBytesSoFar) != cl->largeCmdBytesTotal) {
|
||||||
__GLX_PAD(cl->largeCmdBytesTotal)) {
|
|
||||||
client->errorValue = dataBytes;
|
client->errorValue = dataBytes;
|
||||||
__glXResetLargeCommandStatus(cl);
|
__glXResetLargeCommandStatus(cl);
|
||||||
return __glXError(GLXBadLargeRequest);
|
return __glXError(GLXBadLargeRequest);
|
||||||
|
|
|
@ -958,11 +958,13 @@ __glXDispSwap_RenderLarge(__GLXclientState * cl, GLbyte * pc)
|
||||||
int
|
int
|
||||||
__glXDispSwap_VendorPrivate(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_VendorPrivate(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
|
ClientPtr client = cl->client;
|
||||||
xGLXVendorPrivateReq *req;
|
xGLXVendorPrivateReq *req;
|
||||||
GLint vendorcode;
|
GLint vendorcode;
|
||||||
__GLXdispatchVendorPrivProcPtr proc;
|
__GLXdispatchVendorPrivProcPtr proc;
|
||||||
|
|
||||||
__GLX_DECLARE_SWAP_VARIABLES;
|
__GLX_DECLARE_SWAP_VARIABLES;
|
||||||
|
REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq);
|
||||||
|
|
||||||
req = (xGLXVendorPrivateReq *) pc;
|
req = (xGLXVendorPrivateReq *) pc;
|
||||||
__GLX_SWAP_SHORT(&req->length);
|
__GLX_SWAP_SHORT(&req->length);
|
||||||
|
@ -985,11 +987,13 @@ __glXDispSwap_VendorPrivate(__GLXclientState * cl, GLbyte * pc)
|
||||||
int
|
int
|
||||||
__glXDispSwap_VendorPrivateWithReply(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_VendorPrivateWithReply(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
|
ClientPtr client = cl->client;
|
||||||
xGLXVendorPrivateWithReplyReq *req;
|
xGLXVendorPrivateWithReplyReq *req;
|
||||||
GLint vendorcode;
|
GLint vendorcode;
|
||||||
__GLXdispatchVendorPrivProcPtr proc;
|
__GLXdispatchVendorPrivProcPtr proc;
|
||||||
|
|
||||||
__GLX_DECLARE_SWAP_VARIABLES;
|
__GLX_DECLARE_SWAP_VARIABLES;
|
||||||
|
REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateWithReplyReq);
|
||||||
|
|
||||||
req = (xGLXVendorPrivateWithReplyReq *) pc;
|
req = (xGLXVendorPrivateWithReplyReq *) pc;
|
||||||
__GLX_SWAP_SHORT(&req->length);
|
__GLX_SWAP_SHORT(&req->length);
|
||||||
|
|
|
@ -177,7 +177,7 @@ typedef int (*__GLXprocPtr) (__GLXclientState *, char *pc);
|
||||||
/*
|
/*
|
||||||
* Tables for computing the size of each rendering command.
|
* Tables for computing the size of each rendering command.
|
||||||
*/
|
*/
|
||||||
typedef int (*gl_proto_size_func) (const GLbyte *, Bool);
|
typedef int (*gl_proto_size_func) (const GLbyte *, Bool, int);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int bytes;
|
int bytes;
|
||||||
|
@ -228,6 +228,47 @@ extern void glxSwapQueryServerStringReply(ClientPtr client,
|
||||||
* Routines for computing the size of variably-sized rendering commands.
|
* Routines for computing the size of variably-sized rendering commands.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static _X_INLINE int
|
||||||
|
safe_add(int a, int b)
|
||||||
|
{
|
||||||
|
if (a < 0 || b < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (INT_MAX - a < b)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return a + b;
|
||||||
|
}
|
||||||
|
|
||||||
|
static _X_INLINE int
|
||||||
|
safe_mul(int a, int b)
|
||||||
|
{
|
||||||
|
if (a < 0 || b < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (a == 0 || b == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (a > INT_MAX / b)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return a * b;
|
||||||
|
}
|
||||||
|
|
||||||
|
static _X_INLINE int
|
||||||
|
safe_pad(int a)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (a < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if ((ret = safe_add(a, 3)) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return ret & (GLuint)~3;
|
||||||
|
}
|
||||||
|
|
||||||
extern int __glXTypeSize(GLenum enm);
|
extern int __glXTypeSize(GLenum enm);
|
||||||
extern int __glXImageSize(GLenum format, GLenum type,
|
extern int __glXImageSize(GLenum format, GLenum type,
|
||||||
GLenum target, GLsizei w, GLsizei h, GLsizei d,
|
GLenum target, GLsizei w, GLsizei h, GLsizei d,
|
||||||
|
|
|
@ -2464,6 +2464,9 @@ __glXDisp_AreTexturesResident(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLboolean answerBuffer[200];
|
GLboolean answerBuffer[200];
|
||||||
GLboolean *residences =
|
GLboolean *residences =
|
||||||
__glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1);
|
__glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1);
|
||||||
|
|
||||||
|
if (residences == NULL)
|
||||||
|
return BadAlloc;
|
||||||
retval =
|
retval =
|
||||||
glAreTexturesResident(n, (const GLuint *) (pc + 4), residences);
|
glAreTexturesResident(n, (const GLuint *) (pc + 4), residences);
|
||||||
__glXSendReply(cl->client, residences, n, 1, GL_TRUE, retval);
|
__glXSendReply(cl->client, residences, n, 1, GL_TRUE, retval);
|
||||||
|
@ -2488,6 +2491,9 @@ __glXDisp_AreTexturesResidentEXT(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLboolean answerBuffer[200];
|
GLboolean answerBuffer[200];
|
||||||
GLboolean *residences =
|
GLboolean *residences =
|
||||||
__glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1);
|
__glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1);
|
||||||
|
|
||||||
|
if (residences == NULL)
|
||||||
|
return BadAlloc;
|
||||||
retval =
|
retval =
|
||||||
glAreTexturesResident(n, (const GLuint *) (pc + 4), residences);
|
glAreTexturesResident(n, (const GLuint *) (pc + 4), residences);
|
||||||
__glXSendReply(cl->client, residences, n, 1, GL_TRUE, retval);
|
__glXSendReply(cl->client, residences, n, 1, GL_TRUE, retval);
|
||||||
|
@ -2593,6 +2599,9 @@ __glXDisp_GenTextures(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLuint *textures =
|
GLuint *textures =
|
||||||
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
||||||
4);
|
4);
|
||||||
|
|
||||||
|
if (textures == NULL)
|
||||||
|
return BadAlloc;
|
||||||
glGenTextures(n, textures);
|
glGenTextures(n, textures);
|
||||||
__glXSendReply(cl->client, textures, n, 4, GL_TRUE, 0);
|
__glXSendReply(cl->client, textures, n, 4, GL_TRUE, 0);
|
||||||
error = Success;
|
error = Success;
|
||||||
|
@ -2616,6 +2625,9 @@ __glXDisp_GenTexturesEXT(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLuint *textures =
|
GLuint *textures =
|
||||||
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
||||||
4);
|
4);
|
||||||
|
|
||||||
|
if (textures == NULL)
|
||||||
|
return BadAlloc;
|
||||||
glGenTextures(n, textures);
|
glGenTextures(n, textures);
|
||||||
__glXSendReply(cl->client, textures, n, 4, GL_TRUE, 0);
|
__glXSendReply(cl->client, textures, n, 4, GL_TRUE, 0);
|
||||||
error = Success;
|
error = Success;
|
||||||
|
@ -3883,6 +3895,9 @@ __glXDisp_GenQueries(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLuint *ids =
|
GLuint *ids =
|
||||||
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
||||||
4);
|
4);
|
||||||
|
|
||||||
|
if (ids == NULL)
|
||||||
|
return BadAlloc;
|
||||||
GenQueries(n, ids);
|
GenQueries(n, ids);
|
||||||
__glXSendReply(cl->client, ids, n, 4, GL_TRUE, 0);
|
__glXSendReply(cl->client, ids, n, 4, GL_TRUE, 0);
|
||||||
error = Success;
|
error = Success;
|
||||||
|
@ -4253,6 +4268,9 @@ __glXDisp_GenProgramsARB(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLuint *programs =
|
GLuint *programs =
|
||||||
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
||||||
4);
|
4);
|
||||||
|
|
||||||
|
if (programs == NULL)
|
||||||
|
return BadAlloc;
|
||||||
GenProgramsARB(n, programs);
|
GenProgramsARB(n, programs);
|
||||||
__glXSendReply(cl->client, programs, n, 4, GL_TRUE, 0);
|
__glXSendReply(cl->client, programs, n, 4, GL_TRUE, 0);
|
||||||
error = Success;
|
error = Success;
|
||||||
|
@ -4630,6 +4648,10 @@ __glXDisp_GenFramebuffers(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLuint *framebuffers =
|
GLuint *framebuffers =
|
||||||
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
||||||
4);
|
4);
|
||||||
|
|
||||||
|
if (framebuffers == NULL)
|
||||||
|
return BadAlloc;
|
||||||
|
|
||||||
GenFramebuffers(n, framebuffers);
|
GenFramebuffers(n, framebuffers);
|
||||||
__glXSendReply(cl->client, framebuffers, n, 4, GL_TRUE, 0);
|
__glXSendReply(cl->client, framebuffers, n, 4, GL_TRUE, 0);
|
||||||
error = Success;
|
error = Success;
|
||||||
|
@ -4655,6 +4677,9 @@ __glXDisp_GenRenderbuffers(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLuint *renderbuffers =
|
GLuint *renderbuffers =
|
||||||
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
||||||
4);
|
4);
|
||||||
|
|
||||||
|
if (renderbuffers == NULL)
|
||||||
|
return BadAlloc;
|
||||||
GenRenderbuffers(n, renderbuffers);
|
GenRenderbuffers(n, renderbuffers);
|
||||||
__glXSendReply(cl->client, renderbuffers, n, 4, GL_TRUE, 0);
|
__glXSendReply(cl->client, renderbuffers, n, 4, GL_TRUE, 0);
|
||||||
error = Success;
|
error = Success;
|
||||||
|
|
|
@ -2731,6 +2731,9 @@ __glXDispSwap_AreTexturesResident(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLboolean answerBuffer[200];
|
GLboolean answerBuffer[200];
|
||||||
GLboolean *residences =
|
GLboolean *residences =
|
||||||
__glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1);
|
__glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1);
|
||||||
|
|
||||||
|
if (residences == NULL)
|
||||||
|
return BadAlloc;
|
||||||
retval =
|
retval =
|
||||||
glAreTexturesResident(n,
|
glAreTexturesResident(n,
|
||||||
(const GLuint *)
|
(const GLuint *)
|
||||||
|
@ -2759,6 +2762,9 @@ __glXDispSwap_AreTexturesResidentEXT(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLboolean answerBuffer[200];
|
GLboolean answerBuffer[200];
|
||||||
GLboolean *residences =
|
GLboolean *residences =
|
||||||
__glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1);
|
__glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1);
|
||||||
|
|
||||||
|
if (residences == NULL)
|
||||||
|
return BadAlloc;
|
||||||
retval =
|
retval =
|
||||||
glAreTexturesResident(n,
|
glAreTexturesResident(n,
|
||||||
(const GLuint *)
|
(const GLuint *)
|
||||||
|
@ -2878,6 +2884,9 @@ __glXDispSwap_GenTextures(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLuint *textures =
|
GLuint *textures =
|
||||||
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
||||||
4);
|
4);
|
||||||
|
|
||||||
|
if (textures == NULL)
|
||||||
|
return BadAlloc;
|
||||||
glGenTextures(n, textures);
|
glGenTextures(n, textures);
|
||||||
(void) bswap_32_array((uint32_t *) textures, n);
|
(void) bswap_32_array((uint32_t *) textures, n);
|
||||||
__glXSendReplySwap(cl->client, textures, n, 4, GL_TRUE, 0);
|
__glXSendReplySwap(cl->client, textures, n, 4, GL_TRUE, 0);
|
||||||
|
@ -2903,6 +2912,9 @@ __glXDispSwap_GenTexturesEXT(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLuint *textures =
|
GLuint *textures =
|
||||||
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
||||||
4);
|
4);
|
||||||
|
|
||||||
|
if (textures == NULL)
|
||||||
|
return BadAlloc;
|
||||||
glGenTextures(n, textures);
|
glGenTextures(n, textures);
|
||||||
(void) bswap_32_array((uint32_t *) textures, n);
|
(void) bswap_32_array((uint32_t *) textures, n);
|
||||||
__glXSendReplySwap(cl->client, textures, n, 4, GL_TRUE, 0);
|
__glXSendReplySwap(cl->client, textures, n, 4, GL_TRUE, 0);
|
||||||
|
@ -4290,6 +4302,9 @@ __glXDispSwap_GenQueries(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLuint *ids =
|
GLuint *ids =
|
||||||
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
||||||
4);
|
4);
|
||||||
|
if (ids == NULL)
|
||||||
|
return BadAlloc;
|
||||||
|
|
||||||
GenQueries(n, ids);
|
GenQueries(n, ids);
|
||||||
(void) bswap_32_array((uint32_t *) ids, n);
|
(void) bswap_32_array((uint32_t *) ids, n);
|
||||||
__glXSendReplySwap(cl->client, ids, n, 4, GL_TRUE, 0);
|
__glXSendReplySwap(cl->client, ids, n, 4, GL_TRUE, 0);
|
||||||
|
@ -4697,6 +4712,9 @@ __glXDispSwap_GenProgramsARB(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLuint *programs =
|
GLuint *programs =
|
||||||
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
||||||
4);
|
4);
|
||||||
|
if (programs == NULL)
|
||||||
|
return BadAlloc;
|
||||||
|
|
||||||
GenProgramsARB(n, programs);
|
GenProgramsARB(n, programs);
|
||||||
(void) bswap_32_array((uint32_t *) programs, n);
|
(void) bswap_32_array((uint32_t *) programs, n);
|
||||||
__glXSendReplySwap(cl->client, programs, n, 4, GL_TRUE, 0);
|
__glXSendReplySwap(cl->client, programs, n, 4, GL_TRUE, 0);
|
||||||
|
@ -5122,6 +5140,10 @@ __glXDispSwap_GenFramebuffers(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLuint *framebuffers =
|
GLuint *framebuffers =
|
||||||
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
||||||
4);
|
4);
|
||||||
|
|
||||||
|
if (framebuffers == NULL)
|
||||||
|
return BadAlloc;
|
||||||
|
|
||||||
GenFramebuffers(n, framebuffers);
|
GenFramebuffers(n, framebuffers);
|
||||||
(void) bswap_32_array((uint32_t *) framebuffers, n);
|
(void) bswap_32_array((uint32_t *) framebuffers, n);
|
||||||
__glXSendReplySwap(cl->client, framebuffers, n, 4, GL_TRUE, 0);
|
__glXSendReplySwap(cl->client, framebuffers, n, 4, GL_TRUE, 0);
|
||||||
|
@ -5149,6 +5171,10 @@ __glXDispSwap_GenRenderbuffers(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLuint *renderbuffers =
|
GLuint *renderbuffers =
|
||||||
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
|
||||||
4);
|
4);
|
||||||
|
|
||||||
|
if (renderbuffers == NULL)
|
||||||
|
return BadAlloc;
|
||||||
|
|
||||||
GenRenderbuffers(n, renderbuffers);
|
GenRenderbuffers(n, renderbuffers);
|
||||||
(void) bswap_32_array((uint32_t *) renderbuffers, n);
|
(void) bswap_32_array((uint32_t *) renderbuffers, n);
|
||||||
__glXSendReplySwap(cl->client, renderbuffers, n, 4, GL_TRUE, 0);
|
__glXSendReplySwap(cl->client, renderbuffers, n, 4, GL_TRUE, 0);
|
||||||
|
|
|
@ -56,6 +56,8 @@ DoGetProgramString(struct __GLXclientStateRec *cl, GLbyte * pc,
|
||||||
__GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
|
__GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
|
||||||
ClientPtr client = cl->client;
|
ClientPtr client = cl->client;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXVendorPrivateWithReplyReq, 8);
|
||||||
|
|
||||||
pc += __GLX_VENDPRIV_HDR_SIZE;
|
pc += __GLX_VENDPRIV_HDR_SIZE;
|
||||||
if (cx != NULL) {
|
if (cx != NULL) {
|
||||||
GLenum target;
|
GLenum target;
|
||||||
|
|
|
@ -31,24 +31,22 @@
|
||||||
#include "indirect_size.h"
|
#include "indirect_size.h"
|
||||||
#include "indirect_reqsize.h"
|
#include "indirect_reqsize.h"
|
||||||
|
|
||||||
#define __GLX_PAD(x) (((x) + 3) & ~3)
|
|
||||||
|
|
||||||
#if defined(__CYGWIN__) || defined(__MINGW32__)
|
#if defined(__CYGWIN__) || defined(__MINGW32__)
|
||||||
#undef HAVE_ALIAS
|
#undef HAVE_ALIAS
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ALIAS
|
#ifdef HAVE_ALIAS
|
||||||
#define ALIAS2(from,to) \
|
#define ALIAS2(from,to) \
|
||||||
GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \
|
GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap, int reqlen ) \
|
||||||
__attribute__ ((alias( # to )));
|
__attribute__ ((alias( # to )));
|
||||||
#define ALIAS(from,to) ALIAS2( from, __glX ## to ## ReqSize )
|
#define ALIAS(from,to) ALIAS2( from, __glX ## to ## ReqSize )
|
||||||
#else
|
#else
|
||||||
#define ALIAS(from,to) \
|
#define ALIAS(from,to) \
|
||||||
GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \
|
GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap, int reqlen ) \
|
||||||
{ return __glX ## to ## ReqSize( pc, swap ); }
|
{ return __glX ## to ## ReqSize( pc, swap, reqlen ); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXCallListsReqSize(const GLbyte * pc, Bool swap)
|
__glXCallListsReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLsizei n = *(GLsizei *) (pc + 0);
|
GLsizei n = *(GLsizei *) (pc + 0);
|
||||||
GLenum type = *(GLenum *) (pc + 4);
|
GLenum type = *(GLenum *) (pc + 4);
|
||||||
|
@ -60,11 +58,11 @@ __glXCallListsReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
compsize = __glCallLists_size(type);
|
compsize = __glCallLists_size(type);
|
||||||
return __GLX_PAD((compsize * n));
|
return safe_pad(safe_mul(compsize, n));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXBitmapReqSize(const GLbyte * pc, Bool swap)
|
__glXBitmapReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLint row_length = *(GLint *) (pc + 4);
|
GLint row_length = *(GLint *) (pc + 4);
|
||||||
GLint image_height = 0;
|
GLint image_height = 0;
|
||||||
|
@ -88,7 +86,7 @@ __glXBitmapReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXFogfvReqSize(const GLbyte * pc, Bool swap)
|
__glXFogfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLenum pname = *(GLenum *) (pc + 0);
|
GLenum pname = *(GLenum *) (pc + 0);
|
||||||
GLsizei compsize;
|
GLsizei compsize;
|
||||||
|
@ -98,11 +96,11 @@ __glXFogfvReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
compsize = __glFogfv_size(pname);
|
compsize = __glFogfv_size(pname);
|
||||||
return __GLX_PAD((compsize * 4));
|
return safe_pad(safe_mul(compsize, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXLightfvReqSize(const GLbyte * pc, Bool swap)
|
__glXLightfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLenum pname = *(GLenum *) (pc + 4);
|
GLenum pname = *(GLenum *) (pc + 4);
|
||||||
GLsizei compsize;
|
GLsizei compsize;
|
||||||
|
@ -112,11 +110,11 @@ __glXLightfvReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
compsize = __glLightfv_size(pname);
|
compsize = __glLightfv_size(pname);
|
||||||
return __GLX_PAD((compsize * 4));
|
return safe_pad(safe_mul(compsize, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXLightModelfvReqSize(const GLbyte * pc, Bool swap)
|
__glXLightModelfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLenum pname = *(GLenum *) (pc + 0);
|
GLenum pname = *(GLenum *) (pc + 0);
|
||||||
GLsizei compsize;
|
GLsizei compsize;
|
||||||
|
@ -126,11 +124,11 @@ __glXLightModelfvReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
compsize = __glLightModelfv_size(pname);
|
compsize = __glLightModelfv_size(pname);
|
||||||
return __GLX_PAD((compsize * 4));
|
return safe_pad(safe_mul(compsize, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXMaterialfvReqSize(const GLbyte * pc, Bool swap)
|
__glXMaterialfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLenum pname = *(GLenum *) (pc + 4);
|
GLenum pname = *(GLenum *) (pc + 4);
|
||||||
GLsizei compsize;
|
GLsizei compsize;
|
||||||
|
@ -140,11 +138,11 @@ __glXMaterialfvReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
compsize = __glMaterialfv_size(pname);
|
compsize = __glMaterialfv_size(pname);
|
||||||
return __GLX_PAD((compsize * 4));
|
return safe_pad(safe_mul(compsize, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXPolygonStippleReqSize(const GLbyte * pc, Bool swap)
|
__glXPolygonStippleReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLint row_length = *(GLint *) (pc + 4);
|
GLint row_length = *(GLint *) (pc + 4);
|
||||||
GLint image_height = 0;
|
GLint image_height = 0;
|
||||||
|
@ -164,7 +162,7 @@ __glXPolygonStippleReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXTexParameterfvReqSize(const GLbyte * pc, Bool swap)
|
__glXTexParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLenum pname = *(GLenum *) (pc + 4);
|
GLenum pname = *(GLenum *) (pc + 4);
|
||||||
GLsizei compsize;
|
GLsizei compsize;
|
||||||
|
@ -174,11 +172,11 @@ __glXTexParameterfvReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
compsize = __glTexParameterfv_size(pname);
|
compsize = __glTexParameterfv_size(pname);
|
||||||
return __GLX_PAD((compsize * 4));
|
return safe_pad(safe_mul(compsize, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXTexImage1DReqSize(const GLbyte * pc, Bool swap)
|
__glXTexImage1DReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLint row_length = *(GLint *) (pc + 4);
|
GLint row_length = *(GLint *) (pc + 4);
|
||||||
GLint image_height = 0;
|
GLint image_height = 0;
|
||||||
|
@ -206,7 +204,7 @@ __glXTexImage1DReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXTexImage2DReqSize(const GLbyte * pc, Bool swap)
|
__glXTexImage2DReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLint row_length = *(GLint *) (pc + 4);
|
GLint row_length = *(GLint *) (pc + 4);
|
||||||
GLint image_height = 0;
|
GLint image_height = 0;
|
||||||
|
@ -236,7 +234,7 @@ __glXTexImage2DReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXTexEnvfvReqSize(const GLbyte * pc, Bool swap)
|
__glXTexEnvfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLenum pname = *(GLenum *) (pc + 4);
|
GLenum pname = *(GLenum *) (pc + 4);
|
||||||
GLsizei compsize;
|
GLsizei compsize;
|
||||||
|
@ -246,11 +244,11 @@ __glXTexEnvfvReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
compsize = __glTexEnvfv_size(pname);
|
compsize = __glTexEnvfv_size(pname);
|
||||||
return __GLX_PAD((compsize * 4));
|
return safe_pad(safe_mul(compsize, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXTexGendvReqSize(const GLbyte * pc, Bool swap)
|
__glXTexGendvReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLenum pname = *(GLenum *) (pc + 4);
|
GLenum pname = *(GLenum *) (pc + 4);
|
||||||
GLsizei compsize;
|
GLsizei compsize;
|
||||||
|
@ -260,11 +258,11 @@ __glXTexGendvReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
compsize = __glTexGendv_size(pname);
|
compsize = __glTexGendv_size(pname);
|
||||||
return __GLX_PAD((compsize * 8));
|
return safe_pad(safe_mul(compsize, 8));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXTexGenfvReqSize(const GLbyte * pc, Bool swap)
|
__glXTexGenfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLenum pname = *(GLenum *) (pc + 4);
|
GLenum pname = *(GLenum *) (pc + 4);
|
||||||
GLsizei compsize;
|
GLsizei compsize;
|
||||||
|
@ -274,11 +272,11 @@ __glXTexGenfvReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
compsize = __glTexGenfv_size(pname);
|
compsize = __glTexGenfv_size(pname);
|
||||||
return __GLX_PAD((compsize * 4));
|
return safe_pad(safe_mul(compsize, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXPixelMapfvReqSize(const GLbyte * pc, Bool swap)
|
__glXPixelMapfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLsizei mapsize = *(GLsizei *) (pc + 4);
|
GLsizei mapsize = *(GLsizei *) (pc + 4);
|
||||||
|
|
||||||
|
@ -286,11 +284,11 @@ __glXPixelMapfvReqSize(const GLbyte * pc, Bool swap)
|
||||||
mapsize = bswap_32(mapsize);
|
mapsize = bswap_32(mapsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __GLX_PAD((mapsize * 4));
|
return safe_pad(safe_mul(mapsize, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXPixelMapusvReqSize(const GLbyte * pc, Bool swap)
|
__glXPixelMapusvReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLsizei mapsize = *(GLsizei *) (pc + 4);
|
GLsizei mapsize = *(GLsizei *) (pc + 4);
|
||||||
|
|
||||||
|
@ -298,11 +296,11 @@ __glXPixelMapusvReqSize(const GLbyte * pc, Bool swap)
|
||||||
mapsize = bswap_32(mapsize);
|
mapsize = bswap_32(mapsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __GLX_PAD((mapsize * 2));
|
return safe_pad(safe_mul(mapsize, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXDrawPixelsReqSize(const GLbyte * pc, Bool swap)
|
__glXDrawPixelsReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLint row_length = *(GLint *) (pc + 4);
|
GLint row_length = *(GLint *) (pc + 4);
|
||||||
GLint image_height = 0;
|
GLint image_height = 0;
|
||||||
|
@ -330,7 +328,7 @@ __glXDrawPixelsReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXPrioritizeTexturesReqSize(const GLbyte * pc, Bool swap)
|
__glXPrioritizeTexturesReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLsizei n = *(GLsizei *) (pc + 0);
|
GLsizei n = *(GLsizei *) (pc + 0);
|
||||||
|
|
||||||
|
@ -338,11 +336,11 @@ __glXPrioritizeTexturesReqSize(const GLbyte * pc, Bool swap)
|
||||||
n = bswap_32(n);
|
n = bswap_32(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __GLX_PAD((n * 4) + (n * 4));
|
return safe_pad(safe_add(safe_mul(n, 4), safe_mul(n, 4)));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXTexSubImage1DReqSize(const GLbyte * pc, Bool swap)
|
__glXTexSubImage1DReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLint row_length = *(GLint *) (pc + 4);
|
GLint row_length = *(GLint *) (pc + 4);
|
||||||
GLint image_height = 0;
|
GLint image_height = 0;
|
||||||
|
@ -370,7 +368,7 @@ __glXTexSubImage1DReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXTexSubImage2DReqSize(const GLbyte * pc, Bool swap)
|
__glXTexSubImage2DReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLint row_length = *(GLint *) (pc + 4);
|
GLint row_length = *(GLint *) (pc + 4);
|
||||||
GLint image_height = 0;
|
GLint image_height = 0;
|
||||||
|
@ -400,7 +398,7 @@ __glXTexSubImage2DReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXColorTableReqSize(const GLbyte * pc, Bool swap)
|
__glXColorTableReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLint row_length = *(GLint *) (pc + 4);
|
GLint row_length = *(GLint *) (pc + 4);
|
||||||
GLint image_height = 0;
|
GLint image_height = 0;
|
||||||
|
@ -428,7 +426,7 @@ __glXColorTableReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXColorTableParameterfvReqSize(const GLbyte * pc, Bool swap)
|
__glXColorTableParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLenum pname = *(GLenum *) (pc + 4);
|
GLenum pname = *(GLenum *) (pc + 4);
|
||||||
GLsizei compsize;
|
GLsizei compsize;
|
||||||
|
@ -438,11 +436,11 @@ __glXColorTableParameterfvReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
compsize = __glColorTableParameterfv_size(pname);
|
compsize = __glColorTableParameterfv_size(pname);
|
||||||
return __GLX_PAD((compsize * 4));
|
return safe_pad(safe_mul(compsize, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXColorSubTableReqSize(const GLbyte * pc, Bool swap)
|
__glXColorSubTableReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLint row_length = *(GLint *) (pc + 4);
|
GLint row_length = *(GLint *) (pc + 4);
|
||||||
GLint image_height = 0;
|
GLint image_height = 0;
|
||||||
|
@ -470,7 +468,7 @@ __glXColorSubTableReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXConvolutionFilter1DReqSize(const GLbyte * pc, Bool swap)
|
__glXConvolutionFilter1DReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLint row_length = *(GLint *) (pc + 4);
|
GLint row_length = *(GLint *) (pc + 4);
|
||||||
GLint image_height = 0;
|
GLint image_height = 0;
|
||||||
|
@ -498,7 +496,7 @@ __glXConvolutionFilter1DReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXConvolutionFilter2DReqSize(const GLbyte * pc, Bool swap)
|
__glXConvolutionFilter2DReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLint row_length = *(GLint *) (pc + 4);
|
GLint row_length = *(GLint *) (pc + 4);
|
||||||
GLint image_height = 0;
|
GLint image_height = 0;
|
||||||
|
@ -528,7 +526,7 @@ __glXConvolutionFilter2DReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXConvolutionParameterfvReqSize(const GLbyte * pc, Bool swap)
|
__glXConvolutionParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLenum pname = *(GLenum *) (pc + 4);
|
GLenum pname = *(GLenum *) (pc + 4);
|
||||||
GLsizei compsize;
|
GLsizei compsize;
|
||||||
|
@ -538,11 +536,11 @@ __glXConvolutionParameterfvReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
compsize = __glConvolutionParameterfv_size(pname);
|
compsize = __glConvolutionParameterfv_size(pname);
|
||||||
return __GLX_PAD((compsize * 4));
|
return safe_pad(safe_mul(compsize, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXTexImage3DReqSize(const GLbyte * pc, Bool swap)
|
__glXTexImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLint row_length = *(GLint *) (pc + 4);
|
GLint row_length = *(GLint *) (pc + 4);
|
||||||
GLint image_height = *(GLint *) (pc + 8);
|
GLint image_height = *(GLint *) (pc + 8);
|
||||||
|
@ -579,7 +577,7 @@ __glXTexImage3DReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXTexSubImage3DReqSize(const GLbyte * pc, Bool swap)
|
__glXTexSubImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLint row_length = *(GLint *) (pc + 4);
|
GLint row_length = *(GLint *) (pc + 4);
|
||||||
GLint image_height = *(GLint *) (pc + 8);
|
GLint image_height = *(GLint *) (pc + 8);
|
||||||
|
@ -613,7 +611,7 @@ __glXTexSubImage3DReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXCompressedTexImage1DReqSize(const GLbyte * pc, Bool swap)
|
__glXCompressedTexImage1DReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLsizei imageSize = *(GLsizei *) (pc + 20);
|
GLsizei imageSize = *(GLsizei *) (pc + 20);
|
||||||
|
|
||||||
|
@ -621,11 +619,11 @@ __glXCompressedTexImage1DReqSize(const GLbyte * pc, Bool swap)
|
||||||
imageSize = bswap_32(imageSize);
|
imageSize = bswap_32(imageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __GLX_PAD(imageSize);
|
return safe_pad(imageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXCompressedTexImage2DReqSize(const GLbyte * pc, Bool swap)
|
__glXCompressedTexImage2DReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLsizei imageSize = *(GLsizei *) (pc + 24);
|
GLsizei imageSize = *(GLsizei *) (pc + 24);
|
||||||
|
|
||||||
|
@ -633,11 +631,11 @@ __glXCompressedTexImage2DReqSize(const GLbyte * pc, Bool swap)
|
||||||
imageSize = bswap_32(imageSize);
|
imageSize = bswap_32(imageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __GLX_PAD(imageSize);
|
return safe_pad(imageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXCompressedTexImage3DReqSize(const GLbyte * pc, Bool swap)
|
__glXCompressedTexImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLsizei imageSize = *(GLsizei *) (pc + 28);
|
GLsizei imageSize = *(GLsizei *) (pc + 28);
|
||||||
|
|
||||||
|
@ -645,11 +643,11 @@ __glXCompressedTexImage3DReqSize(const GLbyte * pc, Bool swap)
|
||||||
imageSize = bswap_32(imageSize);
|
imageSize = bswap_32(imageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __GLX_PAD(imageSize);
|
return safe_pad(imageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXCompressedTexSubImage3DReqSize(const GLbyte * pc, Bool swap)
|
__glXCompressedTexSubImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLsizei imageSize = *(GLsizei *) (pc + 36);
|
GLsizei imageSize = *(GLsizei *) (pc + 36);
|
||||||
|
|
||||||
|
@ -657,11 +655,11 @@ __glXCompressedTexSubImage3DReqSize(const GLbyte * pc, Bool swap)
|
||||||
imageSize = bswap_32(imageSize);
|
imageSize = bswap_32(imageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __GLX_PAD(imageSize);
|
return safe_pad(imageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXPointParameterfvReqSize(const GLbyte * pc, Bool swap)
|
__glXPointParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLenum pname = *(GLenum *) (pc + 0);
|
GLenum pname = *(GLenum *) (pc + 0);
|
||||||
GLsizei compsize;
|
GLsizei compsize;
|
||||||
|
@ -671,11 +669,11 @@ __glXPointParameterfvReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
compsize = __glPointParameterfv_size(pname);
|
compsize = __glPointParameterfv_size(pname);
|
||||||
return __GLX_PAD((compsize * 4));
|
return safe_pad(safe_mul(compsize, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXDrawBuffersReqSize(const GLbyte * pc, Bool swap)
|
__glXDrawBuffersReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLsizei n = *(GLsizei *) (pc + 0);
|
GLsizei n = *(GLsizei *) (pc + 0);
|
||||||
|
|
||||||
|
@ -683,11 +681,11 @@ __glXDrawBuffersReqSize(const GLbyte * pc, Bool swap)
|
||||||
n = bswap_32(n);
|
n = bswap_32(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __GLX_PAD((n * 4));
|
return safe_pad(safe_mul(n, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXProgramStringARBReqSize(const GLbyte * pc, Bool swap)
|
__glXProgramStringARBReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLsizei len = *(GLsizei *) (pc + 8);
|
GLsizei len = *(GLsizei *) (pc + 8);
|
||||||
|
|
||||||
|
@ -695,11 +693,11 @@ __glXProgramStringARBReqSize(const GLbyte * pc, Bool swap)
|
||||||
len = bswap_32(len);
|
len = bswap_32(len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __GLX_PAD(len);
|
return safe_pad(len);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXVertexAttribs1dvNVReqSize(const GLbyte * pc, Bool swap)
|
__glXVertexAttribs1dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLsizei n = *(GLsizei *) (pc + 4);
|
GLsizei n = *(GLsizei *) (pc + 4);
|
||||||
|
|
||||||
|
@ -707,11 +705,11 @@ __glXVertexAttribs1dvNVReqSize(const GLbyte * pc, Bool swap)
|
||||||
n = bswap_32(n);
|
n = bswap_32(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __GLX_PAD((n * 8));
|
return safe_pad(safe_mul(n, 8));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXVertexAttribs2dvNVReqSize(const GLbyte * pc, Bool swap)
|
__glXVertexAttribs2dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLsizei n = *(GLsizei *) (pc + 4);
|
GLsizei n = *(GLsizei *) (pc + 4);
|
||||||
|
|
||||||
|
@ -719,11 +717,11 @@ __glXVertexAttribs2dvNVReqSize(const GLbyte * pc, Bool swap)
|
||||||
n = bswap_32(n);
|
n = bswap_32(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __GLX_PAD((n * 16));
|
return safe_pad(safe_mul(n, 16));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXVertexAttribs3dvNVReqSize(const GLbyte * pc, Bool swap)
|
__glXVertexAttribs3dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLsizei n = *(GLsizei *) (pc + 4);
|
GLsizei n = *(GLsizei *) (pc + 4);
|
||||||
|
|
||||||
|
@ -731,11 +729,11 @@ __glXVertexAttribs3dvNVReqSize(const GLbyte * pc, Bool swap)
|
||||||
n = bswap_32(n);
|
n = bswap_32(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __GLX_PAD((n * 24));
|
return safe_pad(safe_mul(n, 24));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXVertexAttribs3fvNVReqSize(const GLbyte * pc, Bool swap)
|
__glXVertexAttribs3fvNVReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLsizei n = *(GLsizei *) (pc + 4);
|
GLsizei n = *(GLsizei *) (pc + 4);
|
||||||
|
|
||||||
|
@ -743,11 +741,11 @@ __glXVertexAttribs3fvNVReqSize(const GLbyte * pc, Bool swap)
|
||||||
n = bswap_32(n);
|
n = bswap_32(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __GLX_PAD((n * 12));
|
return safe_pad(safe_mul(n, 12));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXVertexAttribs3svNVReqSize(const GLbyte * pc, Bool swap)
|
__glXVertexAttribs3svNVReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLsizei n = *(GLsizei *) (pc + 4);
|
GLsizei n = *(GLsizei *) (pc + 4);
|
||||||
|
|
||||||
|
@ -755,11 +753,11 @@ __glXVertexAttribs3svNVReqSize(const GLbyte * pc, Bool swap)
|
||||||
n = bswap_32(n);
|
n = bswap_32(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __GLX_PAD((n * 6));
|
return safe_pad(safe_mul(n, 6));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXVertexAttribs4dvNVReqSize(const GLbyte * pc, Bool swap)
|
__glXVertexAttribs4dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLsizei n = *(GLsizei *) (pc + 4);
|
GLsizei n = *(GLsizei *) (pc + 4);
|
||||||
|
|
||||||
|
@ -767,7 +765,7 @@ __glXVertexAttribs4dvNVReqSize(const GLbyte * pc, Bool swap)
|
||||||
n = bswap_32(n);
|
n = bswap_32(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __GLX_PAD((n * 32));
|
return safe_pad(safe_mul(n, 32));
|
||||||
}
|
}
|
||||||
|
|
||||||
ALIAS(Fogiv, Fogfv)
|
ALIAS(Fogiv, Fogfv)
|
||||||
|
|
|
@ -36,115 +36,156 @@
|
||||||
#define PURE
|
#define PURE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern PURE _X_HIDDEN int __glXCallListsReqSize(const GLbyte * pc, Bool swap);
|
extern PURE _X_HIDDEN int __glXCallListsReqSize(const GLbyte * pc, Bool swap,
|
||||||
extern PURE _X_HIDDEN int __glXBitmapReqSize(const GLbyte * pc, Bool swap);
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXFogfvReqSize(const GLbyte * pc, Bool swap);
|
extern PURE _X_HIDDEN int __glXBitmapReqSize(const GLbyte * pc, Bool swap,
|
||||||
extern PURE _X_HIDDEN int __glXFogivReqSize(const GLbyte * pc, Bool swap);
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXLightfvReqSize(const GLbyte * pc, Bool swap);
|
extern PURE _X_HIDDEN int __glXFogfvReqSize(const GLbyte * pc, Bool swap,
|
||||||
extern PURE _X_HIDDEN int __glXLightivReqSize(const GLbyte * pc, Bool swap);
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXLightModelfvReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXFogivReqSize(const GLbyte * pc, Bool swap,
|
||||||
Bool swap);
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXLightModelivReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXLightfvReqSize(const GLbyte * pc, Bool swap,
|
||||||
Bool swap);
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXMaterialfvReqSize(const GLbyte * pc, Bool swap);
|
extern PURE _X_HIDDEN int __glXLightivReqSize(const GLbyte * pc, Bool swap,
|
||||||
extern PURE _X_HIDDEN int __glXMaterialivReqSize(const GLbyte * pc, Bool swap);
|
int reqlen);
|
||||||
|
extern PURE _X_HIDDEN int __glXLightModelfvReqSize(const GLbyte * pc, Bool swap,
|
||||||
|
int reqlen);
|
||||||
|
extern PURE _X_HIDDEN int __glXLightModelivReqSize(const GLbyte * pc, Bool swap,
|
||||||
|
int reqlen);
|
||||||
|
extern PURE _X_HIDDEN int __glXMaterialfvReqSize(const GLbyte * pc, Bool swap,
|
||||||
|
int reqlen);
|
||||||
|
extern PURE _X_HIDDEN int __glXMaterialivReqSize(const GLbyte * pc, Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXPolygonStippleReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXPolygonStippleReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXTexParameterfvReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXTexParameterfvReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXTexParameterivReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXTexParameterivReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXTexImage1DReqSize(const GLbyte * pc, Bool swap);
|
extern PURE _X_HIDDEN int __glXTexImage1DReqSize(const GLbyte * pc, Bool swap,
|
||||||
extern PURE _X_HIDDEN int __glXTexImage2DReqSize(const GLbyte * pc, Bool swap);
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXTexEnvfvReqSize(const GLbyte * pc, Bool swap);
|
extern PURE _X_HIDDEN int __glXTexImage2DReqSize(const GLbyte * pc, Bool swap,
|
||||||
extern PURE _X_HIDDEN int __glXTexEnvivReqSize(const GLbyte * pc, Bool swap);
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXTexGendvReqSize(const GLbyte * pc, Bool swap);
|
extern PURE _X_HIDDEN int __glXTexEnvfvReqSize(const GLbyte * pc, Bool swap,
|
||||||
extern PURE _X_HIDDEN int __glXTexGenfvReqSize(const GLbyte * pc, Bool swap);
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXTexGenivReqSize(const GLbyte * pc, Bool swap);
|
extern PURE _X_HIDDEN int __glXTexEnvivReqSize(const GLbyte * pc, Bool swap,
|
||||||
extern PURE _X_HIDDEN int __glXMap1dReqSize(const GLbyte * pc, Bool swap);
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXMap1fReqSize(const GLbyte * pc, Bool swap);
|
extern PURE _X_HIDDEN int __glXTexGendvReqSize(const GLbyte * pc, Bool swap,
|
||||||
extern PURE _X_HIDDEN int __glXMap2dReqSize(const GLbyte * pc, Bool swap);
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXMap2fReqSize(const GLbyte * pc, Bool swap);
|
extern PURE _X_HIDDEN int __glXTexGenfvReqSize(const GLbyte * pc, Bool swap,
|
||||||
extern PURE _X_HIDDEN int __glXPixelMapfvReqSize(const GLbyte * pc, Bool swap);
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXPixelMapuivReqSize(const GLbyte * pc, Bool swap);
|
extern PURE _X_HIDDEN int __glXTexGenivReqSize(const GLbyte * pc, Bool swap,
|
||||||
extern PURE _X_HIDDEN int __glXPixelMapusvReqSize(const GLbyte * pc, Bool swap);
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXDrawPixelsReqSize(const GLbyte * pc, Bool swap);
|
extern PURE _X_HIDDEN int __glXMap1dReqSize(const GLbyte * pc, Bool swap,
|
||||||
extern PURE _X_HIDDEN int __glXDrawArraysReqSize(const GLbyte * pc, Bool swap);
|
int reqlen);
|
||||||
|
extern PURE _X_HIDDEN int __glXMap1fReqSize(const GLbyte * pc, Bool swap,
|
||||||
|
int reqlen);
|
||||||
|
extern PURE _X_HIDDEN int __glXMap2dReqSize(const GLbyte * pc, Bool swap,
|
||||||
|
int reqlen);
|
||||||
|
extern PURE _X_HIDDEN int __glXMap2fReqSize(const GLbyte * pc, Bool swap,
|
||||||
|
int reqlen);
|
||||||
|
extern PURE _X_HIDDEN int __glXPixelMapfvReqSize(const GLbyte * pc, Bool swap,
|
||||||
|
int reqlen);
|
||||||
|
extern PURE _X_HIDDEN int __glXPixelMapuivReqSize(const GLbyte * pc, Bool swap,
|
||||||
|
int reqlen);
|
||||||
|
extern PURE _X_HIDDEN int __glXPixelMapusvReqSize(const GLbyte * pc, Bool swap,
|
||||||
|
int reqlen);
|
||||||
|
extern PURE _X_HIDDEN int __glXDrawPixelsReqSize(const GLbyte * pc, Bool swap,
|
||||||
|
int reqlen);
|
||||||
|
extern PURE _X_HIDDEN int __glXDrawArraysReqSize(const GLbyte * pc, Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXPrioritizeTexturesReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXPrioritizeTexturesReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXTexSubImage1DReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXTexSubImage1DReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXTexSubImage2DReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXTexSubImage2DReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXColorTableReqSize(const GLbyte * pc, Bool swap);
|
extern PURE _X_HIDDEN int __glXColorTableReqSize(const GLbyte * pc, Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXColorTableParameterfvReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXColorTableParameterfvReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXColorTableParameterivReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXColorTableParameterivReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXColorSubTableReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXColorSubTableReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXConvolutionFilter1DReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXConvolutionFilter1DReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXConvolutionFilter2DReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXConvolutionFilter2DReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXConvolutionParameterfvReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXConvolutionParameterfvReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXConvolutionParameterivReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXConvolutionParameterivReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXSeparableFilter2DReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXSeparableFilter2DReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXTexImage3DReqSize(const GLbyte * pc, Bool swap);
|
extern PURE _X_HIDDEN int __glXTexImage3DReqSize(const GLbyte * pc, Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXTexSubImage3DReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXTexSubImage3DReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXCompressedTexImage1DReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXCompressedTexImage1DReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXCompressedTexImage2DReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXCompressedTexImage2DReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXCompressedTexImage3DReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXCompressedTexImage3DReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXCompressedTexSubImage1DReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXCompressedTexSubImage1DReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXCompressedTexSubImage2DReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXCompressedTexSubImage2DReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXCompressedTexSubImage3DReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXCompressedTexSubImage3DReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXPointParameterfvReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXPointParameterfvReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXPointParameterivReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXPointParameterivReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXDrawBuffersReqSize(const GLbyte * pc, Bool swap);
|
extern PURE _X_HIDDEN int __glXDrawBuffersReqSize(const GLbyte * pc, Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXProgramStringARBReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXProgramStringARBReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXDeleteFramebuffersReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXDeleteFramebuffersReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXDeleteRenderbuffersReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXDeleteRenderbuffersReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap,
|
||||||
|
int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXVertexAttribs1dvNVReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXVertexAttribs1dvNVReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXVertexAttribs1fvNVReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXVertexAttribs1fvNVReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXVertexAttribs1svNVReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXVertexAttribs1svNVReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXVertexAttribs2dvNVReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXVertexAttribs2dvNVReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXVertexAttribs2fvNVReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXVertexAttribs2fvNVReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXVertexAttribs2svNVReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXVertexAttribs2svNVReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXVertexAttribs3dvNVReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXVertexAttribs3dvNVReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXVertexAttribs3fvNVReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXVertexAttribs3fvNVReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXVertexAttribs3svNVReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXVertexAttribs3svNVReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXVertexAttribs4dvNVReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXVertexAttribs4dvNVReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXVertexAttribs4fvNVReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXVertexAttribs4fvNVReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXVertexAttribs4svNVReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXVertexAttribs4svNVReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap, int reqlen);
|
||||||
extern PURE _X_HIDDEN int __glXVertexAttribs4ubvNVReqSize(const GLbyte * pc,
|
extern PURE _X_HIDDEN int __glXVertexAttribs4ubvNVReqSize(const GLbyte * pc,
|
||||||
Bool swap);
|
Bool swap,
|
||||||
|
int reqlen);
|
||||||
|
|
||||||
#undef PURE
|
#undef PURE
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,8 @@ __glXDisp_GetCompressedTexImage(struct __GLXclientStateRec *cl, GLbyte * pc)
|
||||||
__GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
|
__GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
|
||||||
ClientPtr client = cl->client;
|
ClientPtr client = cl->client;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 8);
|
||||||
|
|
||||||
pc += __GLX_SINGLE_HDR_SIZE;
|
pc += __GLX_SINGLE_HDR_SIZE;
|
||||||
if (cx != NULL) {
|
if (cx != NULL) {
|
||||||
const GLenum target = *(GLenum *) (pc + 0);
|
const GLenum target = *(GLenum *) (pc + 0);
|
||||||
|
@ -87,6 +89,8 @@ __glXDispSwap_GetCompressedTexImage(struct __GLXclientStateRec *cl, GLbyte * pc)
|
||||||
__glXForceCurrent(cl, bswap_32(req->contextTag), &error);
|
__glXForceCurrent(cl, bswap_32(req->contextTag), &error);
|
||||||
ClientPtr client = cl->client;
|
ClientPtr client = cl->client;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 8);
|
||||||
|
|
||||||
pc += __GLX_SINGLE_HDR_SIZE;
|
pc += __GLX_SINGLE_HDR_SIZE;
|
||||||
if (cx != NULL) {
|
if (cx != NULL) {
|
||||||
const GLenum target = (GLenum) bswap_32(*(int *) (pc + 0));
|
const GLenum target = (GLenum) bswap_32(*(int *) (pc + 0));
|
||||||
|
|
|
@ -73,12 +73,17 @@ __glXGetAnswerBuffer(__GLXclientState * cl, size_t required_size,
|
||||||
void *local_buffer, size_t local_size, unsigned alignment)
|
void *local_buffer, size_t local_size, unsigned alignment)
|
||||||
{
|
{
|
||||||
void *buffer = local_buffer;
|
void *buffer = local_buffer;
|
||||||
const unsigned mask = alignment - 1;
|
const intptr_t mask = alignment - 1;
|
||||||
|
|
||||||
if (local_size < required_size) {
|
if (local_size < required_size) {
|
||||||
const size_t worst_case_size = required_size + alignment;
|
size_t worst_case_size;
|
||||||
intptr_t temp_buf;
|
intptr_t temp_buf;
|
||||||
|
|
||||||
|
if (required_size < SIZE_MAX - alignment)
|
||||||
|
worst_case_size = required_size + alignment;
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (cl->returnBufSize < worst_case_size) {
|
if (cl->returnBufSize < worst_case_size) {
|
||||||
void *temp = realloc(cl->returnBuf, worst_case_size);
|
void *temp = realloc(cl->returnBuf, worst_case_size);
|
||||||
|
|
||||||
|
|
114
glx/rensize.c
114
glx/rensize.c
|
@ -43,19 +43,11 @@
|
||||||
(((a & 0xff000000U)>>24) | ((a & 0xff0000U)>>8) | \
|
(((a & 0xff000000U)>>24) | ((a & 0xff0000U)>>8) | \
|
||||||
((a & 0xff00U)<<8) | ((a & 0xffU)<<24))
|
((a & 0xff00U)<<8) | ((a & 0xffU)<<24))
|
||||||
|
|
||||||
static int
|
|
||||||
Map1Size(GLint k, GLint order)
|
|
||||||
{
|
|
||||||
if (order <= 0 || k < 0)
|
|
||||||
return -1;
|
|
||||||
return k * order;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXMap1dReqSize(const GLbyte * pc, Bool swap)
|
__glXMap1dReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLenum target;
|
GLenum target;
|
||||||
GLint order, k;
|
GLint order;
|
||||||
|
|
||||||
target = *(GLenum *) (pc + 16);
|
target = *(GLenum *) (pc + 16);
|
||||||
order = *(GLint *) (pc + 20);
|
order = *(GLint *) (pc + 20);
|
||||||
|
@ -63,15 +55,16 @@ __glXMap1dReqSize(const GLbyte * pc, Bool swap)
|
||||||
target = SWAPL(target);
|
target = SWAPL(target);
|
||||||
order = SWAPL(order);
|
order = SWAPL(order);
|
||||||
}
|
}
|
||||||
k = __glMap1d_size(target);
|
if (order < 1)
|
||||||
return 8 * Map1Size(k, order);
|
return -1;
|
||||||
|
return safe_mul(8, safe_mul(__glMap1d_size(target), order));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXMap1fReqSize(const GLbyte * pc, Bool swap)
|
__glXMap1fReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLenum target;
|
GLenum target;
|
||||||
GLint order, k;
|
GLint order;
|
||||||
|
|
||||||
target = *(GLenum *) (pc + 0);
|
target = *(GLenum *) (pc + 0);
|
||||||
order = *(GLint *) (pc + 12);
|
order = *(GLint *) (pc + 12);
|
||||||
|
@ -79,23 +72,24 @@ __glXMap1fReqSize(const GLbyte * pc, Bool swap)
|
||||||
target = SWAPL(target);
|
target = SWAPL(target);
|
||||||
order = SWAPL(order);
|
order = SWAPL(order);
|
||||||
}
|
}
|
||||||
k = __glMap1f_size(target);
|
if (order < 1)
|
||||||
return 4 * Map1Size(k, order);
|
return -1;
|
||||||
|
return safe_mul(4, safe_mul(__glMap1f_size(target), order));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Map2Size(int k, int majorOrder, int minorOrder)
|
Map2Size(int k, int majorOrder, int minorOrder)
|
||||||
{
|
{
|
||||||
if (majorOrder <= 0 || minorOrder <= 0 || k < 0)
|
if (majorOrder < 1 || minorOrder < 1)
|
||||||
return -1;
|
return -1;
|
||||||
return k * majorOrder * minorOrder;
|
return safe_mul(k, safe_mul(majorOrder, minorOrder));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXMap2dReqSize(const GLbyte * pc, Bool swap)
|
__glXMap2dReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLenum target;
|
GLenum target;
|
||||||
GLint uorder, vorder, k;
|
GLint uorder, vorder;
|
||||||
|
|
||||||
target = *(GLenum *) (pc + 32);
|
target = *(GLenum *) (pc + 32);
|
||||||
uorder = *(GLint *) (pc + 36);
|
uorder = *(GLint *) (pc + 36);
|
||||||
|
@ -105,15 +99,14 @@ __glXMap2dReqSize(const GLbyte * pc, Bool swap)
|
||||||
uorder = SWAPL(uorder);
|
uorder = SWAPL(uorder);
|
||||||
vorder = SWAPL(vorder);
|
vorder = SWAPL(vorder);
|
||||||
}
|
}
|
||||||
k = __glMap2d_size(target);
|
return safe_mul(8, Map2Size(__glMap2d_size(target), uorder, vorder));
|
||||||
return 8 * Map2Size(k, uorder, vorder);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXMap2fReqSize(const GLbyte * pc, Bool swap)
|
__glXMap2fReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
GLenum target;
|
GLenum target;
|
||||||
GLint uorder, vorder, k;
|
GLint uorder, vorder;
|
||||||
|
|
||||||
target = *(GLenum *) (pc + 0);
|
target = *(GLenum *) (pc + 0);
|
||||||
uorder = *(GLint *) (pc + 12);
|
uorder = *(GLint *) (pc + 12);
|
||||||
|
@ -123,8 +116,7 @@ __glXMap2fReqSize(const GLbyte * pc, Bool swap)
|
||||||
uorder = SWAPL(uorder);
|
uorder = SWAPL(uorder);
|
||||||
vorder = SWAPL(vorder);
|
vorder = SWAPL(vorder);
|
||||||
}
|
}
|
||||||
k = __glMap2f_size(target);
|
return safe_mul(4, Map2Size(__glMap2f_size(target), uorder, vorder));
|
||||||
return 4 * Map2Size(k, uorder, vorder);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -175,14 +167,16 @@ __glXImageSize(GLenum format, GLenum type, GLenum target,
|
||||||
GLint bytesPerElement, elementsPerGroup, groupsPerRow;
|
GLint bytesPerElement, elementsPerGroup, groupsPerRow;
|
||||||
GLint groupSize, rowSize, padding, imageSize;
|
GLint groupSize, rowSize, padding, imageSize;
|
||||||
|
|
||||||
|
if (w == 0 || h == 0 || d == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (w < 0 || h < 0 || d < 0 ||
|
if (w < 0 || h < 0 || d < 0 ||
|
||||||
(type == GL_BITMAP &&
|
(type == GL_BITMAP &&
|
||||||
(format != GL_COLOR_INDEX && format != GL_STENCIL_INDEX))) {
|
(format != GL_COLOR_INDEX && format != GL_STENCIL_INDEX))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (w == 0 || h == 0 || d == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
|
/* proxy targets have no data */
|
||||||
switch (target) {
|
switch (target) {
|
||||||
case GL_PROXY_TEXTURE_1D:
|
case GL_PROXY_TEXTURE_1D:
|
||||||
case GL_PROXY_TEXTURE_2D:
|
case GL_PROXY_TEXTURE_2D:
|
||||||
|
@ -199,6 +193,12 @@ __glXImageSize(GLenum format, GLenum type, GLenum target,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* real data has to have real sizes */
|
||||||
|
if (imageHeight < 0 || rowLength < 0 || skipImages < 0 || skipRows < 0)
|
||||||
|
return -1;
|
||||||
|
if (alignment != 1 && alignment != 2 && alignment != 4 && alignment != 8)
|
||||||
|
return -1;
|
||||||
|
|
||||||
if (type == GL_BITMAP) {
|
if (type == GL_BITMAP) {
|
||||||
if (rowLength > 0) {
|
if (rowLength > 0) {
|
||||||
groupsPerRow = rowLength;
|
groupsPerRow = rowLength;
|
||||||
|
@ -207,11 +207,14 @@ __glXImageSize(GLenum format, GLenum type, GLenum target,
|
||||||
groupsPerRow = w;
|
groupsPerRow = w;
|
||||||
}
|
}
|
||||||
rowSize = bits_to_bytes(groupsPerRow);
|
rowSize = bits_to_bytes(groupsPerRow);
|
||||||
|
if (rowSize < 0)
|
||||||
|
return -1;
|
||||||
padding = (rowSize % alignment);
|
padding = (rowSize % alignment);
|
||||||
if (padding) {
|
if (padding) {
|
||||||
rowSize += alignment - padding;
|
rowSize += alignment - padding;
|
||||||
}
|
}
|
||||||
return ((h + skipRows) * rowSize);
|
|
||||||
|
return safe_mul(safe_add(h, skipRows), rowSize);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch (format) {
|
switch (format) {
|
||||||
|
@ -224,6 +227,11 @@ __glXImageSize(GLenum format, GLenum type, GLenum target,
|
||||||
case GL_ALPHA:
|
case GL_ALPHA:
|
||||||
case GL_LUMINANCE:
|
case GL_LUMINANCE:
|
||||||
case GL_INTENSITY:
|
case GL_INTENSITY:
|
||||||
|
case GL_RED_INTEGER_EXT:
|
||||||
|
case GL_GREEN_INTEGER_EXT:
|
||||||
|
case GL_BLUE_INTEGER_EXT:
|
||||||
|
case GL_ALPHA_INTEGER_EXT:
|
||||||
|
case GL_LUMINANCE_INTEGER_EXT:
|
||||||
elementsPerGroup = 1;
|
elementsPerGroup = 1;
|
||||||
break;
|
break;
|
||||||
case GL_422_EXT:
|
case GL_422_EXT:
|
||||||
|
@ -234,14 +242,19 @@ __glXImageSize(GLenum format, GLenum type, GLenum target,
|
||||||
case GL_DEPTH_STENCIL_MESA:
|
case GL_DEPTH_STENCIL_MESA:
|
||||||
case GL_YCBCR_MESA:
|
case GL_YCBCR_MESA:
|
||||||
case GL_LUMINANCE_ALPHA:
|
case GL_LUMINANCE_ALPHA:
|
||||||
|
case GL_LUMINANCE_ALPHA_INTEGER_EXT:
|
||||||
elementsPerGroup = 2;
|
elementsPerGroup = 2;
|
||||||
break;
|
break;
|
||||||
case GL_RGB:
|
case GL_RGB:
|
||||||
case GL_BGR:
|
case GL_BGR:
|
||||||
|
case GL_RGB_INTEGER_EXT:
|
||||||
|
case GL_BGR_INTEGER_EXT:
|
||||||
elementsPerGroup = 3;
|
elementsPerGroup = 3;
|
||||||
break;
|
break;
|
||||||
case GL_RGBA:
|
case GL_RGBA:
|
||||||
case GL_BGRA:
|
case GL_BGRA:
|
||||||
|
case GL_RGBA_INTEGER_EXT:
|
||||||
|
case GL_BGRA_INTEGER_EXT:
|
||||||
case GL_ABGR_EXT:
|
case GL_ABGR_EXT:
|
||||||
elementsPerGroup = 4;
|
elementsPerGroup = 4;
|
||||||
break;
|
break;
|
||||||
|
@ -293,6 +306,7 @@ __glXImageSize(GLenum format, GLenum type, GLenum target,
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
/* known safe by the switches above, not checked */
|
||||||
groupSize = bytesPerElement * elementsPerGroup;
|
groupSize = bytesPerElement * elementsPerGroup;
|
||||||
if (rowLength > 0) {
|
if (rowLength > 0) {
|
||||||
groupsPerRow = rowLength;
|
groupsPerRow = rowLength;
|
||||||
|
@ -300,18 +314,21 @@ __glXImageSize(GLenum format, GLenum type, GLenum target,
|
||||||
else {
|
else {
|
||||||
groupsPerRow = w;
|
groupsPerRow = w;
|
||||||
}
|
}
|
||||||
rowSize = groupsPerRow * groupSize;
|
|
||||||
|
if ((rowSize = safe_mul(groupsPerRow, groupSize)) < 0)
|
||||||
|
return -1;
|
||||||
padding = (rowSize % alignment);
|
padding = (rowSize % alignment);
|
||||||
if (padding) {
|
if (padding) {
|
||||||
rowSize += alignment - padding;
|
rowSize += alignment - padding;
|
||||||
}
|
}
|
||||||
if (imageHeight > 0) {
|
|
||||||
imageSize = (imageHeight + skipRows) * rowSize;
|
if (imageHeight > 0)
|
||||||
}
|
h = imageHeight;
|
||||||
else {
|
h = safe_add(h, skipRows);
|
||||||
imageSize = (h + skipRows) * rowSize;
|
|
||||||
}
|
imageSize = safe_mul(h, rowSize);
|
||||||
return ((d + skipImages) * imageSize);
|
|
||||||
|
return safe_mul(safe_add(d, skipImages), imageSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,13 +359,14 @@ __glXTypeSize(GLenum enm)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXDrawArraysReqSize(const GLbyte * pc, Bool swap)
|
__glXDrawArraysReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
__GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *) pc;
|
__GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *) pc;
|
||||||
__GLXdispatchDrawArraysComponentHeader *compHeader;
|
__GLXdispatchDrawArraysComponentHeader *compHeader;
|
||||||
GLint numVertexes = hdr->numVertexes;
|
GLint numVertexes = hdr->numVertexes;
|
||||||
GLint numComponents = hdr->numComponents;
|
GLint numComponents = hdr->numComponents;
|
||||||
GLint arrayElementSize = 0;
|
GLint arrayElementSize = 0;
|
||||||
|
GLint x, size;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (swap) {
|
if (swap) {
|
||||||
|
@ -357,6 +375,13 @@ __glXDrawArraysReqSize(const GLbyte * pc, Bool swap)
|
||||||
}
|
}
|
||||||
|
|
||||||
pc += sizeof(__GLXdispatchDrawArraysHeader);
|
pc += sizeof(__GLXdispatchDrawArraysHeader);
|
||||||
|
reqlen -= sizeof(__GLXdispatchDrawArraysHeader);
|
||||||
|
|
||||||
|
size = safe_mul(sizeof(__GLXdispatchDrawArraysComponentHeader),
|
||||||
|
numComponents);
|
||||||
|
if (size < 0 || reqlen < 0 || reqlen < size)
|
||||||
|
return -1;
|
||||||
|
|
||||||
compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc;
|
compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc;
|
||||||
|
|
||||||
for (i = 0; i < numComponents; i++) {
|
for (i = 0; i < numComponents; i++) {
|
||||||
|
@ -400,17 +425,18 @@ __glXDrawArraysReqSize(const GLbyte * pc, Bool swap)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
arrayElementSize += __GLX_PAD(numVals * __glXTypeSize(datatype));
|
x = safe_pad(safe_mul(numVals, __glXTypeSize(datatype)));
|
||||||
|
if ((arrayElementSize = safe_add(arrayElementSize, x)) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
pc += sizeof(__GLXdispatchDrawArraysComponentHeader);
|
pc += sizeof(__GLXdispatchDrawArraysComponentHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ((numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader)) +
|
return safe_add(size, safe_mul(numVertexes, arrayElementSize));
|
||||||
(numVertexes * arrayElementSize));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXSeparableFilter2DReqSize(const GLbyte * pc, Bool swap)
|
__glXSeparableFilter2DReqSize(const GLbyte * pc, Bool swap, int reqlen)
|
||||||
{
|
{
|
||||||
__GLXdispatchConvolutionFilterHeader *hdr =
|
__GLXdispatchConvolutionFilterHeader *hdr =
|
||||||
(__GLXdispatchConvolutionFilterHeader *) pc;
|
(__GLXdispatchConvolutionFilterHeader *) pc;
|
||||||
|
@ -435,9 +461,7 @@ __glXSeparableFilter2DReqSize(const GLbyte * pc, Bool swap)
|
||||||
/* XXX Should rowLength be used for either or both image? */
|
/* XXX Should rowLength be used for either or both image? */
|
||||||
image1size = __glXImageSize(format, type, 0, w, 1, 1,
|
image1size = __glXImageSize(format, type, 0, w, 1, 1,
|
||||||
0, rowLength, 0, 0, alignment);
|
0, rowLength, 0, 0, alignment);
|
||||||
image1size = __GLX_PAD(image1size);
|
|
||||||
image2size = __glXImageSize(format, type, 0, h, 1, 1,
|
image2size = __glXImageSize(format, type, 0, h, 1, 1,
|
||||||
0, rowLength, 0, 0, alignment);
|
0, rowLength, 0, 0, alignment);
|
||||||
return image1size + image2size;
|
return safe_add(safe_pad(image1size), image2size);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,11 +45,14 @@
|
||||||
int
|
int
|
||||||
__glXDisp_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
|
__glXDisp_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
|
ClientPtr client = cl->client;
|
||||||
GLsizei size;
|
GLsizei size;
|
||||||
GLenum type;
|
GLenum type;
|
||||||
__GLXcontext *cx;
|
__GLXcontext *cx;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 8);
|
||||||
|
|
||||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||||
if (!cx) {
|
if (!cx) {
|
||||||
return error;
|
return error;
|
||||||
|
@ -76,10 +79,13 @@ __glXDisp_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||||
int
|
int
|
||||||
__glXDisp_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
|
__glXDisp_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
|
ClientPtr client = cl->client;
|
||||||
__GLXcontext *cx;
|
__GLXcontext *cx;
|
||||||
GLsizei size;
|
GLsizei size;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
|
||||||
|
|
||||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||||
if (!cx) {
|
if (!cx) {
|
||||||
return error;
|
return error;
|
||||||
|
@ -104,7 +110,7 @@ __glXDisp_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||||
int
|
int
|
||||||
__glXDisp_RenderMode(__GLXclientState * cl, GLbyte * pc)
|
__glXDisp_RenderMode(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
ClientPtr client;
|
ClientPtr client = cl->client;
|
||||||
xGLXRenderModeReply reply;
|
xGLXRenderModeReply reply;
|
||||||
__GLXcontext *cx;
|
__GLXcontext *cx;
|
||||||
GLint nitems = 0, retBytes = 0, retval, newModeCheck;
|
GLint nitems = 0, retBytes = 0, retval, newModeCheck;
|
||||||
|
@ -112,6 +118,8 @@ __glXDisp_RenderMode(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLenum newMode;
|
GLenum newMode;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
|
||||||
|
|
||||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||||
if (!cx) {
|
if (!cx) {
|
||||||
return error;
|
return error;
|
||||||
|
@ -188,7 +196,6 @@ __glXDisp_RenderMode(__GLXclientState * cl, GLbyte * pc)
|
||||||
** selection array, as per the API for glRenderMode itself.
|
** selection array, as per the API for glRenderMode itself.
|
||||||
*/
|
*/
|
||||||
noChangeAllowed:;
|
noChangeAllowed:;
|
||||||
client = cl->client;
|
|
||||||
reply = (xGLXRenderModeReply) {
|
reply = (xGLXRenderModeReply) {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
@ -207,9 +214,12 @@ __glXDisp_RenderMode(__GLXclientState * cl, GLbyte * pc)
|
||||||
int
|
int
|
||||||
__glXDisp_Flush(__GLXclientState * cl, GLbyte * pc)
|
__glXDisp_Flush(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
|
ClientPtr client = cl->client;
|
||||||
__GLXcontext *cx;
|
__GLXcontext *cx;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xGLXSingleReq);
|
||||||
|
|
||||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||||
if (!cx) {
|
if (!cx) {
|
||||||
return error;
|
return error;
|
||||||
|
@ -223,10 +233,12 @@ __glXDisp_Flush(__GLXclientState * cl, GLbyte * pc)
|
||||||
int
|
int
|
||||||
__glXDisp_Finish(__GLXclientState * cl, GLbyte * pc)
|
__glXDisp_Finish(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
|
ClientPtr client = cl->client;
|
||||||
__GLXcontext *cx;
|
__GLXcontext *cx;
|
||||||
ClientPtr client;
|
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xGLXSingleReq);
|
||||||
|
|
||||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||||
if (!cx) {
|
if (!cx) {
|
||||||
return error;
|
return error;
|
||||||
|
@ -317,7 +329,7 @@ __glXcombine_strings(const char *cext_string, const char *sext_string)
|
||||||
int
|
int
|
||||||
DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap)
|
DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap)
|
||||||
{
|
{
|
||||||
ClientPtr client;
|
ClientPtr client = cl->client;
|
||||||
__GLXcontext *cx;
|
__GLXcontext *cx;
|
||||||
GLenum name;
|
GLenum name;
|
||||||
const char *string;
|
const char *string;
|
||||||
|
@ -327,6 +339,8 @@ DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap)
|
||||||
char *buf = NULL, *buf1 = NULL;
|
char *buf = NULL, *buf1 = NULL;
|
||||||
GLint length = 0;
|
GLint length = 0;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
|
||||||
|
|
||||||
/* If the client has the opposite byte order, swap the contextTag and
|
/* If the client has the opposite byte order, swap the contextTag and
|
||||||
* the name.
|
* the name.
|
||||||
*/
|
*/
|
||||||
|
@ -343,7 +357,6 @@ DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap)
|
||||||
pc += __GLX_SINGLE_HDR_SIZE;
|
pc += __GLX_SINGLE_HDR_SIZE;
|
||||||
name = *(GLenum *) (pc + 0);
|
name = *(GLenum *) (pc + 0);
|
||||||
string = (const char *) glGetString(name);
|
string = (const char *) glGetString(name);
|
||||||
client = cl->client;
|
|
||||||
|
|
||||||
if (string == NULL)
|
if (string == NULL)
|
||||||
string = "";
|
string = "";
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
int
|
int
|
||||||
__glXDispSwap_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
|
ClientPtr client = cl->client;
|
||||||
GLsizei size;
|
GLsizei size;
|
||||||
GLenum type;
|
GLenum type;
|
||||||
|
|
||||||
|
@ -48,6 +49,8 @@ __glXDispSwap_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||||
__GLXcontext *cx;
|
__GLXcontext *cx;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 8);
|
||||||
|
|
||||||
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
|
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
|
||||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||||
if (!cx) {
|
if (!cx) {
|
||||||
|
@ -77,12 +80,15 @@ __glXDispSwap_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||||
int
|
int
|
||||||
__glXDispSwap_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
|
ClientPtr client = cl->client;
|
||||||
__GLXcontext *cx;
|
__GLXcontext *cx;
|
||||||
GLsizei size;
|
GLsizei size;
|
||||||
|
|
||||||
__GLX_DECLARE_SWAP_VARIABLES;
|
__GLX_DECLARE_SWAP_VARIABLES;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
|
||||||
|
|
||||||
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
|
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
|
||||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||||
if (!cx) {
|
if (!cx) {
|
||||||
|
@ -109,7 +115,7 @@ __glXDispSwap_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||||
int
|
int
|
||||||
__glXDispSwap_RenderMode(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_RenderMode(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
ClientPtr client;
|
ClientPtr client = cl->client;
|
||||||
__GLXcontext *cx;
|
__GLXcontext *cx;
|
||||||
xGLXRenderModeReply reply;
|
xGLXRenderModeReply reply;
|
||||||
GLint nitems = 0, retBytes = 0, retval, newModeCheck;
|
GLint nitems = 0, retBytes = 0, retval, newModeCheck;
|
||||||
|
@ -120,6 +126,8 @@ __glXDispSwap_RenderMode(__GLXclientState * cl, GLbyte * pc)
|
||||||
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
|
||||||
|
|
||||||
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
|
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
|
||||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||||
if (!cx) {
|
if (!cx) {
|
||||||
|
@ -200,7 +208,6 @@ __glXDispSwap_RenderMode(__GLXclientState * cl, GLbyte * pc)
|
||||||
** selection array, as per the API for glRenderMode itself.
|
** selection array, as per the API for glRenderMode itself.
|
||||||
*/
|
*/
|
||||||
noChangeAllowed:;
|
noChangeAllowed:;
|
||||||
client = cl->client;
|
|
||||||
reply = (xGLXRenderModeReply) {
|
reply = (xGLXRenderModeReply) {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
@ -224,11 +231,14 @@ __glXDispSwap_RenderMode(__GLXclientState * cl, GLbyte * pc)
|
||||||
int
|
int
|
||||||
__glXDispSwap_Flush(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_Flush(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
|
ClientPtr client = cl->client;
|
||||||
__GLXcontext *cx;
|
__GLXcontext *cx;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
__GLX_DECLARE_SWAP_VARIABLES;
|
__GLX_DECLARE_SWAP_VARIABLES;
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xGLXSingleReq);
|
||||||
|
|
||||||
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
|
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
|
||||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||||
if (!cx) {
|
if (!cx) {
|
||||||
|
@ -243,12 +253,14 @@ __glXDispSwap_Flush(__GLXclientState * cl, GLbyte * pc)
|
||||||
int
|
int
|
||||||
__glXDispSwap_Finish(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_Finish(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
|
ClientPtr client = cl->client;
|
||||||
__GLXcontext *cx;
|
__GLXcontext *cx;
|
||||||
ClientPtr client;
|
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
__GLX_DECLARE_SWAP_VARIABLES;
|
__GLX_DECLARE_SWAP_VARIABLES;
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xGLXSingleReq);
|
||||||
|
|
||||||
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
|
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
|
||||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||||
if (!cx) {
|
if (!cx) {
|
||||||
|
@ -260,7 +272,6 @@ __glXDispSwap_Finish(__GLXclientState * cl, GLbyte * pc)
|
||||||
cx->hasUnflushedCommands = GL_FALSE;
|
cx->hasUnflushedCommands = GL_FALSE;
|
||||||
|
|
||||||
/* Send empty reply packet to indicate finish is finished */
|
/* Send empty reply packet to indicate finish is finished */
|
||||||
client = cl->client;
|
|
||||||
__GLX_BEGIN_REPLY(0);
|
__GLX_BEGIN_REPLY(0);
|
||||||
__GLX_PUT_RETVAL(0);
|
__GLX_PUT_RETVAL(0);
|
||||||
__GLX_SWAP_REPLY_HEADER();
|
__GLX_SWAP_REPLY_HEADER();
|
||||||
|
|
|
@ -51,6 +51,8 @@ __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc)
|
||||||
int error;
|
int error;
|
||||||
char *answer, answerBuffer[200];
|
char *answer, answerBuffer[200];
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 28);
|
||||||
|
|
||||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||||
if (!cx) {
|
if (!cx) {
|
||||||
return error;
|
return error;
|
||||||
|
@ -65,7 +67,7 @@ __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc)
|
||||||
lsbFirst = *(GLboolean *) (pc + 25);
|
lsbFirst = *(GLboolean *) (pc + 25);
|
||||||
compsize = __glReadPixels_size(format, type, width, height);
|
compsize = __glReadPixels_size(format, type, width, height);
|
||||||
if (compsize < 0)
|
if (compsize < 0)
|
||||||
compsize = 0;
|
return BadLength;
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
||||||
glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
|
glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
|
||||||
|
@ -100,6 +102,8 @@ __glXDisp_GetTexImage(__GLXclientState * cl, GLbyte * pc)
|
||||||
char *answer, answerBuffer[200];
|
char *answer, answerBuffer[200];
|
||||||
GLint width = 0, height = 0, depth = 1;
|
GLint width = 0, height = 0, depth = 1;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 20);
|
||||||
|
|
||||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||||
if (!cx) {
|
if (!cx) {
|
||||||
return error;
|
return error;
|
||||||
|
@ -124,7 +128,7 @@ __glXDisp_GetTexImage(__GLXclientState * cl, GLbyte * pc)
|
||||||
compsize =
|
compsize =
|
||||||
__glGetTexImage_size(target, level, format, type, width, height, depth);
|
__glGetTexImage_size(target, level, format, type, width, height, depth);
|
||||||
if (compsize < 0)
|
if (compsize < 0)
|
||||||
compsize = 0;
|
return BadLength;
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
||||||
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
||||||
|
@ -157,6 +161,8 @@ __glXDisp_GetPolygonStipple(__GLXclientState * cl, GLbyte * pc)
|
||||||
GLubyte answerBuffer[200];
|
GLubyte answerBuffer[200];
|
||||||
char *answer;
|
char *answer;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
|
||||||
|
|
||||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||||
if (!cx) {
|
if (!cx) {
|
||||||
return error;
|
return error;
|
||||||
|
@ -217,15 +223,13 @@ GetSeparableFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
|
||||||
compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
|
compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
|
||||||
compsize2 = __glGetTexImage_size(target, 1, format, type, height, 1, 1);
|
compsize2 = __glGetTexImage_size(target, 1, format, type, height, 1, 1);
|
||||||
|
|
||||||
if (compsize < 0)
|
if ((compsize = safe_pad(compsize)) < 0)
|
||||||
compsize = 0;
|
return BadLength;
|
||||||
if (compsize2 < 0)
|
if ((compsize2 = safe_pad(compsize2)) < 0)
|
||||||
compsize2 = 0;
|
return BadLength;
|
||||||
compsize = __GLX_PAD(compsize);
|
|
||||||
compsize2 = __GLX_PAD(compsize2);
|
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
||||||
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize + compsize2, 1);
|
__GLX_GET_ANSWER_BUFFER(answer, cl, safe_add(compsize, compsize2), 1);
|
||||||
__glXClearErrorOccured();
|
__glXClearErrorOccured();
|
||||||
glGetSeparableFilter(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4),
|
glGetSeparableFilter(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4),
|
||||||
*(GLenum *) (pc + 8), answer, answer + compsize, NULL);
|
*(GLenum *) (pc + 8), answer, answer + compsize, NULL);
|
||||||
|
@ -249,7 +253,8 @@ int
|
||||||
__glXDisp_GetSeparableFilter(__GLXclientState * cl, GLbyte * pc)
|
__glXDisp_GetSeparableFilter(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||||
return GetSeparableFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
return GetSeparableFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,7 +262,8 @@ int
|
||||||
__glXDisp_GetSeparableFilterEXT(__GLXclientState * cl, GLbyte * pc)
|
__glXDisp_GetSeparableFilterEXT(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
|
||||||
return GetSeparableFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
return GetSeparableFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,7 +302,7 @@ GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
|
||||||
*/
|
*/
|
||||||
compsize = __glGetTexImage_size(target, 1, format, type, width, height, 1);
|
compsize = __glGetTexImage_size(target, 1, format, type, width, height, 1);
|
||||||
if (compsize < 0)
|
if (compsize < 0)
|
||||||
compsize = 0;
|
return BadLength;
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
||||||
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
||||||
|
@ -323,7 +329,8 @@ int
|
||||||
__glXDisp_GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc)
|
__glXDisp_GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||||
return GetConvolutionFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
return GetConvolutionFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -331,7 +338,8 @@ int
|
||||||
__glXDisp_GetConvolutionFilterEXT(__GLXclientState * cl, GLbyte * pc)
|
__glXDisp_GetConvolutionFilterEXT(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
|
||||||
return GetConvolutionFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
return GetConvolutionFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,7 +373,7 @@ GetHistogram(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
|
||||||
*/
|
*/
|
||||||
compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
|
compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
|
||||||
if (compsize < 0)
|
if (compsize < 0)
|
||||||
compsize = 0;
|
return BadLength;
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
||||||
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
||||||
|
@ -390,7 +398,8 @@ int
|
||||||
__glXDisp_GetHistogram(__GLXclientState * cl, GLbyte * pc)
|
__glXDisp_GetHistogram(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||||
return GetHistogram(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
return GetHistogram(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,7 +407,8 @@ int
|
||||||
__glXDisp_GetHistogramEXT(__GLXclientState * cl, GLbyte * pc)
|
__glXDisp_GetHistogramEXT(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
|
||||||
return GetHistogram(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
return GetHistogram(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -426,7 +436,7 @@ GetMinmax(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
|
||||||
|
|
||||||
compsize = __glGetTexImage_size(target, 1, format, type, 2, 1, 1);
|
compsize = __glGetTexImage_size(target, 1, format, type, 2, 1, 1);
|
||||||
if (compsize < 0)
|
if (compsize < 0)
|
||||||
compsize = 0;
|
return BadLength;
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
||||||
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
||||||
|
@ -450,7 +460,8 @@ int
|
||||||
__glXDisp_GetMinmax(__GLXclientState * cl, GLbyte * pc)
|
__glXDisp_GetMinmax(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||||
return GetMinmax(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
return GetMinmax(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -458,7 +469,8 @@ int
|
||||||
__glXDisp_GetMinmaxEXT(__GLXclientState * cl, GLbyte * pc)
|
__glXDisp_GetMinmaxEXT(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
|
||||||
return GetMinmax(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
return GetMinmax(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -491,7 +503,7 @@ GetColorTable(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
|
||||||
*/
|
*/
|
||||||
compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
|
compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
|
||||||
if (compsize < 0)
|
if (compsize < 0)
|
||||||
compsize = 0;
|
return BadLength;
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
||||||
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
||||||
|
@ -517,7 +529,8 @@ int
|
||||||
__glXDisp_GetColorTable(__GLXclientState * cl, GLbyte * pc)
|
__glXDisp_GetColorTable(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||||
return GetColorTable(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
return GetColorTable(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,6 +538,7 @@ int
|
||||||
__glXDisp_GetColorTableSGI(__GLXclientState * cl, GLbyte * pc)
|
__glXDisp_GetColorTableSGI(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
|
||||||
return GetColorTable(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
return GetColorTable(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,8 @@ __glXDispSwap_ReadPixels(__GLXclientState * cl, GLbyte * pc)
|
||||||
int error;
|
int error;
|
||||||
char *answer, answerBuffer[200];
|
char *answer, answerBuffer[200];
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 28);
|
||||||
|
|
||||||
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
|
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
|
||||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||||
if (!cx) {
|
if (!cx) {
|
||||||
|
@ -75,7 +77,7 @@ __glXDispSwap_ReadPixels(__GLXclientState * cl, GLbyte * pc)
|
||||||
lsbFirst = *(GLboolean *) (pc + 25);
|
lsbFirst = *(GLboolean *) (pc + 25);
|
||||||
compsize = __glReadPixels_size(format, type, width, height);
|
compsize = __glReadPixels_size(format, type, width, height);
|
||||||
if (compsize < 0)
|
if (compsize < 0)
|
||||||
compsize = 0;
|
return BadLength;
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
||||||
glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
|
glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
|
||||||
|
@ -114,6 +116,8 @@ __glXDispSwap_GetTexImage(__GLXclientState * cl, GLbyte * pc)
|
||||||
char *answer, answerBuffer[200];
|
char *answer, answerBuffer[200];
|
||||||
GLint width = 0, height = 0, depth = 1;
|
GLint width = 0, height = 0, depth = 1;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 20);
|
||||||
|
|
||||||
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
|
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
|
||||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||||
if (!cx) {
|
if (!cx) {
|
||||||
|
@ -144,7 +148,7 @@ __glXDispSwap_GetTexImage(__GLXclientState * cl, GLbyte * pc)
|
||||||
compsize =
|
compsize =
|
||||||
__glGetTexImage_size(target, level, format, type, width, height, depth);
|
__glGetTexImage_size(target, level, format, type, width, height, depth);
|
||||||
if (compsize < 0)
|
if (compsize < 0)
|
||||||
compsize = 0;
|
return BadLength;
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
||||||
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
||||||
|
@ -184,6 +188,8 @@ __glXDispSwap_GetPolygonStipple(__GLXclientState * cl, GLbyte * pc)
|
||||||
|
|
||||||
__GLX_DECLARE_SWAP_VARIABLES;
|
__GLX_DECLARE_SWAP_VARIABLES;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
|
||||||
|
|
||||||
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
|
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
|
||||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||||
if (!cx) {
|
if (!cx) {
|
||||||
|
@ -251,15 +257,13 @@ GetSeparableFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
|
||||||
compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
|
compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
|
||||||
compsize2 = __glGetTexImage_size(target, 1, format, type, height, 1, 1);
|
compsize2 = __glGetTexImage_size(target, 1, format, type, height, 1, 1);
|
||||||
|
|
||||||
if (compsize < 0)
|
if ((compsize = safe_pad(compsize)) < 0)
|
||||||
compsize = 0;
|
return BadLength;
|
||||||
if (compsize2 < 0)
|
if ((compsize2 = safe_pad(compsize2)) < 0)
|
||||||
compsize2 = 0;
|
return BadLength;
|
||||||
compsize = __GLX_PAD(compsize);
|
|
||||||
compsize2 = __GLX_PAD(compsize2);
|
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
||||||
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize + compsize2, 1);
|
__GLX_GET_ANSWER_BUFFER(answer, cl, safe_add(compsize, compsize2), 1);
|
||||||
__glXClearErrorOccured();
|
__glXClearErrorOccured();
|
||||||
glGetSeparableFilter(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4),
|
glGetSeparableFilter(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4),
|
||||||
*(GLenum *) (pc + 8), answer, answer + compsize, NULL);
|
*(GLenum *) (pc + 8), answer, answer + compsize, NULL);
|
||||||
|
@ -285,7 +289,9 @@ int
|
||||||
__glXDispSwap_GetSeparableFilter(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_GetSeparableFilter(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||||
return GetSeparableFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
return GetSeparableFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,7 +299,9 @@ int
|
||||||
__glXDispSwap_GetSeparableFilterEXT(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_GetSeparableFilterEXT(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
|
||||||
return GetSeparableFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
return GetSeparableFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,7 +346,7 @@ GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
|
||||||
*/
|
*/
|
||||||
compsize = __glGetTexImage_size(target, 1, format, type, width, height, 1);
|
compsize = __glGetTexImage_size(target, 1, format, type, width, height, 1);
|
||||||
if (compsize < 0)
|
if (compsize < 0)
|
||||||
compsize = 0;
|
return BadLength;
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
||||||
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
||||||
|
@ -367,7 +375,9 @@ int
|
||||||
__glXDispSwap_GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||||
return GetConvolutionFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
return GetConvolutionFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -375,7 +385,9 @@ int
|
||||||
__glXDispSwap_GetConvolutionFilterEXT(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_GetConvolutionFilterEXT(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
|
||||||
return GetConvolutionFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
return GetConvolutionFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -415,7 +427,7 @@ GetHistogram(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
|
||||||
*/
|
*/
|
||||||
compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
|
compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
|
||||||
if (compsize < 0)
|
if (compsize < 0)
|
||||||
compsize = 0;
|
return BadLength;
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
||||||
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
||||||
|
@ -441,7 +453,9 @@ int
|
||||||
__glXDispSwap_GetHistogram(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_GetHistogram(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||||
return GetHistogram(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
return GetHistogram(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,7 +463,9 @@ int
|
||||||
__glXDispSwap_GetHistogramEXT(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_GetHistogramEXT(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
|
||||||
return GetHistogram(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
return GetHistogram(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -483,7 +499,7 @@ GetMinmax(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
|
||||||
|
|
||||||
compsize = __glGetTexImage_size(target, 1, format, type, 2, 1, 1);
|
compsize = __glGetTexImage_size(target, 1, format, type, 2, 1, 1);
|
||||||
if (compsize < 0)
|
if (compsize < 0)
|
||||||
compsize = 0;
|
return BadLength;
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
||||||
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
||||||
|
@ -507,7 +523,9 @@ int
|
||||||
__glXDispSwap_GetMinmax(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_GetMinmax(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||||
return GetMinmax(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
return GetMinmax(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -515,7 +533,9 @@ int
|
||||||
__glXDispSwap_GetMinmaxEXT(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_GetMinmaxEXT(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
|
||||||
return GetMinmax(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
return GetMinmax(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -554,7 +574,7 @@ GetColorTable(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
|
||||||
*/
|
*/
|
||||||
compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
|
compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1);
|
||||||
if (compsize < 0)
|
if (compsize < 0)
|
||||||
compsize = 0;
|
return BadLength;
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
||||||
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
||||||
|
@ -581,7 +601,9 @@ int
|
||||||
__glXDispSwap_GetColorTable(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_GetColorTable(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||||
return GetColorTable(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
return GetColorTable(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -589,6 +611,8 @@ int
|
||||||
__glXDispSwap_GetColorTableSGI(__GLXclientState * cl, GLbyte * pc)
|
__glXDispSwap_GetColorTableSGI(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
|
||||||
|
ClientPtr client = cl->client;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
|
||||||
return GetColorTable(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
return GetColorTable(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,8 @@ DoSwapInterval(__GLXclientState * cl, GLbyte * pc, int do_swap)
|
||||||
__GLXcontext *cx;
|
__GLXcontext *cx;
|
||||||
GLint interval;
|
GLint interval;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 4);
|
||||||
|
|
||||||
cx = __glXLookupContextByTag(cl, tag);
|
cx = __glXLookupContextByTag(cl, tag);
|
||||||
|
|
||||||
if ((cx == NULL) || (cx->pGlxScreen == NULL)) {
|
if ((cx == NULL) || (cx->pGlxScreen == NULL)) {
|
||||||
|
|
|
@ -83,7 +83,8 @@ extern xGLXSingleReply __glXReply;
|
||||||
** pointer.
|
** pointer.
|
||||||
*/
|
*/
|
||||||
#define __GLX_GET_ANSWER_BUFFER(res,cl,size,align) \
|
#define __GLX_GET_ANSWER_BUFFER(res,cl,size,align) \
|
||||||
if ((size) > sizeof(answerBuffer)) { \
|
if (size < 0) return BadLength; \
|
||||||
|
else if ((size) > sizeof(answerBuffer)) { \
|
||||||
int bump; \
|
int bump; \
|
||||||
if ((cl)->returnBufSize < (size)+(align)) { \
|
if ((cl)->returnBufSize < (size)+(align)) { \
|
||||||
(cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, \
|
(cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, \
|
||||||
|
|
|
@ -210,6 +210,9 @@ xf86BusProbe(void)
|
||||||
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
|
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
|
||||||
xf86SbusProbe();
|
xf86SbusProbe();
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef XSERVER_PLATFORM_BUS
|
||||||
|
xf86platformPrimary();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -476,10 +476,9 @@ xf86platformProbeDev(DriverPtr drvp)
|
||||||
/* for non-seat0 servers assume first device is the master */
|
/* for non-seat0 servers assume first device is the master */
|
||||||
if (ServerIsNotSeat0())
|
if (ServerIsNotSeat0())
|
||||||
break;
|
break;
|
||||||
if (xf86_platform_devices[j].pdev) {
|
|
||||||
if (xf86IsPrimaryPlatform(&xf86_platform_devices[j]))
|
if (xf86IsPrimaryPlatform(&xf86_platform_devices[j]))
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -635,4 +634,21 @@ void xf86platformVTProbe(void)
|
||||||
xf86PlatformReprobeDevice(i, xf86_platform_devices[i].attribs);
|
xf86PlatformReprobeDevice(i, xf86_platform_devices[i].attribs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void xf86platformPrimary(void)
|
||||||
|
{
|
||||||
|
/* use the first platform device as a fallback */
|
||||||
|
if (primaryBus.type == BUS_NONE) {
|
||||||
|
xf86Msg(X_INFO, "no primary bus or device found\n");
|
||||||
|
|
||||||
|
if (xf86_num_platform_devices > 0) {
|
||||||
|
char *syspath = xf86_get_platform_attrib(0, ODEV_ATTRIB_SYSPATH);
|
||||||
|
|
||||||
|
primaryBus.id.plat = &xf86_platform_devices[0];
|
||||||
|
primaryBus.type = BUS_PLATFORM;
|
||||||
|
|
||||||
|
xf86Msg(X_NONE, "\tfalling back to %s\n", syspath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -77,6 +77,7 @@ extern _X_EXPORT int
|
||||||
xf86PlatformMatchDriver(char *matches[], int nmatches);
|
xf86PlatformMatchDriver(char *matches[], int nmatches);
|
||||||
|
|
||||||
extern void xf86platformVTProbe(void);
|
extern void xf86platformVTProbe(void);
|
||||||
|
extern void xf86platformPrimary(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -156,6 +156,9 @@ GetScreenPrime(ScreenPtr master, int prime_id)
|
||||||
DRI2ScreenPtr ds;
|
DRI2ScreenPtr ds;
|
||||||
|
|
||||||
ds = DRI2GetScreen(slave);
|
ds = DRI2GetScreen(slave);
|
||||||
|
if (ds == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (ds->prime_id == prime_id)
|
if (ds->prime_id == prime_id)
|
||||||
return slave;
|
return slave;
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,6 +270,9 @@ ProcDRI2GetBuffers(ClientPtr client)
|
||||||
unsigned int *attachments;
|
unsigned int *attachments;
|
||||||
|
|
||||||
REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * 4);
|
REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * 4);
|
||||||
|
if (stuff->count > (INT_MAX / 4))
|
||||||
|
return BadLength;
|
||||||
|
|
||||||
if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess,
|
if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess,
|
||||||
&pDrawable, &status))
|
&pDrawable, &status))
|
||||||
return status;
|
return status;
|
||||||
|
|
|
@ -169,14 +169,25 @@ displayScreenBounds(CGDirectDisplayID id)
|
||||||
(int)frame.size.width, (int)frame.size.height,
|
(int)frame.size.width, (int)frame.size.height,
|
||||||
(int)frame.origin.x, (int)frame.origin.y);
|
(int)frame.origin.x, (int)frame.origin.y);
|
||||||
|
|
||||||
/* Remove menubar to help standard X11 window managers.
|
Boolean spacePerDisplay = false;
|
||||||
* On Mavericks and later, the menu bar is on all displays.
|
|
||||||
*/
|
|
||||||
if (XQuartzIsRootless
|
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
|
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
|
||||||
&& (NSAppKitVersionNumber >= 1265 || (frame.origin.x == 0 && frame.origin.y == 0))
|
if (NSAppKitVersionNumber >= 1265)
|
||||||
#endif
|
#endif
|
||||||
) {
|
{
|
||||||
|
Boolean ok;
|
||||||
|
(void)CFPreferencesAppSynchronize(CFSTR("com.apple.spaces"));
|
||||||
|
spacePerDisplay = ! CFPreferencesGetAppBooleanValue(CFSTR("spans-displays"),
|
||||||
|
CFSTR("com.apple.spaces"),
|
||||||
|
&ok);
|
||||||
|
if (!ok)
|
||||||
|
spacePerDisplay = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Remove menubar to help standard X11 window managers.
|
||||||
|
* On Mavericks and later, the menu bar is on all displays when spans-displays is false or unset.
|
||||||
|
*/
|
||||||
|
if (XQuartzIsRootless &&
|
||||||
|
(spacePerDisplay || (frame.origin.x == 0 && frame.origin.y == 0))) {
|
||||||
frame.origin.y += aquaMenuBarHeight;
|
frame.origin.y += aquaMenuBarHeight;
|
||||||
frame.size.height -= aquaMenuBarHeight;
|
frame.size.height -= aquaMenuBarHeight;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,8 +39,6 @@ nodist_Xwayland_SOURCES = \
|
||||||
|
|
||||||
CLEANFILES = $(nodist_Xwayland_SOURCES)
|
CLEANFILES = $(nodist_Xwayland_SOURCES)
|
||||||
|
|
||||||
EXTRA_DIST = drm.xml
|
|
||||||
|
|
||||||
xwayland-glamor.c : $(nodist_Xwayland_SOURCES)
|
xwayland-glamor.c : $(nodist_Xwayland_SOURCES)
|
||||||
|
|
||||||
glamor_lib = $(top_builddir)/glamor/libglamor.la
|
glamor_lib = $(top_builddir)/glamor/libglamor.la
|
||||||
|
@ -48,6 +46,8 @@ glamor_lib = $(top_builddir)/glamor/libglamor.la
|
||||||
Xwayland_LDADD += $(GLAMOR_LIBS) $(GBM_LIBS) -lEGL -lGL
|
Xwayland_LDADD += $(GLAMOR_LIBS) $(GBM_LIBS) -lEGL -lGL
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
EXTRA_DIST = drm.xml
|
||||||
|
|
||||||
|
|
||||||
relink:
|
relink:
|
||||||
$(AM_V_at)rm -f Xwayland$(EXEEXT) && $(MAKE) Xwayland$(EXEEXT)
|
$(AM_V_at)rm -f Xwayland$(EXEEXT) && $(MAKE) Xwayland$(EXEEXT)
|
||||||
|
|
|
@ -74,9 +74,14 @@ SOFTWARE.
|
||||||
if ((sizeof(req) >> 2) > client->req_len )\
|
if ((sizeof(req) >> 2) > client->req_len )\
|
||||||
return(BadLength)
|
return(BadLength)
|
||||||
|
|
||||||
|
#define REQUEST_AT_LEAST_EXTRA_SIZE(req, extra) \
|
||||||
|
if (((sizeof(req) + ((uint64_t) extra)) >> 2) > client->req_len ) \
|
||||||
|
return(BadLength)
|
||||||
|
|
||||||
#define REQUEST_FIXED_SIZE(req, n)\
|
#define REQUEST_FIXED_SIZE(req, n)\
|
||||||
if (((sizeof(req) >> 2) > client->req_len) || \
|
if (((sizeof(req) >> 2) > client->req_len) || \
|
||||||
(((sizeof(req) + (n) + 3) >> 2) != client->req_len)) \
|
(((n) >> 2) >= client->req_len) || \
|
||||||
|
((((uint64_t) sizeof(req) + (n) + 3) >> 2) != (uint64_t) client->req_len)) \
|
||||||
return(BadLength)
|
return(BadLength)
|
||||||
|
|
||||||
#define LEGAL_NEW_RESOURCE(id,client)\
|
#define LEGAL_NEW_RESOURCE(id,client)\
|
||||||
|
|
|
@ -127,7 +127,10 @@ RegionEnd(RegionPtr reg)
|
||||||
static inline size_t
|
static inline size_t
|
||||||
RegionSizeof(int n)
|
RegionSizeof(int n)
|
||||||
{
|
{
|
||||||
return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec)));
|
if (n < ((INT_MAX - sizeof(RegDataRec)) / sizeof(BoxRec)))
|
||||||
|
return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec)));
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
@ -138,9 +141,10 @@ RegionInit(RegionPtr _pReg, BoxPtr _rect, int _size)
|
||||||
(_pReg)->data = (RegDataPtr) NULL;
|
(_pReg)->data = (RegDataPtr) NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
size_t rgnSize;
|
||||||
(_pReg)->extents = RegionEmptyBox;
|
(_pReg)->extents = RegionEmptyBox;
|
||||||
if (((_size) > 1) && ((_pReg)->data =
|
if (((_size) > 1) && ((rgnSize = RegionSizeof(_size)) > 0) &&
|
||||||
(RegDataPtr) malloc(RegionSizeof(_size)))) {
|
(((_pReg)->data = (RegDataPtr) malloc(rgnSize)) != NULL)) {
|
||||||
(_pReg)->data->size = (_size);
|
(_pReg)->data->size = (_size);
|
||||||
(_pReg)->data->numRects = 0;
|
(_pReg)->data->numRects = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,6 +181,16 @@ prints a usage message.
|
||||||
.B \-I
|
.B \-I
|
||||||
causes all remaining command line arguments to be ignored.
|
causes all remaining command line arguments to be ignored.
|
||||||
.TP 8
|
.TP 8
|
||||||
|
.B \-iglx
|
||||||
|
Prohibit creating indirect GLX contexts. Indirect GLX is of limited use,
|
||||||
|
since it lacks support for many modern OpenGL features and extensions;
|
||||||
|
it's slower than direct contexts; and it opens a large attack surface for
|
||||||
|
protocol parsing errors.
|
||||||
|
.TP 8
|
||||||
|
.B +iglx
|
||||||
|
Allow creating indirect GLX contexts.
|
||||||
|
This is the default unless \-iglx is specified.
|
||||||
|
.TP 8
|
||||||
.B \-maxbigreqsize \fIsize\fP
|
.B \-maxbigreqsize \fIsize\fP
|
||||||
sets the maximum big request to
|
sets the maximum big request to
|
||||||
.I size
|
.I size
|
||||||
|
|
|
@ -516,7 +516,7 @@ mieqProcessDeviceEvent(DeviceIntPtr dev, InternalEvent *event, ScreenPtr screen)
|
||||||
verify_internal_event(event);
|
verify_internal_event(event);
|
||||||
|
|
||||||
/* refuse events from disabled devices */
|
/* refuse events from disabled devices */
|
||||||
if (!dev->enabled)
|
if (dev && !dev->enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Custom event handler */
|
/* Custom event handler */
|
||||||
|
|
41
os/WaitFor.c
41
os/WaitFor.c
|
@ -121,9 +121,9 @@ struct _OsTimerRec {
|
||||||
void *arg;
|
void *arg;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev);
|
static void DoTimer(OsTimerPtr timer, CARD32 now, volatile OsTimerPtr *prev);
|
||||||
static void CheckAllTimers(void);
|
static void CheckAllTimers(void);
|
||||||
static OsTimerPtr timers = NULL;
|
static volatile OsTimerPtr timers = NULL;
|
||||||
|
|
||||||
/*****************
|
/*****************
|
||||||
* WaitForSomething:
|
* WaitForSomething:
|
||||||
|
@ -263,11 +263,14 @@ WaitForSomething(int *pClientsReady)
|
||||||
if ((int) (timers->expires - now) <= 0)
|
if ((int) (timers->expires - now) <= 0)
|
||||||
expired = 1;
|
expired = 1;
|
||||||
|
|
||||||
while (timers && (int) (timers->expires - now) <= 0)
|
if (expired) {
|
||||||
DoTimer(timers, now, &timers);
|
OsBlockSignals();
|
||||||
|
while (timers && (int) (timers->expires - now) <= 0)
|
||||||
|
DoTimer(timers, now, &timers);
|
||||||
|
OsReleaseSignals();
|
||||||
|
|
||||||
if (expired)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -281,11 +284,14 @@ WaitForSomething(int *pClientsReady)
|
||||||
if ((int) (timers->expires - now) <= 0)
|
if ((int) (timers->expires - now) <= 0)
|
||||||
expired = 1;
|
expired = 1;
|
||||||
|
|
||||||
while (timers && (int) (timers->expires - now) <= 0)
|
if (expired) {
|
||||||
DoTimer(timers, now, &timers);
|
OsBlockSignals();
|
||||||
|
while (timers && (int) (timers->expires - now) <= 0)
|
||||||
|
DoTimer(timers, now, &timers);
|
||||||
|
OsReleaseSignals();
|
||||||
|
|
||||||
if (expired)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (someReady)
|
if (someReady)
|
||||||
|
@ -401,24 +407,25 @@ CheckAllTimers(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev)
|
DoTimer(OsTimerPtr timer, CARD32 now, volatile OsTimerPtr *prev)
|
||||||
{
|
{
|
||||||
CARD32 newTime;
|
CARD32 newTime;
|
||||||
|
|
||||||
OsBlockSignals();
|
OsBlockSignals();
|
||||||
*prev = timer->next;
|
*prev = timer->next;
|
||||||
timer->next = NULL;
|
timer->next = NULL;
|
||||||
|
OsReleaseSignals();
|
||||||
|
|
||||||
newTime = (*timer->callback) (timer, now, timer->arg);
|
newTime = (*timer->callback) (timer, now, timer->arg);
|
||||||
if (newTime)
|
if (newTime)
|
||||||
TimerSet(timer, 0, newTime, timer->callback, timer->arg);
|
TimerSet(timer, 0, newTime, timer->callback, timer->arg);
|
||||||
OsReleaseSignals();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OsTimerPtr
|
OsTimerPtr
|
||||||
TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
|
TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
|
||||||
OsTimerCallback func, void *arg)
|
OsTimerCallback func, void *arg)
|
||||||
{
|
{
|
||||||
register OsTimerPtr *prev;
|
volatile OsTimerPtr *prev;
|
||||||
CARD32 now = GetTimeInMillis();
|
CARD32 now = GetTimeInMillis();
|
||||||
|
|
||||||
if (!timer) {
|
if (!timer) {
|
||||||
|
@ -470,7 +477,7 @@ Bool
|
||||||
TimerForce(OsTimerPtr timer)
|
TimerForce(OsTimerPtr timer)
|
||||||
{
|
{
|
||||||
int rc = FALSE;
|
int rc = FALSE;
|
||||||
OsTimerPtr *prev;
|
volatile OsTimerPtr *prev;
|
||||||
|
|
||||||
OsBlockSignals();
|
OsBlockSignals();
|
||||||
for (prev = &timers; *prev; prev = &(*prev)->next) {
|
for (prev = &timers; *prev; prev = &(*prev)->next) {
|
||||||
|
@ -487,7 +494,7 @@ TimerForce(OsTimerPtr timer)
|
||||||
void
|
void
|
||||||
TimerCancel(OsTimerPtr timer)
|
TimerCancel(OsTimerPtr timer)
|
||||||
{
|
{
|
||||||
OsTimerPtr *prev;
|
volatile OsTimerPtr *prev;
|
||||||
|
|
||||||
if (!timer)
|
if (!timer)
|
||||||
return;
|
return;
|
||||||
|
@ -515,8 +522,12 @@ TimerCheck(void)
|
||||||
{
|
{
|
||||||
CARD32 now = GetTimeInMillis();
|
CARD32 now = GetTimeInMillis();
|
||||||
|
|
||||||
while (timers && (int) (timers->expires - now) <= 0)
|
if (timers && (int) (timers->expires - now) <= 0) {
|
||||||
DoTimer(timers, now, &timers);
|
OsBlockSignals();
|
||||||
|
while (timers && (int) (timers->expires - now) <= 0)
|
||||||
|
DoTimer(timers, now, &timers);
|
||||||
|
OsReleaseSignals();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -1323,6 +1323,10 @@ GetHosts(void **data, int *pnHosts, int *pLen, BOOL * pEnabled)
|
||||||
for (host = validhosts; host; host = host->next) {
|
for (host = validhosts; host; host = host->next) {
|
||||||
nHosts++;
|
nHosts++;
|
||||||
n += pad_to_int32(host->len) + sizeof(xHostEntry);
|
n += pad_to_int32(host->len) + sizeof(xHostEntry);
|
||||||
|
/* Could check for INT_MAX, but in reality having more than 1mb of
|
||||||
|
hostnames in the access list is ridiculous */
|
||||||
|
if (n >= 1048576)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (n) {
|
if (n) {
|
||||||
*data = ptr = malloc(n);
|
*data = ptr = malloc(n);
|
||||||
|
@ -1331,6 +1335,8 @@ GetHosts(void **data, int *pnHosts, int *pLen, BOOL * pEnabled)
|
||||||
}
|
}
|
||||||
for (host = validhosts; host; host = host->next) {
|
for (host = validhosts; host; host = host->next) {
|
||||||
len = host->len;
|
len = host->len;
|
||||||
|
if ((ptr + sizeof(xHostEntry) + len) > ((unsigned char *) *data + n))
|
||||||
|
break;
|
||||||
((xHostEntry *) ptr)->family = host->family;
|
((xHostEntry *) ptr)->family = host->family;
|
||||||
((xHostEntry *) ptr)->length = len;
|
((xHostEntry *) ptr)->length = len;
|
||||||
ptr += sizeof(xHostEntry);
|
ptr += sizeof(xHostEntry);
|
||||||
|
|
|
@ -1307,13 +1307,6 @@ ListenOnOpenFD(int fd, int noxauth)
|
||||||
|
|
||||||
/* Increment the count */
|
/* Increment the count */
|
||||||
ListenTransCount++;
|
ListenTransCount++;
|
||||||
|
|
||||||
/* This *might* not be needed... /shrug */
|
|
||||||
ResetAuthorization();
|
|
||||||
ResetHosts(display);
|
|
||||||
#ifdef XDMCP
|
|
||||||
XdmcpReset();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* based on TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status) */
|
/* based on TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status) */
|
||||||
|
|
|
@ -66,6 +66,10 @@ authdes_ezdecode(const char *inmsg, int len)
|
||||||
SVCXPRT xprt;
|
SVCXPRT xprt;
|
||||||
|
|
||||||
temp_inmsg = malloc(len);
|
temp_inmsg = malloc(len);
|
||||||
|
if (temp_inmsg == NULL) {
|
||||||
|
why = AUTH_FAILED; /* generic error, since there is no AUTH_BADALLOC */
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
memmove(temp_inmsg, inmsg, len);
|
memmove(temp_inmsg, inmsg, len);
|
||||||
|
|
||||||
memset((char *) &msg, 0, sizeof(msg));
|
memset((char *) &msg, 0, sizeof(msg));
|
||||||
|
|
|
@ -435,7 +435,7 @@ present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
|
||||||
DebugPresent(("\tn %lld %p %8lld: %08lx -> %08lx\n",
|
DebugPresent(("\tn %lld %p %8lld: %08lx -> %08lx\n",
|
||||||
vblank->event_id, vblank, vblank->target_msc,
|
vblank->event_id, vblank, vblank->target_msc,
|
||||||
vblank->pixmap ? vblank->pixmap->drawable.id : 0,
|
vblank->pixmap ? vblank->pixmap->drawable.id : 0,
|
||||||
vblank->window->drawable.id));
|
vblank->window ? vblank->window->drawable.id : 0));
|
||||||
|
|
||||||
assert (vblank == screen_priv->flip_pending);
|
assert (vblank == screen_priv->flip_pending);
|
||||||
|
|
||||||
|
@ -762,7 +762,7 @@ present_pixmap(WindowPtr window,
|
||||||
* in the same frame
|
* in the same frame
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!update) {
|
if (!update && pixmap) {
|
||||||
xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->vblank, window_list) {
|
xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->vblank, window_list) {
|
||||||
|
|
||||||
if (!vblank->pixmap)
|
if (!vblank->pixmap)
|
||||||
|
@ -829,10 +829,16 @@ present_pixmap(WindowPtr window,
|
||||||
vblank->notifies = notifies;
|
vblank->notifies = notifies;
|
||||||
vblank->num_notifies = num_notifies;
|
vblank->num_notifies = num_notifies;
|
||||||
|
|
||||||
if (!screen_priv->info || !(screen_priv->info->capabilities & PresentCapabilityAsync))
|
if (!(options & PresentOptionAsync))
|
||||||
vblank->sync_flip = TRUE;
|
vblank->sync_flip = TRUE;
|
||||||
|
|
||||||
if (pixmap && present_check_flip (target_crtc, window, pixmap, vblank->sync_flip, valid, x_off, y_off)) {
|
if (!(options & PresentOptionCopy) &&
|
||||||
|
!((options & PresentOptionAsync) &&
|
||||||
|
(!screen_priv->info ||
|
||||||
|
!(screen_priv->info->capabilities & PresentCapabilityAsync))) &&
|
||||||
|
pixmap != NULL &&
|
||||||
|
present_check_flip (target_crtc, window, pixmap, vblank->sync_flip, valid, x_off, y_off))
|
||||||
|
{
|
||||||
vblank->flip = TRUE;
|
vblank->flip = TRUE;
|
||||||
if (vblank->sync_flip)
|
if (vblank->sync_flip)
|
||||||
target_msc--;
|
target_msc--;
|
||||||
|
@ -851,14 +857,14 @@ present_pixmap(WindowPtr window,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pixmap)
|
if (pixmap)
|
||||||
DebugPresent(("q %lld %p %8lld: %08lx -> %08lx (crtc %p)\n",
|
DebugPresent(("q %lld %p %8lld: %08lx -> %08lx (crtc %p) flip %d vsync %d serial %d\n",
|
||||||
vblank->event_id, vblank, target_msc,
|
vblank->event_id, vblank, target_msc,
|
||||||
vblank->pixmap->drawable.id, vblank->window->drawable.id,
|
vblank->pixmap->drawable.id, vblank->window->drawable.id,
|
||||||
target_crtc));
|
target_crtc, vblank->flip, vblank->sync_flip, vblank->serial));
|
||||||
|
|
||||||
xorg_list_add(&vblank->event_queue, &present_exec_queue);
|
xorg_list_add(&vblank->event_queue, &present_exec_queue);
|
||||||
vblank->queued = TRUE;
|
vblank->queued = TRUE;
|
||||||
if (target_msc >= crtc_msc) {
|
if ((pixmap && target_msc >= crtc_msc) || (!pixmap && target_msc > crtc_msc)) {
|
||||||
ret = present_queue_vblank(screen, target_crtc, vblank->event_id, target_msc);
|
ret = present_queue_vblank(screen, target_crtc, vblank->event_id, target_msc);
|
||||||
if (ret != Success) {
|
if (ret != Success) {
|
||||||
xorg_list_del(&vblank->event_queue);
|
xorg_list_del(&vblank->event_queue);
|
||||||
|
@ -921,7 +927,7 @@ present_notify_msc(WindowPtr window,
|
||||||
0, 0,
|
0, 0,
|
||||||
NULL,
|
NULL,
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
0,
|
PresentOptionAsync,
|
||||||
target_msc, divisor, remainder, NULL, 0);
|
target_msc, divisor, remainder, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -946,7 +952,7 @@ present_vblank_destroy(present_vblank_ptr vblank)
|
||||||
DebugPresent(("\td %lld %p %8lld: %08lx -> %08lx\n",
|
DebugPresent(("\td %lld %p %8lld: %08lx -> %08lx\n",
|
||||||
vblank->event_id, vblank, vblank->target_msc,
|
vblank->event_id, vblank, vblank->target_msc,
|
||||||
vblank->pixmap ? vblank->pixmap->drawable.id : 0,
|
vblank->pixmap ? vblank->pixmap->drawable.id : 0,
|
||||||
vblank->window->drawable.id));
|
vblank->window ? vblank->window->drawable.id : 0));
|
||||||
|
|
||||||
/* Drop pixmap reference */
|
/* Drop pixmap reference */
|
||||||
if (vblank->pixmap)
|
if (vblank->pixmap)
|
||||||
|
|
|
@ -173,7 +173,7 @@ present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 se
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (complete_notify)
|
if (complete_notify && kind == PresentCompleteKindPixmap)
|
||||||
(*complete_notify)(window, mode, serial, ust, msc);
|
(*complete_notify)(window, mode, serial, ust, msc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -210,6 +210,7 @@ proc_present_query_capabilities (ClientPtr client)
|
||||||
RRCrtcPtr crtc = NULL;
|
RRCrtcPtr crtc = NULL;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xPresentQueryCapabilitiesReq);
|
||||||
r = dixLookupWindow(&window, stuff->target, client, DixGetAttrAccess);
|
r = dixLookupWindow(&window, stuff->target, client, DixGetAttrAccess);
|
||||||
switch (r) {
|
switch (r) {
|
||||||
case Success:
|
case Success:
|
||||||
|
@ -254,6 +255,7 @@ static int
|
||||||
sproc_present_query_version(ClientPtr client)
|
sproc_present_query_version(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xPresentQueryVersionReq);
|
REQUEST(xPresentQueryVersionReq);
|
||||||
|
REQUEST_SIZE_MATCH(xPresentQueryVersionReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->majorVersion);
|
swapl(&stuff->majorVersion);
|
||||||
|
@ -265,6 +267,7 @@ static int
|
||||||
sproc_present_pixmap(ClientPtr client)
|
sproc_present_pixmap(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xPresentPixmapReq);
|
REQUEST(xPresentPixmapReq);
|
||||||
|
REQUEST_AT_LEAST_SIZE(xPresentPixmapReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
|
@ -284,6 +287,7 @@ static int
|
||||||
sproc_present_notify_msc(ClientPtr client)
|
sproc_present_notify_msc(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xPresentNotifyMSCReq);
|
REQUEST(xPresentNotifyMSCReq);
|
||||||
|
REQUEST_SIZE_MATCH(xPresentNotifyMSCReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
|
@ -297,6 +301,7 @@ static int
|
||||||
sproc_present_select_input (ClientPtr client)
|
sproc_present_select_input (ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xPresentSelectInputReq);
|
REQUEST(xPresentSelectInputReq);
|
||||||
|
REQUEST_SIZE_MATCH(xPresentSelectInputReq);
|
||||||
|
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
|
@ -308,6 +313,7 @@ static int
|
||||||
sproc_present_query_capabilities (ClientPtr client)
|
sproc_present_query_capabilities (ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xPresentQueryCapabilitiesReq);
|
REQUEST(xPresentQueryCapabilitiesReq);
|
||||||
|
REQUEST_SIZE_MATCH(xPresentQueryCapabilitiesReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->target);
|
swapl(&stuff->target);
|
||||||
return (*proc_present_vector[stuff->presentReqType]) (client);
|
return (*proc_present_vector[stuff->presentReqType]) (client);
|
||||||
|
|
|
@ -540,7 +540,11 @@ ProcRRSetOutputPrimary(ClientPtr client)
|
||||||
if (stuff->output) {
|
if (stuff->output) {
|
||||||
VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
|
VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
|
||||||
|
|
||||||
if (output->pScreen != pWin->drawable.pScreen) {
|
if (!output->pScreen->isGPU && output->pScreen != pWin->drawable.pScreen) {
|
||||||
|
client->errorValue = stuff->window;
|
||||||
|
return BadMatch;
|
||||||
|
}
|
||||||
|
if (output->pScreen->isGPU && output->pScreen->current_master != pWin->drawable.pScreen) {
|
||||||
client->errorValue = stuff->window;
|
client->errorValue = stuff->window;
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
}
|
}
|
||||||
|
|
|
@ -322,8 +322,13 @@ static inline void swap_modeinfos(xRRModeInfo *modeinfos, int i)
|
||||||
swapl(&modeinfos[i].modeFlags);
|
swapl(&modeinfos[i].modeFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define update_arrays(gpuscreen, pScrPriv) do { \
|
#define update_arrays(gpuscreen, pScrPriv, primary_crtc, has_primary) do { \
|
||||||
for (j = 0; j < pScrPriv->numCrtcs; j++) { \
|
for (j = 0; j < pScrPriv->numCrtcs; j++) { \
|
||||||
|
if (has_primary && \
|
||||||
|
primary_crtc == pScrPriv->crtcs[j]) { \
|
||||||
|
has_primary = 0; \
|
||||||
|
continue; \
|
||||||
|
}\
|
||||||
crtcs[crtc_count] = pScrPriv->crtcs[j]->id; \
|
crtcs[crtc_count] = pScrPriv->crtcs[j]->id; \
|
||||||
if (client->swapped) \
|
if (client->swapped) \
|
||||||
swapl(&crtcs[crtc_count]); \
|
swapl(&crtcs[crtc_count]); \
|
||||||
|
@ -366,9 +371,11 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
|
||||||
unsigned long extraLen;
|
unsigned long extraLen;
|
||||||
CARD8 *extra;
|
CARD8 *extra;
|
||||||
RRCrtc *crtcs;
|
RRCrtc *crtcs;
|
||||||
|
RRCrtcPtr primary_crtc = NULL;
|
||||||
RROutput *outputs;
|
RROutput *outputs;
|
||||||
xRRModeInfo *modeinfos;
|
xRRModeInfo *modeinfos;
|
||||||
CARD8 *names;
|
CARD8 *names;
|
||||||
|
int has_primary = 0;
|
||||||
|
|
||||||
/* we need to iterate all the GPU masters and all their output slaves */
|
/* we need to iterate all the GPU masters and all their output slaves */
|
||||||
total_crtcs = 0;
|
total_crtcs = 0;
|
||||||
|
@ -426,18 +433,25 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
|
||||||
modeinfos = (xRRModeInfo *)(outputs + total_outputs);
|
modeinfos = (xRRModeInfo *)(outputs + total_outputs);
|
||||||
names = (CARD8 *)(modeinfos + total_modes);
|
names = (CARD8 *)(modeinfos + total_modes);
|
||||||
|
|
||||||
/* TODO primary */
|
|
||||||
crtc_count = 0;
|
crtc_count = 0;
|
||||||
output_count = 0;
|
output_count = 0;
|
||||||
mode_count = 0;
|
mode_count = 0;
|
||||||
|
|
||||||
pScrPriv = rrGetScrPriv(pScreen);
|
pScrPriv = rrGetScrPriv(pScreen);
|
||||||
update_arrays(pScreen, pScrPriv);
|
if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) {
|
||||||
|
has_primary = 1;
|
||||||
|
primary_crtc = pScrPriv->primaryOutput->crtc;
|
||||||
|
crtcs[0] = pScrPriv->primaryOutput->crtc->id;
|
||||||
|
if (client->swapped)
|
||||||
|
swapl(&crtcs[0]);
|
||||||
|
crtc_count = 1;
|
||||||
|
}
|
||||||
|
update_arrays(pScreen, pScrPriv, primary_crtc, has_primary);
|
||||||
|
|
||||||
xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) {
|
xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) {
|
||||||
pScrPriv = rrGetScrPriv(iter);
|
pScrPriv = rrGetScrPriv(iter);
|
||||||
|
|
||||||
update_arrays(iter, pScrPriv);
|
update_arrays(iter, pScrPriv, primary_crtc, has_primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(bytes_to_int32((char *) names - (char *) extra) == rep.length);
|
assert(bytes_to_int32((char *) names - (char *) extra) == rep.length);
|
||||||
|
|
|
@ -27,6 +27,7 @@ SProcRRQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRRQueryVersionReq);
|
REQUEST(xRRQueryVersionReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRQueryVersionReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->majorVersion);
|
swapl(&stuff->majorVersion);
|
||||||
swapl(&stuff->minorVersion);
|
swapl(&stuff->minorVersion);
|
||||||
|
@ -38,6 +39,7 @@ SProcRRGetScreenInfo(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRRGetScreenInfoReq);
|
REQUEST(xRRGetScreenInfoReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRGetScreenInfoReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||||
|
@ -69,6 +71,7 @@ SProcRRSelectInput(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRRSelectInputReq);
|
REQUEST(xRRSelectInputReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRSelectInputReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
swaps(&stuff->enable);
|
swaps(&stuff->enable);
|
||||||
|
@ -152,6 +155,7 @@ SProcRRConfigureOutputProperty(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRRConfigureOutputPropertyReq);
|
REQUEST(xRRConfigureOutputPropertyReq);
|
||||||
|
|
||||||
|
REQUEST_AT_LEAST_SIZE(xRRConfigureOutputPropertyReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->output);
|
swapl(&stuff->output);
|
||||||
swapl(&stuff->property);
|
swapl(&stuff->property);
|
||||||
|
|
|
@ -344,15 +344,17 @@ ProcRRXineramaQueryScreens(ClientPtr client)
|
||||||
ScreenPtr slave;
|
ScreenPtr slave;
|
||||||
rrScrPriv(pScreen);
|
rrScrPriv(pScreen);
|
||||||
int has_primary = 0;
|
int has_primary = 0;
|
||||||
|
RRCrtcPtr primary_crtc = NULL;
|
||||||
|
|
||||||
if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) {
|
if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) {
|
||||||
has_primary = 1;
|
has_primary = 1;
|
||||||
|
primary_crtc = pScrPriv->primaryOutput->crtc;
|
||||||
RRXineramaWriteCrtc(client, pScrPriv->primaryOutput->crtc);
|
RRXineramaWriteCrtc(client, pScrPriv->primaryOutput->crtc);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < pScrPriv->numCrtcs; i++) {
|
for (i = 0; i < pScrPriv->numCrtcs; i++) {
|
||||||
if (has_primary &&
|
if (has_primary &&
|
||||||
pScrPriv->primaryOutput->crtc == pScrPriv->crtcs[i]) {
|
primary_crtc == pScrPriv->crtcs[i]) {
|
||||||
has_primary = 0;
|
has_primary = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -362,8 +364,14 @@ ProcRRXineramaQueryScreens(ClientPtr client)
|
||||||
xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
|
xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
|
||||||
rrScrPrivPtr pSlavePriv;
|
rrScrPrivPtr pSlavePriv;
|
||||||
pSlavePriv = rrGetScrPriv(slave);
|
pSlavePriv = rrGetScrPriv(slave);
|
||||||
for (i = 0; i < pSlavePriv->numCrtcs; i++)
|
for (i = 0; i < pSlavePriv->numCrtcs; i++) {
|
||||||
|
if (has_primary &&
|
||||||
|
primary_crtc == pSlavePriv->crtcs[i]) {
|
||||||
|
has_primary = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
RRXineramaWriteCrtc(client, pSlavePriv->crtcs[i]);
|
RRXineramaWriteCrtc(client, pSlavePriv->crtcs[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -276,11 +276,11 @@ ProcRenderQueryVersion(ClientPtr client)
|
||||||
|
|
||||||
REQUEST(xRenderQueryVersionReq);
|
REQUEST(xRenderQueryVersionReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
|
||||||
|
|
||||||
pRenderClient->major_version = stuff->majorVersion;
|
pRenderClient->major_version = stuff->majorVersion;
|
||||||
pRenderClient->minor_version = stuff->minorVersion;
|
pRenderClient->minor_version = stuff->minorVersion;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
|
|
||||||
|
|
||||||
if ((stuff->majorVersion * 1000 + stuff->minorVersion) <
|
if ((stuff->majorVersion * 1000 + stuff->minorVersion) <
|
||||||
(SERVER_RENDER_MAJOR_VERSION * 1000 + SERVER_RENDER_MINOR_VERSION)) {
|
(SERVER_RENDER_MAJOR_VERSION * 1000 + SERVER_RENDER_MINOR_VERSION)) {
|
||||||
rep.majorVersion = stuff->majorVersion;
|
rep.majorVersion = stuff->majorVersion;
|
||||||
|
@ -1995,7 +1995,7 @@ static int
|
||||||
SProcRenderQueryVersion(ClientPtr client)
|
SProcRenderQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRenderQueryVersionReq);
|
REQUEST(xRenderQueryVersionReq);
|
||||||
|
REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->majorVersion);
|
swapl(&stuff->majorVersion);
|
||||||
swapl(&stuff->minorVersion);
|
swapl(&stuff->minorVersion);
|
||||||
|
@ -2006,6 +2006,7 @@ static int
|
||||||
SProcRenderQueryPictFormats(ClientPtr client)
|
SProcRenderQueryPictFormats(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRenderQueryPictFormatsReq);
|
REQUEST(xRenderQueryPictFormatsReq);
|
||||||
|
REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||||
}
|
}
|
||||||
|
@ -2014,6 +2015,7 @@ static int
|
||||||
SProcRenderQueryPictIndexValues(ClientPtr client)
|
SProcRenderQueryPictIndexValues(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRenderQueryPictIndexValuesReq);
|
REQUEST(xRenderQueryPictIndexValuesReq);
|
||||||
|
REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->format);
|
swapl(&stuff->format);
|
||||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||||
|
@ -2029,6 +2031,7 @@ static int
|
||||||
SProcRenderCreatePicture(ClientPtr client)
|
SProcRenderCreatePicture(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRenderCreatePictureReq);
|
REQUEST(xRenderCreatePictureReq);
|
||||||
|
REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->pid);
|
swapl(&stuff->pid);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
|
@ -2042,6 +2045,7 @@ static int
|
||||||
SProcRenderChangePicture(ClientPtr client)
|
SProcRenderChangePicture(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRenderChangePictureReq);
|
REQUEST(xRenderChangePictureReq);
|
||||||
|
REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->picture);
|
swapl(&stuff->picture);
|
||||||
swapl(&stuff->mask);
|
swapl(&stuff->mask);
|
||||||
|
@ -2053,6 +2057,7 @@ static int
|
||||||
SProcRenderSetPictureClipRectangles(ClientPtr client)
|
SProcRenderSetPictureClipRectangles(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRenderSetPictureClipRectanglesReq);
|
REQUEST(xRenderSetPictureClipRectanglesReq);
|
||||||
|
REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->picture);
|
swapl(&stuff->picture);
|
||||||
swaps(&stuff->xOrigin);
|
swaps(&stuff->xOrigin);
|
||||||
|
@ -2065,6 +2070,7 @@ static int
|
||||||
SProcRenderFreePicture(ClientPtr client)
|
SProcRenderFreePicture(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRenderFreePictureReq);
|
REQUEST(xRenderFreePictureReq);
|
||||||
|
REQUEST_SIZE_MATCH(xRenderFreePictureReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->picture);
|
swapl(&stuff->picture);
|
||||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||||
|
@ -2074,6 +2080,7 @@ static int
|
||||||
SProcRenderComposite(ClientPtr client)
|
SProcRenderComposite(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRenderCompositeReq);
|
REQUEST(xRenderCompositeReq);
|
||||||
|
REQUEST_SIZE_MATCH(xRenderCompositeReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->src);
|
swapl(&stuff->src);
|
||||||
swapl(&stuff->mask);
|
swapl(&stuff->mask);
|
||||||
|
@ -2093,6 +2100,7 @@ static int
|
||||||
SProcRenderScale(ClientPtr client)
|
SProcRenderScale(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRenderScaleReq);
|
REQUEST(xRenderScaleReq);
|
||||||
|
REQUEST_SIZE_MATCH(xRenderScaleReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->src);
|
swapl(&stuff->src);
|
||||||
swapl(&stuff->dst);
|
swapl(&stuff->dst);
|
||||||
|
@ -2193,6 +2201,7 @@ static int
|
||||||
SProcRenderCreateGlyphSet(ClientPtr client)
|
SProcRenderCreateGlyphSet(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRenderCreateGlyphSetReq);
|
REQUEST(xRenderCreateGlyphSetReq);
|
||||||
|
REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->gsid);
|
swapl(&stuff->gsid);
|
||||||
swapl(&stuff->format);
|
swapl(&stuff->format);
|
||||||
|
@ -2203,6 +2212,7 @@ static int
|
||||||
SProcRenderReferenceGlyphSet(ClientPtr client)
|
SProcRenderReferenceGlyphSet(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRenderReferenceGlyphSetReq);
|
REQUEST(xRenderReferenceGlyphSetReq);
|
||||||
|
REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->gsid);
|
swapl(&stuff->gsid);
|
||||||
swapl(&stuff->existing);
|
swapl(&stuff->existing);
|
||||||
|
@ -2213,6 +2223,7 @@ static int
|
||||||
SProcRenderFreeGlyphSet(ClientPtr client)
|
SProcRenderFreeGlyphSet(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRenderFreeGlyphSetReq);
|
REQUEST(xRenderFreeGlyphSetReq);
|
||||||
|
REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->glyphset);
|
swapl(&stuff->glyphset);
|
||||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||||
|
@ -2227,6 +2238,7 @@ SProcRenderAddGlyphs(ClientPtr client)
|
||||||
xGlyphInfo *gi;
|
xGlyphInfo *gi;
|
||||||
|
|
||||||
REQUEST(xRenderAddGlyphsReq);
|
REQUEST(xRenderAddGlyphsReq);
|
||||||
|
REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->glyphset);
|
swapl(&stuff->glyphset);
|
||||||
swapl(&stuff->nglyphs);
|
swapl(&stuff->nglyphs);
|
||||||
|
@ -2261,6 +2273,7 @@ static int
|
||||||
SProcRenderFreeGlyphs(ClientPtr client)
|
SProcRenderFreeGlyphs(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRenderFreeGlyphsReq);
|
REQUEST(xRenderFreeGlyphsReq);
|
||||||
|
REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->glyphset);
|
swapl(&stuff->glyphset);
|
||||||
SwapRestL(stuff);
|
SwapRestL(stuff);
|
||||||
|
@ -2278,6 +2291,7 @@ SProcRenderCompositeGlyphs(ClientPtr client)
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
REQUEST(xRenderCompositeGlyphsReq);
|
REQUEST(xRenderCompositeGlyphsReq);
|
||||||
|
REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq);
|
||||||
|
|
||||||
switch (stuff->renderReqType) {
|
switch (stuff->renderReqType) {
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -4,7 +4,7 @@ noinst_PROGRAMS = list string
|
||||||
if XORG
|
if XORG
|
||||||
# Tests that require at least some DDX functions in order to fully link
|
# Tests that require at least some DDX functions in order to fully link
|
||||||
# For now, requires xf86 ddx, could be adjusted to use another
|
# For now, requires xf86 ddx, could be adjusted to use another
|
||||||
SUBDIRS += xi2
|
SUBDIRS += xi1 xi2
|
||||||
noinst_PROGRAMS += xkb input xtest misc fixes xfree86 hashtabletest os signal-logging touch
|
noinst_PROGRAMS += xkb input xtest misc fixes xfree86 hashtabletest os signal-logging touch
|
||||||
endif
|
endif
|
||||||
check_LTLIBRARIES = libxservertest.la
|
check_LTLIBRARIES = libxservertest.la
|
||||||
|
|
37
test/misc.c
37
test/misc.c
|
@ -28,6 +28,8 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
|
#include "dix.h"
|
||||||
|
#include "dixstruct.h"
|
||||||
|
|
||||||
ScreenInfo screenInfo;
|
ScreenInfo screenInfo;
|
||||||
|
|
||||||
|
@ -155,11 +157,46 @@ dix_update_desktop_dimensions(void)
|
||||||
assert_dimensions(-w2, -h2, w2, h2);
|
assert_dimensions(-w2, -h2, w2, h2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
dix_request_fixed_size_overflow(ClientRec *client)
|
||||||
|
{
|
||||||
|
xReq req = { 0 };
|
||||||
|
|
||||||
|
client->req_len = req.length = 1;
|
||||||
|
REQUEST_FIXED_SIZE(req, SIZE_MAX);
|
||||||
|
return Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
dix_request_fixed_size_match(ClientRec *client)
|
||||||
|
{
|
||||||
|
xReq req = { 0 };
|
||||||
|
|
||||||
|
client->req_len = req.length = 9;
|
||||||
|
REQUEST_FIXED_SIZE(req, 30);
|
||||||
|
return Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
dix_request_size_checks(void)
|
||||||
|
{
|
||||||
|
ClientRec client = { 0 };
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
rc = dix_request_fixed_size_overflow(&client);
|
||||||
|
assert(rc == BadLength);
|
||||||
|
|
||||||
|
rc = dix_request_fixed_size_match(&client);
|
||||||
|
assert(rc == Success);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
dix_version_compare();
|
dix_version_compare();
|
||||||
dix_update_desktop_dimensions();
|
dix_update_desktop_dimensions();
|
||||||
|
dix_request_size_checks();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
if ENABLE_UNIT_TESTS
|
||||||
|
if HAVE_LD_WRAP
|
||||||
|
noinst_PROGRAMS = \
|
||||||
|
protocol-xchangedevicecontrol
|
||||||
|
|
||||||
|
TESTS=$(noinst_PROGRAMS)
|
||||||
|
TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV)
|
||||||
|
|
||||||
|
AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
|
||||||
|
AM_CPPFLAGS = @XORG_INCS@ -I$(srcdir)/../xi2
|
||||||
|
TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS)
|
||||||
|
COMMON_SOURCES=$(srcdir)/../xi2/protocol-common.c
|
||||||
|
|
||||||
|
if SPECIAL_DTRACE_OBJECTS
|
||||||
|
TEST_LDADD += $(OS_LIB) $(DIX_LIB)
|
||||||
|
endif
|
||||||
|
|
||||||
|
protocol_xchangedevicecontrol_LDADD=$(TEST_LDADD)
|
||||||
|
|
||||||
|
protocol_xchangedevicecontrol_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient
|
||||||
|
|
||||||
|
protocol_xchangedevicecontrol_SOURCES=$(COMMON_SOURCES) protocol-xchangedevicecontrol.c
|
||||||
|
|
||||||
|
else
|
||||||
|
# Print that xi1-tests were skipped (exit code 77 for automake test harness)
|
||||||
|
TESTS = xi1-tests
|
||||||
|
CLEANFILES = $(TESTS)
|
||||||
|
|
||||||
|
xi1-tests:
|
||||||
|
@echo 'echo "ld -wrap support required for xi1 unit tests, skipping"' > $@
|
||||||
|
@echo 'exit 77' >> $@
|
||||||
|
$(AM_V_GEN)chmod +x $@
|
||||||
|
endif
|
||||||
|
endif
|
|
@ -0,0 +1,122 @@
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice (including the next
|
||||||
|
* paragraph) shall be included in all copies or substantial portions of the
|
||||||
|
* Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
* DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
|
#include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Protocol testing for ChangeDeviceControl request.
|
||||||
|
*/
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <X11/X.h>
|
||||||
|
#include <X11/Xproto.h>
|
||||||
|
#include <X11/extensions/XIproto.h>
|
||||||
|
#include "inputstr.h"
|
||||||
|
#include "chgdctl.h"
|
||||||
|
|
||||||
|
#include "protocol-common.h"
|
||||||
|
|
||||||
|
static ClientRec client_request;
|
||||||
|
|
||||||
|
static void
|
||||||
|
reply_ChangeDeviceControl(ClientPtr client, int len, char *data, void *userdata)
|
||||||
|
{
|
||||||
|
xChangeDeviceControlReply *rep = (xChangeDeviceControlReply *) data;
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swapl(&rep->length);
|
||||||
|
swaps(&rep->sequenceNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
reply_check_defaults(rep, len, ChangeDeviceControl);
|
||||||
|
|
||||||
|
/* XXX: check status code in reply */
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
request_ChangeDeviceControl(ClientPtr client, xChangeDeviceControlReq * req,
|
||||||
|
xDeviceCtl *ctl, int error)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
client_request.req_len = req->length;
|
||||||
|
rc = ProcXChangeDeviceControl(&client_request);
|
||||||
|
assert(rc == error);
|
||||||
|
|
||||||
|
/* XXX: ChangeDeviceControl doesn't seem to fill in errorValue to check */
|
||||||
|
|
||||||
|
client_request.swapped = TRUE;
|
||||||
|
swaps(&req->length);
|
||||||
|
swaps(&req->control);
|
||||||
|
swaps(&ctl->length);
|
||||||
|
swaps(&ctl->control);
|
||||||
|
/* XXX: swap other contents of ctl, depending on type */
|
||||||
|
rc = SProcXChangeDeviceControl(&client_request);
|
||||||
|
assert(rc == error);
|
||||||
|
}
|
||||||
|
|
||||||
|
static unsigned char *data[4096]; /* the request buffer */
|
||||||
|
|
||||||
|
static void
|
||||||
|
test_ChangeDeviceControl(void)
|
||||||
|
{
|
||||||
|
xChangeDeviceControlReq *request = (xChangeDeviceControlReq *) data;
|
||||||
|
xDeviceCtl *control = (xDeviceCtl *) (&request[1]);
|
||||||
|
|
||||||
|
request_init(request, ChangeDeviceControl);
|
||||||
|
|
||||||
|
reply_handler = reply_ChangeDeviceControl;
|
||||||
|
|
||||||
|
client_request = init_client(request->length, request);
|
||||||
|
|
||||||
|
printf("Testing invalid lengths:\n");
|
||||||
|
printf(" -- no control struct\n");
|
||||||
|
request_ChangeDeviceControl(&client_request, request, control, BadLength);
|
||||||
|
|
||||||
|
printf(" -- xDeviceResolutionCtl\n");
|
||||||
|
request_init(request, ChangeDeviceControl);
|
||||||
|
request->control = DEVICE_RESOLUTION;
|
||||||
|
control->length = (sizeof(xDeviceResolutionCtl) >> 2);
|
||||||
|
request->length += control->length - 2;
|
||||||
|
request_ChangeDeviceControl(&client_request, request, control, BadLength);
|
||||||
|
|
||||||
|
printf(" -- xDeviceEnableCtl\n");
|
||||||
|
request_init(request, ChangeDeviceControl);
|
||||||
|
request->control = DEVICE_ENABLE;
|
||||||
|
control->length = (sizeof(xDeviceEnableCtl) >> 2);
|
||||||
|
request->length += control->length - 2;
|
||||||
|
request_ChangeDeviceControl(&client_request, request, control, BadLength);
|
||||||
|
|
||||||
|
/* XXX: Test functionality! */
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
init_simple();
|
||||||
|
|
||||||
|
test_ChangeDeviceControl();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -124,6 +124,11 @@ test_XIGetClientPointer(void)
|
||||||
request.win = INVALID_WINDOW_ID;
|
request.win = INVALID_WINDOW_ID;
|
||||||
request_XIGetClientPointer(&client_request, &request, BadWindow);
|
request_XIGetClientPointer(&client_request, &request, BadWindow);
|
||||||
|
|
||||||
|
printf("Testing invalid length\n");
|
||||||
|
client_request.req_len -= 4;
|
||||||
|
request_XIGetClientPointer(&client_request, &request, BadLength);
|
||||||
|
client_request.req_len += 4;
|
||||||
|
|
||||||
test_data.cp_is_set = FALSE;
|
test_data.cp_is_set = FALSE;
|
||||||
|
|
||||||
printf("Testing window None, unset ClientPointer.\n");
|
printf("Testing window None, unset ClientPointer.\n");
|
||||||
|
|
|
@ -139,6 +139,7 @@ request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceReq * req,
|
||||||
int local_modifiers;
|
int local_modifiers;
|
||||||
int mask_len;
|
int mask_len;
|
||||||
|
|
||||||
|
client_request.req_len = req->length;
|
||||||
rc = ProcXIPassiveGrabDevice(&client_request);
|
rc = ProcXIPassiveGrabDevice(&client_request);
|
||||||
assert(rc == error);
|
assert(rc == error);
|
||||||
|
|
||||||
|
@ -190,6 +191,13 @@ test_XIPassiveGrabDevice(void)
|
||||||
request_XIPassiveGrabDevice(&client_request, request, BadDevice,
|
request_XIPassiveGrabDevice(&client_request, request, BadDevice,
|
||||||
request->deviceid);
|
request->deviceid);
|
||||||
|
|
||||||
|
printf("Testing invalid length\n");
|
||||||
|
request->length -= 2;
|
||||||
|
request_XIPassiveGrabDevice(&client_request, request, BadLength,
|
||||||
|
client_request.errorValue);
|
||||||
|
/* re-init request since swapped length test leaves some values swapped */
|
||||||
|
request_init(request, XIPassiveGrabDevice);
|
||||||
|
request->grab_window = CLIENT_WINDOW_ID;
|
||||||
request->deviceid = XIAllMasterDevices;
|
request->deviceid = XIAllMasterDevices;
|
||||||
|
|
||||||
printf("Testing invalid grab types\n");
|
printf("Testing invalid grab types\n");
|
||||||
|
|
|
@ -201,6 +201,10 @@ test_XIQueryPointer(void)
|
||||||
test_data.dev = devices.mouse;
|
test_data.dev = devices.mouse;
|
||||||
request.deviceid = devices.mouse->id;
|
request.deviceid = devices.mouse->id;
|
||||||
request_XIQueryPointer(&client_request, &request, Success);
|
request_XIQueryPointer(&client_request, &request, Success);
|
||||||
|
|
||||||
|
/* test REQUEST_SIZE_MATCH */
|
||||||
|
client_request.req_len -= 4;
|
||||||
|
request_XIQueryPointer(&client_request, &request, BadLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -198,6 +198,9 @@ test_XIWarpPointer(void)
|
||||||
request_XIWarpPointer(&client_request, &request, Success);
|
request_XIWarpPointer(&client_request, &request, Success);
|
||||||
|
|
||||||
/* FIXME: src_x/y checks */
|
/* FIXME: src_x/y checks */
|
||||||
|
|
||||||
|
client_request.req_len -= 2; /* invalid length */
|
||||||
|
request_XIWarpPointer(&client_request, &request, BadLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -201,6 +201,7 @@ SProcXFixesSelectSelectionInput(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXFixesSelectSelectionInputReq);
|
REQUEST(xXFixesSelectSelectionInputReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xXFixesSelectSelectionInputReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swapl(&stuff->window);
|
swapl(&stuff->window);
|
||||||
swapl(&stuff->selection);
|
swapl(&stuff->selection);
|
||||||
|
|
100
xkb/xkb.c
100
xkb/xkb.c
|
@ -4957,26 +4957,29 @@ ProcXkbGetGeometry(ClientPtr client)
|
||||||
|
|
||||||
/***====================================================================***/
|
/***====================================================================***/
|
||||||
|
|
||||||
static char *
|
static Status
|
||||||
_GetCountedString(char **wire_inout, Bool swap)
|
_GetCountedString(char **wire_inout, ClientPtr client, char **str)
|
||||||
{
|
{
|
||||||
char *wire, *str;
|
char *wire, *next;
|
||||||
CARD16 len, *plen;
|
CARD16 len;
|
||||||
|
|
||||||
wire = *wire_inout;
|
wire = *wire_inout;
|
||||||
plen = (CARD16 *) wire;
|
len = *(CARD16 *) wire;
|
||||||
if (swap) {
|
if (client->swapped) {
|
||||||
swaps(plen);
|
swaps(&len);
|
||||||
}
|
}
|
||||||
len = *plen;
|
next = wire + XkbPaddedSize(len + 2);
|
||||||
str = malloc(len + 1);
|
/* Check we're still within the size of the request */
|
||||||
if (str) {
|
if (client->req_len <
|
||||||
memcpy(str, &wire[2], len);
|
bytes_to_int32(next - (char *) client->requestBuffer))
|
||||||
str[len] = '\0';
|
return BadValue;
|
||||||
}
|
*str = malloc(len + 1);
|
||||||
wire += XkbPaddedSize(len + 2);
|
if (!*str)
|
||||||
*wire_inout = wire;
|
return BadAlloc;
|
||||||
return str;
|
memcpy(*str, &wire[2], len);
|
||||||
|
*(*str + len) = '\0';
|
||||||
|
*wire_inout = next;
|
||||||
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Status
|
static Status
|
||||||
|
@ -4985,25 +4988,29 @@ _CheckSetDoodad(char **wire_inout,
|
||||||
{
|
{
|
||||||
char *wire;
|
char *wire;
|
||||||
xkbDoodadWireDesc *dWire;
|
xkbDoodadWireDesc *dWire;
|
||||||
|
xkbAnyDoodadWireDesc any;
|
||||||
|
xkbTextDoodadWireDesc text;
|
||||||
XkbDoodadPtr doodad;
|
XkbDoodadPtr doodad;
|
||||||
|
Status status;
|
||||||
|
|
||||||
dWire = (xkbDoodadWireDesc *) (*wire_inout);
|
dWire = (xkbDoodadWireDesc *) (*wire_inout);
|
||||||
|
any = dWire->any;
|
||||||
wire = (char *) &dWire[1];
|
wire = (char *) &dWire[1];
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swapl(&dWire->any.name);
|
swapl(&any.name);
|
||||||
swaps(&dWire->any.top);
|
swaps(&any.top);
|
||||||
swaps(&dWire->any.left);
|
swaps(&any.left);
|
||||||
swaps(&dWire->any.angle);
|
swaps(&any.angle);
|
||||||
}
|
}
|
||||||
CHK_ATOM_ONLY(dWire->any.name);
|
CHK_ATOM_ONLY(dWire->any.name);
|
||||||
doodad = XkbAddGeomDoodad(geom, section, dWire->any.name);
|
doodad = XkbAddGeomDoodad(geom, section, any.name);
|
||||||
if (!doodad)
|
if (!doodad)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
doodad->any.type = dWire->any.type;
|
doodad->any.type = dWire->any.type;
|
||||||
doodad->any.priority = dWire->any.priority;
|
doodad->any.priority = dWire->any.priority;
|
||||||
doodad->any.top = dWire->any.top;
|
doodad->any.top = any.top;
|
||||||
doodad->any.left = dWire->any.left;
|
doodad->any.left = any.left;
|
||||||
doodad->any.angle = dWire->any.angle;
|
doodad->any.angle = any.angle;
|
||||||
switch (doodad->any.type) {
|
switch (doodad->any.type) {
|
||||||
case XkbOutlineDoodad:
|
case XkbOutlineDoodad:
|
||||||
case XkbSolidDoodad:
|
case XkbSolidDoodad:
|
||||||
|
@ -5026,15 +5033,22 @@ _CheckSetDoodad(char **wire_inout,
|
||||||
dWire->text.colorNdx);
|
dWire->text.colorNdx);
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
}
|
}
|
||||||
|
text = dWire->text;
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&dWire->text.width);
|
swaps(&text.width);
|
||||||
swaps(&dWire->text.height);
|
swaps(&text.height);
|
||||||
}
|
}
|
||||||
doodad->text.width = dWire->text.width;
|
doodad->text.width = text.width;
|
||||||
doodad->text.height = dWire->text.height;
|
doodad->text.height = text.height;
|
||||||
doodad->text.color_ndx = dWire->text.colorNdx;
|
doodad->text.color_ndx = dWire->text.colorNdx;
|
||||||
doodad->text.text = _GetCountedString(&wire, client->swapped);
|
status = _GetCountedString(&wire, client, &doodad->text.text);
|
||||||
doodad->text.font = _GetCountedString(&wire, client->swapped);
|
if (status != Success)
|
||||||
|
return status;
|
||||||
|
status = _GetCountedString(&wire, client, &doodad->text.font);
|
||||||
|
if (status != Success) {
|
||||||
|
free (doodad->text.text);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case XkbIndicatorDoodad:
|
case XkbIndicatorDoodad:
|
||||||
if (dWire->indicator.onColorNdx >= geom->num_colors) {
|
if (dWire->indicator.onColorNdx >= geom->num_colors) {
|
||||||
|
@ -5069,7 +5083,9 @@ _CheckSetDoodad(char **wire_inout,
|
||||||
}
|
}
|
||||||
doodad->logo.color_ndx = dWire->logo.colorNdx;
|
doodad->logo.color_ndx = dWire->logo.colorNdx;
|
||||||
doodad->logo.shape_ndx = dWire->logo.shapeNdx;
|
doodad->logo.shape_ndx = dWire->logo.shapeNdx;
|
||||||
doodad->logo.logo_name = _GetCountedString(&wire, client->swapped);
|
status = _GetCountedString(&wire, client, &doodad->logo.logo_name);
|
||||||
|
if (status != Success)
|
||||||
|
return status;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
client->errorValue = _XkbErrCode2(0x4F, dWire->any.type);
|
client->errorValue = _XkbErrCode2(0x4F, dWire->any.type);
|
||||||
|
@ -5301,18 +5317,20 @@ _CheckSetGeom(XkbGeometryPtr geom, xkbSetGeometryReq * req, ClientPtr client)
|
||||||
char *wire;
|
char *wire;
|
||||||
|
|
||||||
wire = (char *) &req[1];
|
wire = (char *) &req[1];
|
||||||
geom->label_font = _GetCountedString(&wire, client->swapped);
|
status = _GetCountedString(&wire, client, &geom->label_font);
|
||||||
|
if (status != Success)
|
||||||
|
return status;
|
||||||
|
|
||||||
for (i = 0; i < req->nProperties; i++) {
|
for (i = 0; i < req->nProperties; i++) {
|
||||||
char *name, *val;
|
char *name, *val;
|
||||||
|
|
||||||
name = _GetCountedString(&wire, client->swapped);
|
status = _GetCountedString(&wire, client, &name);
|
||||||
if (!name)
|
if (status != Success)
|
||||||
return BadAlloc;
|
return status;
|
||||||
val = _GetCountedString(&wire, client->swapped);
|
status = _GetCountedString(&wire, client, &val);
|
||||||
if (!val) {
|
if (status != Success) {
|
||||||
free(name);
|
free(name);
|
||||||
return BadAlloc;
|
return status;
|
||||||
}
|
}
|
||||||
if (XkbAddGeomProperty(geom, name, val) == NULL) {
|
if (XkbAddGeomProperty(geom, name, val) == NULL) {
|
||||||
free(name);
|
free(name);
|
||||||
|
@ -5346,9 +5364,9 @@ _CheckSetGeom(XkbGeometryPtr geom, xkbSetGeometryReq * req, ClientPtr client)
|
||||||
for (i = 0; i < req->nColors; i++) {
|
for (i = 0; i < req->nColors; i++) {
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
name = _GetCountedString(&wire, client->swapped);
|
status = _GetCountedString(&wire, client, &name);
|
||||||
if (!name)
|
if (status != Success)
|
||||||
return BadAlloc;
|
return status;
|
||||||
if (!XkbAddGeomColor(geom, name, geom->num_colors)) {
|
if (!XkbAddGeomColor(geom, name, geom->num_colors)) {
|
||||||
free(name);
|
free(name);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
Loading…
Reference in New Issue