diff options
author | Dave Airlie <airlied@redhat.com> | 2015-01-23 16:28:28 +1000 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2015-01-23 09:06:36 -0800 |
commit | b3e496c6d21058147de9a11b78860e73c74db3cb (patch) | |
tree | f827d2c13f4d8dc26417d5d112342883bd296a01 /glamor | |
parent | 5af2f5b7d2f955586d0cb40eb30812f1893db22e (diff) |
glamor: use screen blockhandler rather than dix one (v3)
This adds glamor into the block handler call chain
in the correct place.
This should fix interactions between glamor and drivers
requiring damage from glamor.
v2: okay don't consolidate, just leave things wierd for now
remove blcokhandler in screen close.
v3: block handler wrapping the right way.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'glamor')
-rw-r--r-- | glamor/glamor.c | 23 | ||||
-rw-r--r-- | glamor/glamor_priv.h | 1 |
2 files changed, 12 insertions, 12 deletions
diff --git a/glamor/glamor.c b/glamor/glamor.c index 78e827809..017266a85 100644 --- a/glamor/glamor.c +++ b/glamor/glamor.c @@ -249,20 +249,20 @@ glamor_block_handler(ScreenPtr screen) } static void -_glamor_block_handler(void *data, OSTimePtr timeout, void *last_select_mask) +_glamor_block_handler(ScreenPtr screen, void *timeout, void *readmask) { - glamor_screen_private *glamor_priv = data; + glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); + + screen->BlockHandler = glamor_priv->saved_procs.block_handler; + screen->BlockHandler(screen, timeout, readmask); + glamor_priv->saved_procs.block_handler = screen->BlockHandler; + screen->BlockHandler = _glamor_block_handler; glamor_make_current(glamor_priv); glFlush(); } static void -_glamor_wakeup_handler(void *data, int result, void *last_select_mask) -{ -} - -static void glamor_set_debug_level(int *debug_level) { char *debug_level_string; @@ -443,11 +443,9 @@ glamor_init(ScreenPtr screen, unsigned int flags) goto fail; if (flags & GLAMOR_USE_SCREEN) { - if (!RegisterBlockAndWakeupHandlers(_glamor_block_handler, - _glamor_wakeup_handler, - glamor_priv)) { - goto fail; - } + + glamor_priv->saved_procs.block_handler = screen->BlockHandler; + screen->BlockHandler = _glamor_block_handler; glamor_priv->saved_procs.create_gc = screen->CreateGC; screen->CreateGC = glamor_create_gc; @@ -597,6 +595,7 @@ glamor_close_screen(ScreenPtr screen) glamor_priv->saved_procs.change_window_attributes; screen->CopyWindow = glamor_priv->saved_procs.copy_window; screen->BitmapToRegion = glamor_priv->saved_procs.bitmap_to_region; + screen->BlockHandler = glamor_priv->saved_procs.block_handler; } #ifdef RENDER if (ps && (flags & GLAMOR_USE_PICTURE_SCREEN)) { diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h index f69949790..ed6e2d192 100644 --- a/glamor/glamor_priv.h +++ b/glamor/glamor_priv.h @@ -215,6 +215,7 @@ struct glamor_saved_procs { #if XSYNC SyncScreenFuncsRec sync_screen_funcs; #endif + ScreenBlockHandlerProcPtr block_handler; }; #define CACHE_FORMAT_COUNT 3 |