diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2016-03-24 10:45:11 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-03-24 10:45:11 +0100 |
commit | 19c335cd7f53d759ec04e96e0d96ed7258f4521c (patch) | |
tree | df8b7c68932407313dcbfbf3867e6c4656a9fe48 /fbi.c | |
parent | 0aa8fef0aeca565aa87fb658fcfdc3e5f713079b (diff) | |
download | fbida-19c335cd7f53d759ec04e96e0d96ed7258f4521c.tar.gz |
add drm support, console switching fixes
Diffstat (limited to 'fbi.c')
-rw-r--r-- | fbi.c | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -38,6 +38,7 @@ #include "readers.h" #include "vt.h" #include "fbtools.h" +#include "drmtools.h" #include "fb-gui.h" #include "filter.h" #include "desktop.h" @@ -1404,6 +1405,7 @@ static void exit_signals_init(void) /* cleanup */ gfx->cleanup_display(); + console_switch_cleanup(); fprintf(stderr,"Oops: %s\n",strsignal(termsig)); exit(42); } @@ -1415,6 +1417,7 @@ static void cleanup_and_exit(int code) shadow_fini(); tty_restore(); gfx->cleanup_display(); + console_switch_cleanup(); flist_print_tagged(stdout); exit(code); } @@ -1430,7 +1433,7 @@ int main(int argc, char *argv[]) { int once; int i, arg, key; - char *info, *desc, *filelist; + char *info, *desc, *filelist, *device; char linebuffer[128]; struct flist *fprev = NULL; @@ -1508,9 +1511,16 @@ int main(int argc, char *argv[]) fprintf(stderr,"can't open font: %s\n",fontname); exit(1); } - gfx = fb_init(cfg_get_str(O_DEVICE), - cfg_get_str(O_VIDEO_MODE), - GET_VT()); + + /* gfx device init */ + device = cfg_get_str(O_DEVICE); + if (device && strncmp(device, "/dev/dri", 8) == 0) { + gfx = drm_init(device); + } else { + gfx = fb_init(device, + cfg_get_str(O_VIDEO_MODE), + GET_VT()); + } exit_signals_init(); console_switch_init(console_switch_redraw); shadow_init(gfx); |