summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac3
-rw-r--r--glamor/glamor_egl.c4
-rw-r--r--include/dix-config.h.in3
3 files changed, 10 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 110027dbd..ac11e6572 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2166,6 +2166,9 @@ if test "x$GLAMOR" = xyes; then
AC_MSG_ERROR([Glamor for Xorg requires $LIBGBM])
fi
fi
+
+ PKG_CHECK_MODULES(LIBDRM, "libdrm >= 2.4.74",
+ [AC_DEFINE(GLAMOR_HAS_DRM_NAME_FROM_FD_2, 1, [Have GLAMOR_HAS_DRM_NAME_FROM_FD_2])], [])
fi
AM_CONDITIONAL([GLAMOR_EGL], [test "x$GBM" = xyes])
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 4bde637a0..ca94227cc 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -685,7 +685,11 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
/* To do DRI3 device FD generation, we need to open a new fd
* to the same device we were handed in originally.
*/
+#ifdef GLAMOR_HAS_DRM_NAME_FROM_FD_2
+ glamor_egl->device_path = drmGetDeviceNameFromFd2(glamor_egl->fd);
+#else
glamor_egl->device_path = drmGetDeviceNameFromFd(glamor_egl->fd);
+#endif
if (!dri3_screen_init(screen, &glamor_dri3_info)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index d357910a6..c3f956d67 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -518,6 +518,9 @@
/* Build glamor/gbm has linear support */
#undef GLAMOR_HAS_GBM_LINEAR
+/* Build glamor use new drmGetDeviceNameFromFD2 */
+#undef GLAMOR_HAS_DRM_NAME_FROM_FD_2
+
/* byte order */
#undef X_BYTE_ORDER