mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-19 03:00:34 +01:00
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>
This commit is contained in:
parent
92b3cd3206
commit
b380f3ac51
2 changed files with 4 additions and 7 deletions
|
|
@ -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);
|
||||
|
|
|
|||
9
os/io.c
9
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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue