From patchwork Mon Dec 17 02:02:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Peres X-Patchwork-Id: 1885811 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 A87B8DFAC4 for ; Mon, 17 Dec 2012 02:04:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 47E3DE5CCC for ; Sun, 16 Dec 2012 18:04:20 -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 73F17E5C8B for ; Sun, 16 Dec 2012 18:03:14 -0800 (PST) Received: (qmail 5563 invoked from network); 17 Dec 2012 02:00:11 -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:00:11 -0000 From: martin.peres@free.fr To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/5] nouveau: Allow opening a specific type of drm device Date: Mon, 17 Dec 2012 03:02:53 +0100 Message-Id: <1355709775-15674-3-git-send-email-martin.peres@free.fr> X-Mailer: git-send-email 1.8.0.2 In-Reply-To: <1355709775-15674-1-git-send-email-martin.peres@free.fr> References: <50CE7868.4040205@free.fr> <1355709775-15674-1-git-send-email-martin.peres@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 --- nouveau/nouveau.c | 11 +++++++++-- nouveau/nouveau.h | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c index 940d933..1402852 100644 --- a/nouveau/nouveau.c +++ b/nouveau/nouveau.c @@ -128,9 +128,10 @@ nouveau_device_wrap(int fd, int close, struct nouveau_device **pdev) } int -nouveau_device_open(const char *busid, struct nouveau_device **pdev) +nouveau_device_open_type(const char *busid, struct nouveau_device **pdev, + int type) { - int ret = -ENODEV, fd = drmOpen("nouveau", busid); + int ret = -ENODEV, fd = drmOpenType("nouveau", busid, type); if (fd >= 0) { ret = nouveau_device_wrap(fd, 1, pdev); if (ret) @@ -139,6 +140,12 @@ nouveau_device_open(const char *busid, struct nouveau_device **pdev) return ret; } +int +nouveau_device_open(const char *busid, struct nouveau_device **pdev) +{ + return nouveau_device_open_type(busid, pdev, DRM_NODE_RENDER); +} + void nouveau_device_del(struct nouveau_device **pdev) { diff --git a/nouveau/nouveau.h b/nouveau/nouveau.h index c42eea7..cbc0dc9 100644 --- a/nouveau/nouveau.h +++ b/nouveau/nouveau.h @@ -66,6 +66,8 @@ struct nouveau_device { }; int nouveau_device_wrap(int fd, int close, struct nouveau_device **); +int nouveau_device_open_type(const char *busid, struct nouveau_device **pdev, + int type); int nouveau_device_open(const char *busid, struct nouveau_device **); void nouveau_device_del(struct nouveau_device **); int nouveau_getparam(struct nouveau_device *, uint64_t param, uint64_t *value);