From: Martin Peres <martin.pe...@labri.fr>

Signed-off-by: Martin Peres <martin.peres at labri.fr>
---
 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);
-- 
1.8.0.1

Reply via email to