diff options
author | Martin Peres <martin.peres@labri.fr> | 2012-12-15 19:36:15 +0100 |
---|---|---|
committer | Martin Peres <martin.peres@labri.fr> | 2012-12-16 01:47:31 +0100 |
commit | 068e41a79a8541696518487a3e899aa47d36bdbc (patch) | |
tree | 11862efb0121b9523750415573aaa56987d10005 | |
parent | 2282114cad1fc8e16a43e07ba8c7b94d21acda88 (diff) |
nouveau: Allow opening a specific type of drm device
Signed-off-by: Martin Peres <martin.peres@labri.fr>
-rw-r--r-- | nouveau/nouveau.c | 11 | ||||
-rw-r--r-- | nouveau/nouveau.h | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c index 940d9339..1402852c 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 c42eea7a..cbc0dc9d 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); |