From 9232835bd16b6948442f7a4588fb9376782cb814 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Tue, 7 Mar 2017 11:53:23 +0800 Subject: 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 Signed-off-by: Qiang Yu --- glamor/glamor_egl.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'glamor') 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, -- cgit v1.2.3