diff mbox

add support for render nodes

Message ID 1355710245-18585-1-git-send-email-martin.peres@free.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Martin Peres Dec. 17, 2012, 2:10 a.m. UTC
From: Martin Peres <martin.peres@labri.fr>

Signed-off-by: Martin Peres <martin.peres@labri.fr>
---
 configure.ac       |  2 +-
 src/nouveau_dri2.c | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index ff9c337..61dfb01 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,7 +67,7 @@  XORG_DRIVER_CHECK_EXT(XV, videoproto)
 XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
 
 # Checks for pkg-config packages
-PKG_CHECK_MODULES(LIBDRM_NOUVEAU, [libdrm_nouveau >= 2.4.25])
+PKG_CHECK_MODULES(LIBDRM_NOUVEAU, [libdrm_nouveau >= 2.4.34])
 AC_SUBST(LIBDRM_NOUVEAU_CFLAGS)
 AC_SUBST(LIBDRM_NOUVEAU_LIBS)
 
diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
index 036bcff..f852d8e 100644
--- a/src/nouveau_dri2.c
+++ b/src/nouveau_dri2.c
@@ -754,6 +754,7 @@  nouveau_dri2_init(ScreenPtr pScreen)
 		{ "nouveau", "nouveau" },
 		{ "nouveau_vieux", "nouveau_vieux" }
 	};
+	char *device_name = NULL;
 
 	if (pNv->Architecture >= NV_ARCH_30)
 		dri2.driverNames = drivernames[0];
@@ -788,6 +789,16 @@  nouveau_dri2_init(ScreenPtr pScreen)
 	dri2.DestroyBuffer2 = nouveau_dri2_destroy_buffer2;
 	dri2.CopyRegion2 = nouveau_dri2_copy_region2;
 #endif
+
+#if DRI2INFOREC_VERSION >= 10
+	dri2.version = 10;
+
+	/* try to use the render node if available */
+	device_name = drmGetSameDeviceButType(pNv->drm_device_name, DRM_NODE_RENDER_ONLY);
+	if (device_name)
+		dri2.deviceName = device_name;
+	dri2.device_requires_auth = (device_name == NULL);
+#endif
 	return DRI2ScreenInit(pScreen, &dri2);
 }