diff options
author | marha <marha@users.sourceforge.net> | 2009-09-02 19:53:35 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-02 19:53:35 +0000 |
commit | 6f25a23db1df27e992c34f6fd4c82e83c44fc2e2 (patch) | |
tree | a49e113cbab862b959559a047afef689df50e492 /xorg-server/dix/dispatch.c | |
parent | 78b8aacf420184834a24f11d138b88c2f3ed09d1 (diff) | |
download | vcxsrv-6f25a23db1df27e992c34f6fd4c82e83c44fc2e2.tar.gz vcxsrv-6f25a23db1df27e992c34f6fd4c82e83c44fc2e2.tar.bz2 vcxsrv-6f25a23db1df27e992c34f6fd4c82e83c44fc2e2.zip |
Switched to xorg-server-1.6.3.901.tar.gz
Diffstat (limited to 'xorg-server/dix/dispatch.c')
-rw-r--r-- | xorg-server/dix/dispatch.c | 70 |
1 files changed, 45 insertions, 25 deletions
diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c index 66f8f79ff..7e16589da 100644 --- a/xorg-server/dix/dispatch.c +++ b/xorg-server/dix/dispatch.c @@ -247,6 +247,7 @@ long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; long SmartScheduleTime; +int SmartScheduleLatencyLimited = 0; static ClientPtr SmartLastClient; static int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1]; @@ -317,7 +318,7 @@ SmartScheduleClient (int *clientReady, int nready) /* * Adjust slice */ - if (nready == 1) + if (nready == 1 && SmartScheduleLatencyLimited == 0) { /* * If it's been a long time since another client @@ -337,6 +338,23 @@ SmartScheduleClient (int *clientReady, int nready) return best; } +void +EnableLimitedSchedulingLatency(void) +{ + ++SmartScheduleLatencyLimited; + SmartScheduleSlice = SmartScheduleInterval; +} + +void +DisableLimitedSchedulingLatency(void) +{ + --SmartScheduleLatencyLimited; + + /* protect against bugs */ + if (SmartScheduleLatencyLimited < 0) + SmartScheduleLatencyLimited = 0; +} + #define MAJOROP ((xReq *)client->requestBuffer)->reqType void @@ -356,6 +374,7 @@ Dispatch(void) if (!clientReady) return; + SmartScheduleSlice = SmartScheduleInterval; while (!dispatchException) { if (*icheck[0] != *icheck[1]) @@ -466,6 +485,7 @@ Dispatch(void) KillAllClients(); xfree(clientReady); dispatchException &= ~DE_RESET; + SmartScheduleLatencyLimited = 0; } #undef MAJOROP @@ -1119,11 +1139,11 @@ ProcQueryFont(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); client->errorValue = stuff->id; /* EITHER font or gc */ - rc = dixLookupResource((pointer *)&pFont, stuff->id, RT_FONT, client, - DixGetAttrAccess); + rc = dixLookupResourceByType((pointer *)&pFont, stuff->id, RT_FONT, client, + DixGetAttrAccess); if (rc == BadValue) { - rc = dixLookupResource((pointer *)&pGC, stuff->id, RT_GC, client, - DixGetAttrAccess); + rc = dixLookupResourceByType((pointer *)&pGC, stuff->id, RT_GC, client, + DixGetAttrAccess); if (rc == Success) pFont = pGC->font; } @@ -1177,10 +1197,10 @@ ProcQueryTextExtents(ClientPtr client) REQUEST_AT_LEAST_SIZE(xQueryTextExtentsReq); client->errorValue = stuff->fid; /* EITHER font or gc */ - rc = dixLookupResource((pointer *)&pFont, stuff->fid, RT_FONT, client, - DixGetAttrAccess); + rc = dixLookupResourceByType((pointer *)&pFont, stuff->fid, RT_FONT, client, + DixGetAttrAccess); if (rc == BadValue) { - rc = dixLookupResource((pointer *)&pGC, stuff->fid, RT_GC, client, + rc = dixLookupResourceByType((pointer *)&pGC, stuff->fid, RT_GC, client, DixGetAttrAccess); if (rc == Success) pFont = pGC->font; @@ -1325,7 +1345,7 @@ ProcFreePixmap(ClientPtr client) REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); - rc = dixLookupResource((pointer *)&pMap, stuff->id, RT_PIXMAP, client, + rc = dixLookupResourceByType((pointer *)&pMap, stuff->id, RT_PIXMAP, client, DixDestroyAccess); if (rc == Success) { @@ -2271,7 +2291,7 @@ ProcFreeColormap(ClientPtr client) REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); - rc = dixLookupResource((pointer *)&pmap, stuff->id, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pmap, stuff->id, RT_COLORMAP, client, DixDestroyAccess); if (rc == Success) { @@ -2299,7 +2319,7 @@ ProcCopyColormapAndFree(ClientPtr client) REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq); mid = stuff->mid; LEGAL_NEW_RESOURCE(mid, client); - rc = dixLookupResource((pointer *)&pSrcMap, stuff->srcCmap, RT_COLORMAP, + rc = dixLookupResourceByType((pointer *)&pSrcMap, stuff->srcCmap, RT_COLORMAP, client, DixReadAccess|DixRemoveAccess); if (rc == Success) { @@ -2324,7 +2344,7 @@ ProcInstallColormap(ClientPtr client) REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); - rc = dixLookupResource((pointer *)&pcmp, stuff->id, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->id, RT_COLORMAP, client, DixInstallAccess); if (rc != Success) goto out; @@ -2349,7 +2369,7 @@ ProcUninstallColormap(ClientPtr client) REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); - rc = dixLookupResource((pointer *)&pcmp, stuff->id, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->id, RT_COLORMAP, client, DixUninstallAccess); if (rc != Success) goto out; @@ -2416,7 +2436,7 @@ ProcAllocColor (ClientPtr client) REQUEST(xAllocColorReq); REQUEST_SIZE_MATCH(xAllocColorReq); - rc = dixLookupResource((pointer *)&pmap, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pmap, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { @@ -2457,7 +2477,7 @@ ProcAllocNamedColor (ClientPtr client) REQUEST(xAllocNamedColorReq); REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes); - rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { @@ -2508,7 +2528,7 @@ ProcAllocColorCells (ClientPtr client) REQUEST(xAllocColorCellsReq); REQUEST_SIZE_MATCH(xAllocColorCellsReq); - rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { @@ -2575,7 +2595,7 @@ ProcAllocColorPlanes(ClientPtr client) REQUEST(xAllocColorPlanesReq); REQUEST_SIZE_MATCH(xAllocColorPlanesReq); - rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { @@ -2640,7 +2660,7 @@ ProcFreeColors(ClientPtr client) REQUEST(xFreeColorsReq); REQUEST_AT_LEAST_SIZE(xFreeColorsReq); - rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, DixRemoveAccess); if (rc == Success) { @@ -2675,7 +2695,7 @@ ProcStoreColors (ClientPtr client) REQUEST(xStoreColorsReq); REQUEST_AT_LEAST_SIZE(xStoreColorsReq); - rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, DixWriteAccess); if (rc == Success) { @@ -2709,7 +2729,7 @@ ProcStoreNamedColor (ClientPtr client) REQUEST(xStoreNamedColorReq); REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes); - rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, DixWriteAccess); if (rc == Success) { @@ -2743,7 +2763,7 @@ ProcQueryColors(ClientPtr client) REQUEST(xQueryColorsReq); REQUEST_AT_LEAST_SIZE(xQueryColorsReq); - rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, DixReadAccess); if (rc == Success) { @@ -2795,7 +2815,7 @@ ProcLookupColor(ClientPtr client) REQUEST(xLookupColorReq); REQUEST_FIXED_SIZE(xLookupColorReq, stuff->nbytes); - rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, DixReadAccess); if (rc == Success) { @@ -2844,14 +2864,14 @@ ProcCreateCursor (ClientPtr client) REQUEST_SIZE_MATCH(xCreateCursorReq); LEGAL_NEW_RESOURCE(stuff->cid, client); - rc = dixLookupResource((pointer *)&src, stuff->source, RT_PIXMAP, client, + rc = dixLookupResourceByType((pointer *)&src, stuff->source, RT_PIXMAP, client, DixReadAccess); if (rc != Success) { client->errorValue = stuff->source; return (rc == BadValue) ? BadPixmap : rc; } - rc = dixLookupResource((pointer *)&msk, stuff->mask, RT_PIXMAP, client, + rc = dixLookupResourceByType((pointer *)&msk, stuff->mask, RT_PIXMAP, client, DixReadAccess); if (rc != Success) { @@ -2949,7 +2969,7 @@ ProcFreeCursor (ClientPtr client) REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); - rc = dixLookupResource((pointer *)&pCursor, stuff->id, RT_CURSOR, client, + rc = dixLookupResourceByType((pointer *)&pCursor, stuff->id, RT_CURSOR, client, DixDestroyAccess); if (rc == Success) { |