From 8b87ce19741753eafbd99e7093bc3dea8f26e838 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 4 Nov 2006 17:41:25 -0800 Subject: [PATCH] Allow X server to build against libdrm 2.1 --- configure.ac | 3 +++ hw/xfree86/os-support/drm/xf86drm.c | 2 ++ hw/xfree86/os-support/xf86drm.h | 2 ++ include/dix-config.h.in | 3 +++ 4 files changed, 10 insertions(+) diff --git a/configure.ac b/configure.ac index 195211cb9..cb194aee6 100644 --- a/configure.ac +++ b/configure.ac @@ -619,6 +619,9 @@ if test "x$DRI" = xyes; then PKG_CHECK_MODULES([DRIPROTO], [xf86driproto]) PKG_CHECK_MODULES([LIBDRM], [libdrm]) PKG_CHECK_MODULES([GL], [glproto >= 1.4.1]) + PKG_CHECK_EXISTS(libdrm >= 2.2.0, + [AC_DEFINE([HAVE_LIBDRM_2_2], 1, + [Has version 2.2 (or newer) of the drm library])]) AC_SUBST(DRIPROTO_CFLAGS) AC_SUBST(LIBDRM_CFLAGS) AC_SUBST(GL_CFLAGS) diff --git a/hw/xfree86/os-support/drm/xf86drm.c b/hw/xfree86/os-support/drm/xf86drm.c index e990e286b..8bcccee2a 100644 --- a/hw/xfree86/os-support/drm/xf86drm.c +++ b/hw/xfree86/os-support/drm/xf86drm.c @@ -2307,6 +2307,7 @@ int drmRemoveSIGIOHandler(int fd) return xf86RemoveSIGIOHandler(fd); } +#if HAVE_LIBDRM_2_2 /* * Valid flags are * DRM_FENCE_FLAG_EMIT @@ -3260,3 +3261,4 @@ int drmMMUnlock(int fd, unsigned memType) return ret; } +#endif /* HAVE_LIBDRM_2_2 */ diff --git a/hw/xfree86/os-support/xf86drm.h b/hw/xfree86/os-support/xf86drm.h index 18e4564d1..1d93f6f90 100644 --- a/hw/xfree86/os-support/xf86drm.h +++ b/hw/xfree86/os-support/xf86drm.h @@ -36,7 +36,9 @@ #define _XF86DRM_H_ #include +#if HAVE_LIBDRM_2_2 #include +#endif /* Defaults, if nothing set in xf86config */ #define DRM_DEV_UID 0 diff --git a/include/dix-config.h.in b/include/dix-config.h.in index 35700e460..84d693f5c 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -127,6 +127,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have version 2.2 (or newer) of the drm library */ +#undef HAVE_LIBDRM_2_2 + /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM