diff options
author | Keith Packard <keithp@keithp.com> | 2016-05-26 12:11:46 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2016-06-20 11:54:57 -0700 |
commit | fb1edccf3c90c626f120b3c399657f24d3f7901e (patch) | |
tree | 33c984e95b4e3ecf8eac169d5fa736e34953dfc4 /miext | |
parent | a134d1e7eada0ac90fb622f45833c87b72c9aa06 (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 'miext')
-rw-r--r-- | miext/shadow/shadow.c | 20 | ||||
-rw-r--r-- | miext/shadow/shadow.h | 1 |
2 files changed, 8 insertions, 13 deletions
diff --git a/miext/shadow/shadow.c b/miext/shadow/shadow.c index 0dd3604a7..405c4dddb 100644 --- a/miext/shadow/shadow.c +++ b/miext/shadow/shadow.c @@ -65,16 +65,15 @@ shadowRedisplay(ScreenPtr pScreen) } static void -shadowBlockHandler(void *data, OSTimePtr pTimeout, void *pRead) +shadowBlockHandler(ScreenPtr pScreen, void *timeout, void *pRead) { - ScreenPtr pScreen = (ScreenPtr) data; + shadowBuf(pScreen); shadowRedisplay(pScreen); -} -static void -shadowWakeupHandler(void *data, int i, void *LastSelectMask) -{ + unwrap(pBuf, pScreen, BlockHandler); + pScreen->BlockHandler(pScreen, timeout, pRead); + wrap(pBuf, pScreen, BlockHandler); } static void @@ -100,6 +99,7 @@ shadowCloseScreen(ScreenPtr pScreen) unwrap(pBuf, pScreen, GetImage); unwrap(pBuf, pScreen, CloseScreen); + unwrap(pBuf, pScreen, BlockHandler); shadowRemove(pScreen, pBuf->pPixmap); DamageDestroy(pBuf->pDamage); if (pBuf->pPixmap) @@ -132,6 +132,7 @@ shadowSetup(ScreenPtr pScreen) wrap(pBuf, pScreen, CloseScreen); wrap(pBuf, pScreen, GetImage); + wrap(pBuf, pScreen, BlockHandler); pBuf->update = 0; pBuf->window = 0; pBuf->pPixmap = 0; @@ -148,10 +149,6 @@ shadowAdd(ScreenPtr pScreen, PixmapPtr pPixmap, ShadowUpdateProc update, { shadowBuf(pScreen); - if (!RegisterBlockAndWakeupHandlers(shadowBlockHandler, shadowWakeupHandler, - (void *) pScreen)) - return FALSE; - /* * Map simple rotation values to bitmasks; fortunately, * these are all unique @@ -192,7 +189,4 @@ shadowRemove(ScreenPtr pScreen, PixmapPtr pPixmap) pBuf->closure = 0; pBuf->pPixmap = 0; } - - RemoveBlockAndWakeupHandlers(shadowBlockHandler, shadowWakeupHandler, - (void *) pScreen); } diff --git a/miext/shadow/shadow.h b/miext/shadow/shadow.h index 86fa94479..7f22169dc 100644 --- a/miext/shadow/shadow.h +++ b/miext/shadow/shadow.h @@ -54,6 +54,7 @@ typedef struct _shadowBuf { /* screen wrappers */ GetImageProcPtr GetImage; CloseScreenProcPtr CloseScreen; + ScreenBlockHandlerProcPtr BlockHandler; } shadowBufRec; /* Match defines from randr extension */ |