xserver: Branch 'master'

Adam Jackson ajax at kemper.freedesktop.org
Mon Aug 11 10:53:12 PDT 2008


 configure.ac             |    1 -
 damageext/damageext.c    |    2 --
 dix/dispatch.c           |   16 ----------------
 dix/events.c             |    2 --
 include/dix-config.h.in  |    3 ---
 include/dixstruct.h      |    4 ----
 include/xorg-server.h.in |    3 ---
 os/WaitFor.c             |   14 --------------
 os/io.c                  |    6 ------
 os/osinit.c              |    4 ----
 os/utils.c               |    8 --------
 11 files changed, 63 deletions(-)

New commits:
commit 9f9268821b13038556fbc029df54ab0e9b2aa77f
Author: Mathieu Bérard <mathieu.berard at crans.org>
Date:   Mon Aug 11 13:52:38 2008 -0400

    The smart scheduler is not optional.

diff --git a/configure.ac b/configure.ac
index 0769cb3..5155dbd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1041,7 +1041,6 @@ AC_SUBST([VENDOR_NAME_SHORT])
 AC_SUBST([VENDOR_RELEASE])
 AC_SUBST([VENDOR_MAN_VERSION])
 
-AC_DEFINE(SMART_SCHEDULE, 1, [Include time-based scheduler])
 AC_DEFINE(NO_LIBCWRAPPER, 1, [Define to 1 if modules should avoid the libcwrapper])
 
 if test "x$DEBUGGING" = xyes; then
diff --git a/damageext/damageext.c b/damageext/damageext.c
index 517c72d..7dd328a 100755
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -90,9 +90,7 @@ DamageExtNotify (DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes)
     if (pDamageClient->critical > 0)
     {
 	SetCriticalOutputPending ();
-#ifdef SMART_SCHEDULE
 	pClient->smart_priority = SMART_MAX_PRIORITY;
-#endif
     }
 }
 
diff --git a/dix/dispatch.c b/dix/dispatch.c
index c04443b..202d2d9 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -237,7 +237,6 @@ UpdateCurrentTimeIf(void)
 	currentTime = systime;
 }
 
-#ifdef SMART_SCHEDULE
 
 #undef SMART_DEBUG
 
@@ -338,7 +337,6 @@ SmartScheduleClient (int *clientReady, int nready)
     }
     return best;
 }
-#endif
 
 #define MAJOROP ((xReq *)client->requestBuffer)->reqType
 
@@ -350,9 +348,7 @@ Dispatch(void)
     ClientPtr	client;
     int	nready;
     HWEventQueuePtr* icheck = checkForInput;
-#ifdef SMART_SCHEDULE
     long			start_tick;
-#endif
 
     nextFreeClientID = 1;
     nClients = 0;
@@ -371,13 +367,11 @@ Dispatch(void)
 
 	nready = WaitForSomething(clientReady);
 
-#ifdef SMART_SCHEDULE
 	if (nready && !SmartScheduleDisable)
 	{
 	    clientReady[0] = SmartScheduleClient (clientReady, nready);
 	    nready = 1;
 	}
-#endif
        /***************** 
 	*  Handle events in round robin fashion, doing input between 
 	*  each round 
@@ -399,16 +393,13 @@ Dispatch(void)
 	    }
 	    isItTimeToYield = FALSE;
  
-#ifdef SMART_SCHEDULE
 	    start_tick = SmartScheduleTime;
-#endif
 	    while (!isItTimeToYield)
 	    {
 	        if (*icheck[0] != *icheck[1])
 		    ProcessInputEvents();
 		
 		FlushIfCriticalOutputPending();
-#ifdef SMART_SCHEDULE
 		if (!SmartScheduleDisable && 
 		    (SmartScheduleTime - start_tick) >= SmartScheduleSlice)
 		{
@@ -417,7 +408,6 @@ Dispatch(void)
 			client->smart_priority--;
 		    break;
 		}
-#endif
 		/* now, finally, deal with client requests */
 
 	        result = ReadRequestFromClient(client);
@@ -465,11 +455,9 @@ Dispatch(void)
 	        }
 	    }
 	    FlushAllOutput();
-#ifdef SMART_SCHEDULE
 	    client = clients[clientReady[nready]];
 	    if (client)
 		client->smart_stop_tick = SmartScheduleTime;
-#endif
 	}
 	dispatchException &= ~DE_PRIORITYCHANGE;
     }
@@ -3453,9 +3441,7 @@ CloseDownClient(ClientPtr client)
 	if (client->index < nextFreeClientID)
 	    nextFreeClientID = client->index;
 	clients[client->index] = NullClient;
-#ifdef SMART_SCHEDULE
 	SmartLastClient = NullClient;
-#endif
 	dixFreePrivates(client->devPrivates);
 	xfree(client);
 
