summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-05-19 13:59:54 -0700
committerAdam Jackson <ajax@redhat.com>2016-07-21 15:04:47 -0400
commit8f1edf4bd3a1f050ce9eeb5eac45dd1a8f7a6d5e (patch)
treee2763a8e89c750ba2ab56c7b02f6ef42534f7cfb /include
parentd6eff3c31e8289881a3aa9b858e5710d0f741db0 (diff)
dix: Use list for ready clients
This converts the dispatch loop into using a list of ready clients instead of an array. This changes the WaitForSomething API so that it notifies DIX when a client becomes ready to read, instead of returning the set of ready clients. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/dixstruct.h15
-rw-r--r--include/os.h3
2 files changed, 16 insertions, 2 deletions
diff --git a/include/dixstruct.h b/include/dixstruct.h
index 8e70ae1fa..1f383497c 100644
--- a/include/dixstruct.h
+++ b/include/dixstruct.h
@@ -76,6 +76,7 @@ typedef struct _saveSet {
typedef struct _Client {
void *requestBuffer;
void *osPrivate; /* for OS layer, including scheduler */
+ struct xorg_list ready; /* List of clients ready to run */
Mask clientAsMask;
short index;
unsigned char majorOp, minorOp;
@@ -138,6 +139,20 @@ extern Bool SmartScheduleSignalEnable;
extern void SmartScheduleStartTimer(void);
extern void SmartScheduleStopTimer(void);
+/* Client has requests queued or data on the network */
+void mark_client_ready(ClientPtr client);
+
+/* Client has no requests queued and no data on network */
+void mark_client_not_ready(ClientPtr client);
+
+static inline Bool client_is_ready(ClientPtr client)
+{
+ return !xorg_list_is_empty(&client->ready);
+}
+
+Bool
+clients_are_ready(void);
+
#define SMART_MAX_PRIORITY (20)
#define SMART_MIN_PRIORITY (-20)
diff --git a/include/os.h b/include/os.h
index b0a068ed2..765562c80 100644
--- a/include/os.h
+++ b/include/os.h
@@ -96,8 +96,7 @@ extern _X_EXPORT void (*OsVendorVErrorFProc) (const char *,
_X_ATTRIBUTE_PRINTF(1, 0);
#endif
-extern _X_EXPORT int WaitForSomething(int * /*pClientsReady */
- );
+extern _X_EXPORT Bool WaitForSomething(Bool clients_are_ready);
extern _X_EXPORT int ReadRequestFromClient(ClientPtr /*client */ );