[PATCH] Build against glamor in the xserver tree if available

Michel Dänzer michel at daenzer.net
Thu Mar 13 01:03:59 PDT 2014


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

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 configure.ac        | 20 ++++++++++++++++----
 src/radeon_glamor.c |  3 +++
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 200f979..534d0a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -104,13 +104,25 @@ AC_ARG_ENABLE(glamor,
 			     [Disable glamor, a new GL-based acceleration [default=enabled]]),
 	      [GLAMOR="$enableval"],
 	      [GLAMOR=yes])
-AC_MSG_RESULT([$GLAMOR])
-AM_CONDITIONAL(GLAMOR, test x$GLAMOR != xno)
+
 if test "x$GLAMOR" != "xno"; then
-	PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.6.0])
-	PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
+	AC_CHECK_HEADERS([glamor.h], [GLAMOR_H="yes"], [GLAMOR_H="no"], [])
+
+	if test "x$GLAMOR_H" = xyes; then
+		AC_CHECK_DECL(GLAMOR_NO_DRI3,
+			      [GLAMOR_XSERVER="yes"], [GLAMOR_XSERVER="no"],
+			      [#include "glamor.h"])
+	fi
+
+	if test "x$GLAMOR_XSERVER" != xyes; then
+		PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.6.0])
+		PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
+	fi
 	AC_DEFINE(USE_GLAMOR, 1, [Enable glamor acceleration])
+else
+	AC_MSG_RESULT([$GLAMOR])
 fi
+AM_CONDITIONAL(GLAMOR, test x$GLAMOR != xno)
 
 AC_CHECK_HEADERS([list.h],
 		 [have_list_h="yes"], [have_list_h="no"],
diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
index 1d666d1..b7dede8 100644
--- a/src/radeon_glamor.c
+++ b/src/radeon_glamor.c
@@ -318,6 +318,9 @@ radeon_glamor_init(ScreenPtr screen)
 	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
 
 	if (!glamor_init(screen, GLAMOR_INVERTED_Y_AXIS | GLAMOR_USE_EGL_SCREEN |
+#ifdef GLAMOR_NO_DRI3
+			 GLAMOR_NO_DRI3 |
+#endif
 			 GLAMOR_USE_SCREEN | GLAMOR_USE_PICTURE_SCREEN)) {
 		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
 			   "Failed to initialize glamor.\n");
-- 
1.9.0



More information about the xorg-driver-ati mailing list