@@ -3505,12 +3491,10 @@ void InitClient(ClientPtr client, int i, pointer ospriv)
 #endif
     client->replyBytesRemaining = 0;
     client->fontResFunc = NULL;
-#ifdef SMART_SCHEDULE
     client->smart_priority = 0;
     client->smart_start_tick = SmartScheduleTime;
     client->smart_stop_tick = SmartScheduleTime;
     client->smart_check_tick = SmartScheduleTime;
-#endif
 
     client->clientPtr = NULL;
 }
diff --git a/dix/events.c b/dix/events.c
index f04433b..7a79d29 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2014,10 +2014,8 @@ TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents,
 
 	if (BitIsOn(criticalEvents, type))
 	{
-#ifdef SMART_SCHEDULE
 	    if (client->smart_priority < SMART_MAX_PRIORITY)
 		client->smart_priority++;
-#endif
 	    SetCriticalOutputPending();
 	}
 
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 6400b69..21d8d9c 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -252,9 +252,6 @@
 /* Support SHAPE extension */
 #undef SHAPE
 
-/* Include time-based scheduler */
-#undef SMART_SCHEDULE
-
 /* Define to 1 on systems derived from System V Release 4 */
 #undef SVR4
 
diff --git a/include/dixstruct.h b/include/dixstruct.h
index 306870c..aae2dbd 100644
--- a/include/dixstruct.h
+++ b/include/dixstruct.h
@@ -129,17 +129,14 @@ typedef struct _Client {
     struct _FontResolution * (*fontResFunc) (    /* no need for font.h */
 		ClientPtr	/* pClient */,
 		int *		/* num */);
-#ifdef SMART_SCHEDULE
     int	    smart_priority;
     long    smart_start_tick;
     long    smart_stop_tick;
     long    smart_check_tick;
-#endif
     
     DeviceIntPtr clientPtr;
 }           ClientRec;
 
-#ifdef SMART_SCHEDULE
 /*
  * Scheduling interface
  */
@@ -155,7 +152,6 @@ extern void SmartScheduleStopTimer(void);
 
 extern Bool SmartScheduleInit(void);
 
-#endif
 
 /* This prototype is used pervasively in Xext, dix */
 #define DISPATCH_PROC(func) int func(ClientPtr /* client */)
diff --git a/include/xorg-server.h.in b/include/xorg-server.h.in
index 8cb2b5a..b8803e7 100644
--- a/include/xorg-server.h.in
+++ b/include/xorg-server.h.in
@@ -61,9 +61,6 @@
 /* Support SHAPE extension */
 #undef SHAPE
 
-/* Include time-based scheduler */
-#undef SMART_SCHEDULE
-
 /* Define to 1 on systems derived from System V Release 4 */
 #undef SVR4
 
diff --git a/os/WaitFor.c b/os/WaitFor.c
index f07388b..d6dd995 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -155,9 +155,7 @@ WaitForSomething(int *pClientsReady)
     int nready;
     fd_set devicesReadable;
     CARD32 now = 0;
-#ifdef SMART_SCHEDULE
     Bool    someReady = FALSE;
-#endif
 
     FD_ZERO(&clientsReadable);
 
@@ -170,7 +168,6 @@ WaitForSomething(int *pClientsReady)
 	    ProcessWorkQueue();
 	if (XFD_ANYSET (&ClientsWithInput))
 	{
-#ifdef SMART_SCHEDULE
 	    if (!SmartScheduleDisable)
 	    {
 		someReady = TRUE;
@@ -179,13 +176,11 @@ WaitForSomething(int *pClientsReady)
 		wt = &waittime;
 	    }
 	    else
-#endif
 	    {
 		XFD_COPYSET (&ClientsWithInput, &clientsReadable);
 		break;
 	    }
 	}
-#ifdef SMART_SCHEDULE
 	if (someReady)
 	{
 	    XFD_COPYSET(&AllSockets, &LastSelectMask);
@@ -193,7 +188,6 @@ WaitForSomething(int *pClientsReady)
 	}
 	else
 	{
-#endif
         wt = NULL;
 	if (timers)
         {
@@ -215,11 +209,9 @@ WaitForSomething(int *pClientsReady)
 	    }
 	}
 	XFD_COPYSET(&AllSockets, &LastSelectMask);
-#ifdef SMART_SCHEDULE
 	}
 	SmartScheduleStopTimer ();
 
-#endif
 	BlockHandler((pointer)&wt, (pointer)&LastSelectMask);
 	if (NewOutputPending)
 	    FlushAllOutput();
@@ -237,9 +229,7 @@ WaitForSomething(int *pClientsReady)
 	}
 	selecterr = GetErrno();
 	WakeupHandler(i, (pointer)&LastSelectMask);
-#ifdef SMART_SCHEDULE
 	SmartScheduleStartTimer ();
