From 43dbc556f3a4d743b9121d6cfc21961be4a9da56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 24 Dec 2015 16:43:44 +0900 Subject: [PATCH] xfree86/modes: Remove xf86_reload_cursors v2 No longer needed now that xf86CursorResetCursor is getting called for each CRTC configuration change. v2: Keep xf86_reload_cursors as a deprecated empty inline function until all drivers stop calling it. (Adam Jackson) Reviewed-by: Adam Jackson --- .../drivers/modesetting/drmmode_display.c | 5 -- hw/xfree86/modes/xf86Crtc.h | 10 +--- hw/xfree86/modes/xf86Cursors.c | 57 ------------------- 3 files changed, 3 insertions(+), 69 deletions(-) diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index 8ca0c26a1..bf21320ce 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -508,11 +508,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, } } -#if 0 - if (pScrn->pScreen && - !xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) - xf86_reload_cursors(pScrn->pScreen); -#endif done: if (!ret) { crtc->x = saved_x; diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index 8b0160845..bdcfa131a 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -968,14 +968,10 @@ extern _X_EXPORT Bool xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags); /** - * Called when anything on the screen is reconfigured. - * - * Reloads cursor images as needed, then adjusts cursor positions. - * - * Driver should call this from crtc commit function. + * Superseeded by xf86CursorResetCursor, which is getting called + * automatically when necessary. */ -extern _X_EXPORT void - xf86_reload_cursors(ScreenPtr screen); +static _X_INLINE _X_DEPRECATED void xf86_reload_cursors(ScreenPtr screen) {} /** * Called from EnterVT to turn the cursors back on diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c index 351777b0d..6293b7332 100644 --- a/hw/xfree86/modes/xf86Cursors.c +++ b/hw/xfree86/modes/xf86Cursors.c @@ -640,63 +640,6 @@ xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags) return xf86InitCursor(screen, cursor_info); } -/** - * Called when anything on the screen is reconfigured. - * - * Reloads cursor images as needed, then adjusts cursor positions - * @note We assume that all hardware cursors to be loaded have already been - * found to be usable by the hardware. - */ - -void -xf86_reload_cursors(ScreenPtr screen) -{ - ScrnInfoPtr scrn; - xf86CrtcConfigPtr xf86_config; - xf86CursorInfoPtr cursor_info; - CursorPtr cursor; - int x, y; - xf86CursorScreenPtr cursor_screen_priv; - - /* initial mode setting will not have set a screen yet. - May be called before the devices are initialised. - */ - if (!screen || !inputInfo.pointer) - return; - cursor_screen_priv = dixLookupPrivate(&screen->devPrivates, - xf86CursorScreenKey); - /* return if HW cursor is inactive, to avoid displaying two cursors */ - if (!cursor_screen_priv || !cursor_screen_priv->isUp) - return; - - scrn = xf86ScreenToScrn(screen); - xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - - /* make sure the cursor code has been initialized */ - cursor_info = xf86_config->cursor_info; - if (!cursor_info) - return; - - cursor = xf86CurrentCursor(screen); - GetSpritePosition(inputInfo.pointer, &x, &y); - if (!(cursor_info->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN)) - (*cursor_info->HideCursor) (scrn); - - if (cursor) { - void *src = - dixLookupScreenPrivate(&cursor->devPrivates, CursorScreenKey, - screen); - if (cursor->bits->argb && xf86DriverHasLoadCursorARGB(cursor_info)) - xf86DriverLoadCursorARGB(cursor_info, cursor); - else if (src) - xf86DriverLoadCursorImage(cursor_info, src); - - x += scrn->frameX0 + cursor_screen_priv->HotX; - y += scrn->frameY0 + cursor_screen_priv->HotY; - (*cursor_info->SetCursorPosition) (scrn, x, y); - } -} - /** * Clean up CRTC-based cursor code */