diff mbox

[1/3] Update for glamor in the 1.16 server.

Message ID 1397082263-21043-1-git-send-email-eric@anholt.net (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Anholt April 9, 2014, 10:24 p.m. UTC
We should link against the server's copy, insted of using the external
library.
---
 configure.ac           |  6 ++++--
 src/uxa/intel_glamor.c | 14 +++++++++++++-
 2 files changed, 17 insertions(+), 3 deletions(-)

Comments

Chris Wilson April 10, 2014, 3:21 p.m. UTC | #1
On Wed, Apr 09, 2014 at 03:24:21PM -0700, Eric Anholt wrote:
> We should link against the server's copy, insted of using the external
> library.

Thank you, series pushed.
-Chris
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index ce4822f..8bbb3b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -322,8 +322,10 @@  if test "x$GLAMOR" != "xno"; then
 	if test "x$UXA" != "xyes"; then
 		AC_MSG_ERROR([Glamor acceleration requested but UXA is not enabled])
 	fi
-	PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.3.1])
-	PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
+	if ! pkg-config --exists "xorg-server >= 1.15.99.901"; then
+		PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.3.1])
+		PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
+	fi
 	AC_DEFINE(USE_GLAMOR, 1, [Enable glamor acceleration])
 fi
 
diff --git a/src/uxa/intel_glamor.c b/src/uxa/intel_glamor.c
index 4d1c767..e0e5b2b 100644
--- a/src/uxa/intel_glamor.c
+++ b/src/uxa/intel_glamor.c
@@ -204,11 +204,23 @@  intel_glamor_init(ScreenPtr screen)
 {
 	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
 	intel_screen_private *intel = intel_get_screen_private(scrn);
+	Bool ret;
 
 	if ((intel->uxa_flags & UXA_GLAMOR_EGL_INITIALIZED) == 0)
 		goto fail;
 
-	if (!glamor_init(screen, GLAMOR_INVERTED_Y_AXIS | GLAMOR_USE_EGL_SCREEN)) {
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,900,0)
+	/* Not doing DRI3 yet, since Present support hasn't landed. */
+	ret = glamor_init(screen,
+			  GLAMOR_INVERTED_Y_AXIS |
+			  GLAMOR_USE_EGL_SCREEN |
+			  GLAMOR_NO_DRI3);
+#else
+	ret = glamor_init(screen,
+			  GLAMOR_INVERTED_Y_AXIS |
+			  GLAMOR_USE_EGL_SCREEN);
+#endif
+	if (!ret) {
 		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
 			   "Failed to initialize glamor.\n");
 		goto fail;