summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-08-02 17:53:01 +0900
committerAdam Jackson <ajax@redhat.com>2016-08-15 14:02:48 -0400
commitb380f3ac51f40ffefcde7d3db5c4c149f274246d (patch)
tree88c47b4884927527f9d16ba9ce80dd3cc59f0215 /os
parent92b3cd32066aa5befa67a408cc079cd2ce4c077e (diff)
dix: Pass ClientPtr to FlushCallback
This change has two effects: 1. Only calls FlushCallbacks when we're actually flushing data to a client. The unnecessary FlushCallback calls could cause significant performance degradation with compositing, which is significantly reduced even without any driver changes. 2. By passing the ClientPtr to FlushCallbacks, drivers can completely eliminate unnecessary flushing of GPU commands by keeping track of whether we're flushing any XDamageNotify events to the client for which the corresponding rendering commands haven't been flushed to the GPU yet. Reviewed-by: Adam Jackson <ajax@redha.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'os')
-rw-r--r--os/connection.c2
-rw-r--r--os/io.c9
2 files changed, 4 insertions, 7 deletions
diff --git a/os/connection.c b/os/connection.c
index 4294ee7eb..a901ebf3c 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -908,7 +908,7 @@ CloseDownConnection(ClientPtr client)
OsCommPtr oc = (OsCommPtr) client->osPrivate;
if (FlushCallback)
- CallCallbacks(&FlushCallback, NULL);
+ CallCallbacks(&FlushCallback, client);
if (oc->output)
FlushClient(client, oc, (char *) NULL, 0);
diff --git a/os/io.c b/os/io.c
index 88edf1272..ff0ec3da7 100644
--- a/os/io.c
+++ b/os/io.c
@@ -598,9 +598,6 @@ FlushAllOutput(void)
register ClientPtr client, tmp;
Bool newoutput = NewOutputPending;
- if (FlushCallback)
- CallCallbacks(&FlushCallback, NULL);
-
if (!newoutput)
return;
@@ -767,9 +764,6 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
NewOutputPending = FALSE;
}
- if (FlushCallback)
- CallCallbacks(&FlushCallback, NULL);
-
return FlushClient(who, oc, buf, count);
}
@@ -815,6 +809,9 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
if (!notWritten)
return 0;
+ if (FlushCallback)
+ CallCallbacks(&FlushCallback, who);
+
todo = notWritten;
while (notWritten) {
long before = written; /* amount of whole thing written */