[PATCH xserver 4/4] xfree86/modes: Remove xf86_reload_cursors v2

Keith Packard keithp at keithp.com
Sun Jun 5 03:27:38 UTC 2016


From: Michel Dänzer <michel.daenzer at amd.com>

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 <ajax at redhat.com>
---
 hw/xfree86/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 8ca0c26..bf21320 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 8b01608..bdcfa13 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 351777b..6293b73 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -641,63 +641,6 @@ 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
- * @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
  */
 void
-- 
2.8.1



More information about the xorg-devel mailing list