summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-03-05 22:29:38 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-03-05 22:29:38 +0000
commitb39d9f9166547effe066acfc3327dd88a019d273 (patch)
tree44f5bf8f24371cb5c8ba2ad7d4bcf4ceca4d1621
parentf30b0beea4f5657a60eb5b286f41105298fa451a (diff)
sna: Check for flush at the start of every WriteToClient
The goal is to simply avoid the flush before going to sleep when we have no pending events. That is we only want to flush when we know there will be at least on X_Reply sent to a Client. (Preferably, it would a Damage reply!) We can safe assume that every WriteToClient marks the beginning of a new reply added to the Client output queue and thus know that upon the next flush event we will emitting a Reply and so need to submit our batches. Second attempt to fix a438e4ac. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 709f29d4..460fbb32 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -11460,11 +11460,14 @@ sna_accel_reply_callback(CallbackListPtr *list,
pointer user_data, pointer call_data)
{
struct sna *sna = user_data;
- ReplyInfoRec *info = call_data;
- if (sna->flush || !info->startOfReply)
+ if (sna->flush)
return;
+ /* Assume each callback corresponds to a new request. The use
+ * of continuation WriteToClients in the server is relatively rare,
+ * and we err on the side of safety.
+ */
sna->flush = (sna->kgem.flush || sna->kgem.sync ||
!list_is_empty(&sna->dirty_pixmaps));
}