aboutsummaryrefslogtreecommitdiffstats
path: root/drmtools.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2016-03-24 11:35:51 +0100
committerGerd Hoffmann <kraxel@redhat.com>2016-03-24 11:35:51 +0100
commit7e1cb7262703c8d873b3838aaf4b5083716b5065 (patch)
tree0630c25626b6e7e45f511d4fc99c9896ec91f026 /drmtools.c
parent5e68ede72c48aeae3412e31e5633c03d48048deb (diff)
downloadfbida-7e1cb7262703c8d873b3838aaf4b5083716b5065.tar.gz
gfx init and console switching tweaks
Diffstat (limited to 'drmtools.c')
-rw-r--r--drmtools.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drmtools.c b/drmtools.c
index 563aa3b..ebe487a 100644
--- a/drmtools.c
+++ b/drmtools.c
@@ -42,13 +42,19 @@ static void drm_cleanup_display(void)
}
}
-static int drm_init_dev(const char *dev)
+static int drm_init_dev(const char *device)
{
drmModeRes *res;
+ char dev[64];
int i, rc;
uint64_t has_dumb;
/* open device */
+ if (device) {
+ snprintf(dev, sizeof(dev), "%s", device);
+ } else {
+ snprintf(dev, sizeof(dev), DRM_DEV_NAME, DRM_DIR_NAME, 0);
+ }
fd = open(dev, O_RDWR);
if (fd < 0) {
fprintf(stderr, "drm: open %s: %s\n", dev, strerror(errno));