Check for xf86CursorResetCursor()

If it's available, xorg-server calls it on each mode configuration change. It
does what xf86_reload_cursors does (and more), so we don't need to call
the latter anymore.

Avoids gcc 8.2 warning:

drmmode_display.c: In function ‘drmmode_set_mode_major’:
drmmode_display.c:525:2: warning: ‘xf86_reload_cursors’ is deprecated [-Wdeprecated-declarations]
  xf86_reload_cursors(crtc->scrn->pScreen);
  ^~~~~~~~~~~~~~~~~~~
In file included from nv_type.h:10,
                 from nv_include.h:69,
                 from drmmode_display.c:36:
/usr/include/xorg/xf86Crtc.h:1068:37: note: declared here
 static _X_INLINE _X_DEPRECATED void xf86_reload_cursors(ScreenPtr screen) {}
                                     ^~~~~~~~~~~~~~~~~~~

(Ported from radeon commit d670c5c9851b4eff21c845d26c7d7e4eb5ee0fa9)

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
This commit is contained in:
Rhys Kidd
2019-01-19 15:45:36 -05:00
committed by Ilia Mirkin
parent a4283f7fee
commit cc284803fd
2 changed files with 10 additions and 0 deletions

View File

@@ -127,6 +127,12 @@ AC_SUBST([DRIVER_NAME])
XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
AC_CHECK_DECL(xf86CursorResetCursor,
[AC_DEFINE(HAVE_XF86_CURSOR_RESET_CURSOR, 1,
[Have xf86CursorResetCursor API])], [],
[#include <xorg-server.h>
#include <xf86Cursor.h>])
AC_CHECK_HEADERS([list.h],
[have_list_h="yes"], [have_list_h="no"],
[#include <X11/Xdefs.h>

View File

@@ -522,7 +522,11 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green,
crtc->gamma_blue, crtc->gamma_size);
#ifdef HAVE_XF86_CURSOR_RESET_CURSOR
xf86CursorResetCursor(crtc->scrn->pScreen);
#else
xf86_reload_cursors(crtc->scrn->pScreen);
#endif
return TRUE;
}