diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2016-03-24 11:35:51 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-03-24 11:35:51 +0100 |
commit | 7e1cb7262703c8d873b3838aaf4b5083716b5065 (patch) | |
tree | 0630c25626b6e7e45f511d4fc99c9896ec91f026 /drmtools.c | |
parent | 5e68ede72c48aeae3412e31e5633c03d48048deb (diff) | |
download | fbida-7e1cb7262703c8d873b3838aaf4b5083716b5065.tar.gz |
gfx init and console switching tweaks
Diffstat (limited to 'drmtools.c')
-rw-r--r-- | drmtools.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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)); |