diff options
-rw-r--r-- | drmtools.c | 18 | ||||
-rw-r--r-- | fbtools.c | 1 |
2 files changed, 11 insertions, 8 deletions
@@ -42,19 +42,13 @@ static void drm_cleanup_display(void) } } -static int drm_init_dev(const char *device) +static int drm_init_dev(const char *dev) { 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)); @@ -157,9 +151,16 @@ static void drm_restore_display(void) drm_show_fb(); } -gfxstate *drm_init(const char *dev) +gfxstate *drm_init(const char *device) { gfxstate *gfx; + char dev[64]; + + if (device) { + snprintf(dev, sizeof(dev), "%s", device); + } else { + snprintf(dev, sizeof(dev), DRM_DEV_NAME, DRM_DIR_NAME, 0); + } if (drm_init_dev(dev) < 0) return NULL; @@ -190,5 +191,6 @@ gfxstate *drm_init(const char *dev) gfx->restore_display = drm_restore_display; gfx->cleanup_display = drm_cleanup_display; + fprintf(stderr, "using drm: %s\n", device); return gfx; } @@ -340,6 +340,7 @@ gfxstate* fb_init(char *device, char *mode, int vt) gfx->restore_display = fb_restore_display; gfx->cleanup_display = fb_cleanup_display; + fprintf(stderr, "using fbdev: %s\n", device); return gfx; err: |