summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-05-26 12:11:46 -0700
committerKeith Packard <keithp@keithp.com>2016-06-20 11:54:57 -0700
commitfb1edccf3c90c626f120b3c399657f24d3f7901e (patch)
tree33c984e95b4e3ecf8eac169d5fa736e34953dfc4 /dix
parenta134d1e7eada0ac90fb622f45833c87b72c9aa06 (diff)
dix: Call screen block/wakeup handlers closest to blocking [v3]
The screen block and wakeup handlers are the only ones which provide a well known ordering between the wrapping layers; placing these as close as possible to the server blocking provides a way for the driver to control the flow of execution correctly. Switch the shadow code to run in the screen block handler so that it now occurrs just before the server goes to sleep. Switch glamor to call down to the driver after it has executed its own block handler piece, in case the driver needs to perform additional flushing work after glamor has called glFlush. These changes ensure that the following modules update the screen in the correct order: animated cursors (uses RegisterBlockAndWakeupHandlers dynamically) composite (dynamic wrapping) misprite (dynamic wrapping) shadow (static wrapping) glamor (static wrapping) driver (static wrapping) It looks like there's still a bit of confusion between composite and misprite; if composite updates after misprite, then it's possible you'd exit the block handler chain with the cursor left hidden. To fix that, misprite should be wrapping during ScreenInit time and not unwrapping. And composite might as well join in that fun, just to make things consistent. [v2] Unwrap BlockHandler in shadowCloseScreen (ajax) [v3] ephyr: Use screen block handler for flushing changes ephyr needs to make sure it calls glXSwapBuffers after glamor finishes its rendering. As the screen block handler is now called last, we have to use that instead of a registered block/wakeup handler to make sure the GL rendering is done before we copy it to the front buffer. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'dix')
-rw-r--r--dix/dixutils.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/dix/dixutils.c b/dix/dixutils.c
index b6b002385..3d2e7a3c5 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -383,16 +383,19 @@ BlockHandler(void *pTimeout, void *pReadmask)
int i, j;
++inHandler;
- for (i = 0; i < screenInfo.numScreens; i++)
- (*screenInfo.screens[i]->BlockHandler) (screenInfo.screens[i],
- pTimeout, pReadmask);
- for (i = 0; i < screenInfo.numGPUScreens; i++)
- (*screenInfo.gpuscreens[i]->BlockHandler) (screenInfo.gpuscreens[i],
- pTimeout, pReadmask);
for (i = 0; i < numHandlers; i++)
if (!handlers[i].deleted)
(*handlers[i].BlockHandler) (handlers[i].blockData,
pTimeout, pReadmask);
+
+ for (i = 0; i < screenInfo.numGPUScreens; i++)
+ (*screenInfo.gpuscreens[i]->BlockHandler) (screenInfo.gpuscreens[i],
+ pTimeout, pReadmask);
+
+ for (i = 0; i < screenInfo.numScreens; i++)
+ (*screenInfo.screens[i]->BlockHandler) (screenInfo.screens[i],
+ pTimeout, pReadmask);
+
if (handlerDeleted) {
for (i = 0; i < numHandlers;)
if (handlers[i].deleted) {
@@ -418,16 +421,16 @@ WakeupHandler(int result, void *pReadmask)
int i, j;
++inHandler;
- for (i = numHandlers - 1; i >= 0; i--)
- if (!handlers[i].deleted)
- (*handlers[i].WakeupHandler) (handlers[i].blockData,
- result, pReadmask);
for (i = 0; i < screenInfo.numScreens; i++)
(*screenInfo.screens[i]->WakeupHandler) (screenInfo.screens[i],
result, pReadmask);
for (i = 0; i < screenInfo.numGPUScreens; i++)
(*screenInfo.gpuscreens[i]->WakeupHandler) (screenInfo.gpuscreens[i],
result, pReadmask);
+ for (i = numHandlers - 1; i >= 0; i--)
+ if (!handlers[i].deleted)
+ (*handlers[i].WakeupHandler) (handlers[i].blockData,
+ result, pReadmask);
if (handlerDeleted) {
for (i = 0; i < numHandlers;)
if (handlers[i].deleted) {