Commit 9232835b authored by Qiang Yu's avatar Qiang Yu Committed by Adam Jackson

glamor: use drmGetDeviceNameFromFD2 when available

This is for glamor can support fd from DRM render node which is useful
for a render only DDX.
Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
Signed-off-by: default avatarQiang Yu <Qiang.Yu@amd.com>
parent d4b7e0ea
......@@ -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])
......
......@@ -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,
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment