Commit 65b6a62b authored by Michel Dänzer's avatar Michel Dänzer Committed by Mike Gabriel

dix: Pass ClientPtr to FlushCallback

Backported X.org commits: commit b380f3ac51f40ffefcde7d3db5c4c149f274246d Author: Michel Dänzer <michel.daenzer@amd.com> Date: Tue Aug 2 17:53:01 2016 +0900 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: 's avatarAdam Jackson <ajax@redha.com> Signed-off-by: 's avatarMichel Dänzer <michel.daenzer@amd.com> commit c65f610e12f9df168d5639534ed3c2bd40afffc8 Author: Kristian Høgsberg <krh@bitplanet.net> Date: Thu Jul 29 18:52:35 2010 -0400 Always call the flush callback chain when we flush client buffers We were missing the callback in a couple of places. Drivers may use the flush callback to submit batched up rendering before events (for example, damage events) are sent out, to ensure that the rendering has been queued when the client receives the event. Signed-off-by: 's avatarKristian Høgsberg <krh@bitplanet.net> Reviewed-by: 's avatarKeith Packard <keithp@keithp.com> Backported-to-NX-by: 's avatarMike Gabriel <mike.gabriel@das-netzwerkteam.de>
parent af7c3750
...@@ -987,6 +987,9 @@ CloseDownConnection(ClientPtr client) ...@@ -987,6 +987,9 @@ CloseDownConnection(ClientPtr client)
{ {
OsCommPtr oc = (OsCommPtr)client->osPrivate; OsCommPtr oc = (OsCommPtr)client->osPrivate;
if (FlushCallback)
CallCallbacks(&FlushCallback, client);
if (oc->output && oc->output->count) if (oc->output && oc->output->count)
FlushClient(client, oc, (char *)NULL, 0); FlushClient(client, oc, (char *)NULL, 0);
#ifdef XDMCP #ifdef XDMCP
......
...@@ -755,9 +755,6 @@ FlushAllOutput(void) ...@@ -755,9 +755,6 @@ FlushAllOutput(void)
fd_set newOutputPending; fd_set newOutputPending;
#endif #endif
if (FlushCallback)
CallCallbacks(&FlushCallback, NULL);
if (!newoutput) if (!newoutput)
return; return;
...@@ -1008,6 +1005,9 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount) ...@@ -1008,6 +1005,9 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
if (!notWritten) if (!notWritten)
return 0; return 0;
if (FlushCallback)
CallCallbacks(&FlushCallback, who);
todo = notWritten; todo = notWritten;
while (notWritten) { while (notWritten) {
long before = written; /* amount of whole thing written */ long before = written; /* amount of whole thing written */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment