Nouveau Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rhys Kidd <rhyskidd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH xf86-video-nouveau] Check for xf86CursorResetCursor()
Date: Sat, 19 Jan 2019 15:45:36 -0500	[thread overview]
Message-ID: <20190119204536.29763-1-rhyskidd@gmail.com> (raw)

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>
---
 configure.ac          | 6 ++++++
 src/drmmode_display.c | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/configure.ac b/configure.ac
index 0b01d3e..56a971f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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>
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 2480122..2ca49bd 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -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;
 }
-- 
2.19.1

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

                 reply	other threads:[~2019-01-19 20:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190119204536.29763-1-rhyskidd@gmail.com \
    --to=rhyskidd-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox