summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-07-15 15:35:02 -0700
committerVito Caputo <vcaputo@pengaru.com>2022-07-15 15:35:02 -0700
commit27263f8abc0233e09b2383ae8af9ebb888f10960 (patch)
treedfa8a49dfa9b70e69e13e5af7fa0d24dcf6e7898 /src/main.c
parent8bd50ffd4ba81cb9c5197bcae926e177cc7a8987 (diff)
mem_fb: introduce --video=mem; a dummy in-memory video backend
The immediate impetus for adding this is to enable running rototiller even on headless machines just for the sake of getting some FPS measurements. It'd be nice to get a sense for what FPS rototiller would experience on larger modern machines like big EPYC or Threadripper systems. But it seems most of those I can get access to via others running them on work hardware or the like can at most just run it over ssh without any display or risk of disrupting the physical console. But this is probably also useful for testing/debugging purposes, especially since it doesn't bother to synchronize flips on anything not even a timer. So a bunch of display complexity is removed running with video=mem as well as letting the framerate run unbounded. Having said that, it might be nice to add an fps=N setting where mem_fb uses a plain timer for scheduling the flips. Currently the only setting is size=WxH identical to the sdl_fb size= setting, defaulting to 640x480.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 68ff1da..c22eb3c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -34,6 +34,7 @@
#endif
extern til_fb_ops_t drm_fb_ops;
+extern til_fb_ops_t mem_fb_ops;
extern til_fb_ops_t sdl_fb_ops;
static til_fb_ops_t *fb_ops;
@@ -74,6 +75,7 @@ static int setup_video(til_settings_t *settings, til_setting_t **res_setting, co
#ifdef HAVE_DRM
"drm",
#endif
+ "mem",
#ifdef HAVE_SDL
"sdl",
#endif
@@ -106,6 +108,11 @@ static int setup_video(til_settings_t *settings, til_setting_t **res_setting, co
return drm_fb_ops.setup(settings, res_setting, res_desc, res_setup);
}
#endif
+ if (!strcasecmp(video, "mem")) {
+ fb_ops = &mem_fb_ops;
+
+ return mem_fb_ops.setup(settings, res_setting, res_desc, res_setup);
+ }
#ifdef HAVE_SDL
if (!strcasecmp(video, "sdl")) {
fb_ops = &sdl_fb_ops;
© All Rights Reserved