-#endif
 	if (i <= 0) /* An error or timeout occurred */
 	{
 	    if (dispatchException)
@@ -263,7 +253,6 @@ WaitForSomething(int *pClientsReady)
 			strerror(selecterr));
 		}
 	    }
-#ifdef SMART_SCHEDULE
 	    else if (someReady)
 	    {
 		/*
@@ -273,7 +262,6 @@ WaitForSomething(int *pClientsReady)
 		XFD_COPYSET(&ClientsWithInput, &clientsReadable);
 		break;
 	    }
-#endif
 	    if (*checkForInput[0] != *checkForInput[1])
 		return 0;
 
@@ -310,10 +298,8 @@ WaitForSomething(int *pClientsReady)
                         return 0;
 	        }
 	    }
-#ifdef SMART_SCHEDULE
 	    if (someReady)
 		XFD_ORSET(&LastSelectMask, &ClientsWithInput, &LastSelectMask);
-#endif	    
 	    if (AnyClientsWriteBlocked && XFD_ANYSET (&clientsWritable))
 	    {
 		NewOutputPending = TRUE;
diff --git a/os/io.c b/os/io.c
index 723ff6a..3c0d494 100644
--- a/os/io.c
+++ b/os/io.c
@@ -411,11 +411,9 @@ ReadRequestFromClient(ClientPtr client)
 	    FD_SET(fd, &ClientsWithInput);
 	else
 	{
-#ifdef SMART_SCHEDULE
 	    if (!SmartScheduleDisable)
 		FD_CLR(fd, &ClientsWithInput);
 	    else
-#endif
 		YieldControlNoInput();
 	}
     }
@@ -423,16 +421,12 @@ ReadRequestFromClient(ClientPtr client)
     {
 	if (!gotnow)
 	    AvailableInput = oc;
-#ifdef SMART_SCHEDULE
 	if (!SmartScheduleDisable)
 	    FD_CLR(fd, &ClientsWithInput);
 	else
-#endif
 	    YieldControlNoInput();
     }
-#ifdef SMART_SCHEDULE
     if (SmartScheduleDisable)
-#endif
     if (++timesThisConnection >= MAX_TIMES_PER)
 	YieldControl();
     if (move_header)
diff --git a/os/osinit.c b/os/osinit.c
index 986a642..74e2457 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -55,9 +55,7 @@ SOFTWARE.
 #include "osdep.h"
 #include <X11/Xos.h>
 
-#ifdef SMART_SCHEDULE
 #include "dixstruct.h"
-#endif
 
 #ifndef PATH_MAX
 #ifdef MAXPATHLEN
@@ -199,11 +197,9 @@ OsInit(void)
      * log file name if logging to a file is desired.
      */
     LogInit(NULL, NULL);
-#ifdef SMART_SCHEDULE
     if (!SmartScheduleDisable)
 	if (!SmartScheduleInit ())
 	    SmartScheduleDisable = TRUE;
-#endif
 }
 
 void
diff --git a/os/utils.c b/os/utils.c
index 88a6495..96da35d 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -111,9 +111,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
 
 #include "opaque.h"
 
-#ifdef SMART_SCHEDULE
 #include "dixstruct.h"
-#endif
 
 #ifdef XKB
 #include <xkbsrv.h>
@@ -552,10 +550,8 @@ void UseMsg(void)
     ErrorF("+xinerama              Enable XINERAMA extension\n");
     ErrorF("-xinerama              Disable XINERAMA extension\n");
 #endif
-#ifdef SMART_SCHEDULE
     ErrorF("-dumbSched             Disable smart scheduling, enable old behavior\n");
     ErrorF("-schedInterval int     Set scheduler interval in msec\n");
-#endif
     ErrorF("+extension name        Enable extension\n");
     ErrorF("-extension name        Disable extension\n");
 #ifdef XDMCP
@@ -926,7 +922,6 @@ ProcessCommandLine(int argc, char *argv[])
 	    i = skip - 1;
 	}
 #endif
-#ifdef SMART_SCHEDULE
 	else if ( strcmp( argv[i], "-dumbSched") == 0)
 	{
 	    SmartScheduleDisable = TRUE;
@@ -950,7 +945,6 @@ ProcessCommandLine(int argc, char *argv[])
 	    else
 		UseMsg();
 	}
-#endif
 #ifdef RENDER
 	else if ( strcmp( argv[i], "-render" ) == 0)
 	{
@@ -1234,7 +1228,6 @@ XNFstrdup(const char *s)
     return sd;
 }
 
-#ifdef SMART_SCHEDULE
 
 #ifdef SIGVTALRM
 #define SMART_SCHEDULE_POSSIBLE
@@ -1310,7 +1303,6 @@ SmartScheduleInit (void)
     return FALSE;
 #endif
 }
-#endif
 
 #ifdef SIG_BLOCK
 static sigset_t	PreviousSignalMask;


More information about the xorg-commit mailing list