summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2009-08-20 17:33:56 +0200
committerJakob Bornecrantz <jakob@vmware.com>2009-08-20 17:50:30 +0200
commite93d41d24f15491415538c82959f0d511bb40813 (patch)
tree531f659c03579d52ec41165995d7222c6672520b /src
parent94d14f6cd223a2c90f2a177f5b1dfc55fb8d659a (diff)
st/egl: Open the first drm node
At least its better then hardcoded to i915
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/egl/egl_tracker.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/egl/egl_tracker.c b/src/gallium/state_trackers/egl/egl_tracker.c
index ced002c535..57c81da767 100644
--- a/src/gallium/state_trackers/egl/egl_tracker.c
+++ b/src/gallium/state_trackers/egl/egl_tracker.c
@@ -6,6 +6,8 @@
#include <string.h>
#include "egl_tracker.h"
+#include <fcntl.h>
+
#include "egllog.h"
#include "state_tracker/drm_api.h"
@@ -132,6 +134,14 @@ drm_find_dpms(struct drm_device *dev, struct drm_screen *screen)
screen->dpms = p;
}
+static int drm_open_minor(int minor)
+{
+ char buf[64];
+
+ sprintf(buf, DRM_DEV_NAME, DRM_DIR_NAME, minor);
+ return open(buf, O_RDWR, 0);
+}
+
EGLBoolean
drm_initialize(_EGLDriver *drv, _EGLDisplay *disp, EGLint *major, EGLint *minor)
{
@@ -144,7 +154,8 @@ drm_initialize(_EGLDriver *drv, _EGLDisplay *disp, EGLint *major, EGLint *minor)
EGLint i;
int fd;
- fd = drmOpen("i915", NULL);
+ /* try the first node */
+ fd = drm_open_minor(0);
if (fd < 0)
goto err_fd;