aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2016-03-24 11:41:57 +0100
committerGerd Hoffmann <kraxel@redhat.com>2016-03-24 11:41:57 +0100
commit4ccd1819ea1b1f2b571baf1e5b2c4c285e38c8f5 (patch)
treefe63d570dd69ca96d8455a1f4244f404afc8d11f
parent61643e79f7fac70873c5d9f689d951a72c0a3bd0 (diff)
downloadfbida-4ccd1819ea1b1f2b571baf1e5b2c4c285e38c8f5.tar.gz
report device
-rw-r--r--drmtools.c18
-rw-r--r--fbtools.c1
2 files changed, 11 insertions, 8 deletions
diff --git a/drmtools.c b/drmtools.c
index ebe487a..e4a4b61 100644
--- a/drmtools.c
+++ b/drmtools.c
@@ -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;
}
diff --git a/fbtools.c b/fbtools.c
index 176021f..673a742 100644
--- a/fbtools.c
+++ b/fbtools.c
@@ -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: