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 /fbtools.c | |
parent | 5e68ede72c48aeae3412e31e5633c03d48048deb (diff) | |
download | fbida-7e1cb7262703c8d873b3838aaf4b5083716b5065.tar.gz |
gfx init and console switching tweaks
Diffstat (limited to 'fbtools.c')
-rw-r--r-- | fbtools.c | 25 |
1 files changed, 2 insertions, 23 deletions
@@ -237,32 +237,11 @@ gfxstate* fb_init(char *device, char *mode, int vt) if (vt != 0) console_set_vt(vt); - if (-1 == ioctl(STDIN_FILENO, VT_GETSTATE, &vts)) { - fprintf(stderr,"ioctl VT_GETSTATE: %s (not a linux console?)\n", - strerror(errno)); - exit(1); - } - if (NULL == device) { device = getenv("FRAMEBUFFER"); if (NULL == device) { - struct fb_con2fbmap c2m; - memset(&c2m, 0, sizeof(c2m)); - if (-1 == (fb = open("/dev/fb0", O_RDWR /* O_WRONLY */, 0))) { - fprintf(stderr, "open /dev/fb0: %s\n", strerror(errno)); - exit(1); - } - c2m.console = vts.v_active; - if (-1 == ioctl(fb, FBIOGET_CON2FBMAP, &c2m)) { - perror("ioctl FBIOGET_CON2FBMAP"); - exit(1); - } - close(fb); - fprintf(stderr,"map: vt%02d => fb%d\n", - c2m.console, c2m.framebuffer); - sprintf(fbdev, "/dev/fb%d", c2m.framebuffer); - device = fbdev; - } + device = "/dev/fb0"; + } } /* get current settings (which we have to restore) */ |