From patchwork Mon Dec 17 02:10:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Peres X-Patchwork-Id: 1885871 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 94AC2DFAC4 for ; Mon, 17 Dec 2012 02:11:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 70E6DE60CD for ; Sun, 16 Dec 2012 18:11:04 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from ensi-bourges.fr (mail.ensi-bourges.fr [195.221.38.25]) by gabe.freedesktop.org (Postfix) with ESMTP id D33DDE5C7A for ; Sun, 16 Dec 2012 18:10:52 -0800 (PST) Received: (qmail 6219 invoked from network); 17 Dec 2012 02:07:49 -0000 Received: from unknown (HELO cathaou.dartybox.com) (Authenticated?user?:martin.peres@[89.159.199.232]) (envelope-sender ) by mail.ensi-bourges.fr (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 17 Dec 2012 02:07:49 -0000 From: martin.peres@free.fr To: dri-devel@lists.freedesktop.org Subject: [PATCH] add support for render nodes Date: Mon, 17 Dec 2012 03:10:45 +0100 Message-Id: <1355710245-18585-1-git-send-email-martin.peres@free.fr> X-Mailer: git-send-email 1.8.0.2 In-Reply-To: <50CE7868.4040205@free.fr> References: <50CE7868.4040205@free.fr> Cc: Martin Peres X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Martin Peres Signed-off-by: Martin Peres --- configure.ac | 2 +- src/nouveau_dri2.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) 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); }