summaryrefslogtreecommitdiff
path: root/glamor
diff options
context:
space:
mode:
authorQiang Yu <Qiang.Yu@amd.com>2017-03-07 11:53:23 +0800
committerAdam Jackson <ajax@redhat.com>2017-03-07 16:00:27 -0500
commit9232835bd16b6948442f7a4588fb9376782cb814 (patch)
tree4708b0c6159c2318c30c1b0d78a2da77c2053e76 /glamor
parentd4b7e0eaa4b2e97ce1dec653a2ae7d9621fe1431 (diff)
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 <ajax@redhat.com> Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Diffstat (limited to 'glamor')
-rw-r--r--glamor/glamor_egl.c4
1 files changed, 4 insertions, 0 deletions
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,