diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2016-03-24 11:41:57 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-03-24 11:41:57 +0100 |
commit | 4ccd1819ea1b1f2b571baf1e5b2c4c285e38c8f5 (patch) | |
tree | fe63d570dd69ca96d8455a1f4244f404afc8d11f | |
parent | 61643e79f7fac70873c5d9f689d951a72c0a3bd0 (diff) | |
download | fbida-4ccd1819ea1b1f2b571baf1e5b2c4c285e38c8f5.tar.gz |
report device
-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: |