From 7e1cb7262703c8d873b3838aaf4b5083716b5065 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 24 Mar 2016 11:35:51 +0100 Subject: gfx init and console switching tweaks --- drmtools.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'drmtools.c') 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)); -- cgit