Add quirk for forcing fbdev refresh

Fixes: #34
This commit is contained in:
Johannes Marbach
2023-07-28 20:47:23 +02:00
parent 8d3de8f4c1
commit d66897c74e
6 changed files with 22 additions and 4 deletions

View File

@@ -4,6 +4,7 @@
- feat: Add man page (#6, thanks @Jarrah) - feat: Add man page (#6, thanks @Jarrah)
- feat!: Enable direct rendering - feat!: Enable direct rendering
- feat: Add quirk for forcing fbdev refresh (#34, thanks @calebccff)
## 1.0.0 (2023-03-14) ## 1.0.0 (2023-03-14)

View File

@@ -230,7 +230,11 @@ static int parsing_handler(void* user_data, const char* section, const char* key
} }
} }
} else if (strcmp(section, "quirks") == 0) { } else if (strcmp(section, "quirks") == 0) {
if (strcmp(key, "terminal_prevent_graphics_mode") == 0) { if (strcmp(key, "fbdev_force_refresh") == 0) {
if (parse_bool(value, &(opts->quirks.fbdev_force_refresh))) {
return 1;
}
} else if (strcmp(key, "terminal_prevent_graphics_mode") == 0) {
if (parse_bool(value, &(opts->quirks.terminal_prevent_graphics_mode))) { if (parse_bool(value, &(opts->quirks.terminal_prevent_graphics_mode))) {
return 1; return 1;
} }
@@ -278,6 +282,7 @@ void ul_config_init_opts(ul_config_opts *opts) {
opts->input.keyboard = true; opts->input.keyboard = true;
opts->input.pointer = true; opts->input.pointer = true;
opts->input.touchscreen = true; opts->input.touchscreen = true;
opts->quirks.fbdev_force_refresh = false;
opts->quirks.terminal_prevent_graphics_mode = false; opts->quirks.terminal_prevent_graphics_mode = false;
opts->quirks.terminal_allow_keyboard_input = false; opts->quirks.terminal_allow_keyboard_input = false;
} }

View File

@@ -90,6 +90,8 @@ typedef struct {
* (Normally unneeded) quirky options * (Normally unneeded) quirky options
*/ */
typedef struct { typedef struct {
/* If true and using the framebuffer backend, force a refresh on every draw operation */
bool fbdev_force_refresh;
/* If true, do *not* switch terminal into graphics mode (will show terminal command prompt) */ /* If true, do *not* switch terminal into graphics mode (will show terminal command prompt) */
bool terminal_prevent_graphics_mode; bool terminal_prevent_graphics_mode;
/* If true, do *not* turn off terminal keyboard input (will show entered characters) */ /* If true, do *not* turn off terminal keyboard input (will show entered characters) */

View File

@@ -79,12 +79,17 @@ will be merged in the following order:
Default: true. Default: true.
## Quirks ## Quirks
*fbdev_force_refresh* = <true|false>
If true and using the framebuffer backend, this triggers a display refresh
after every draw operation. This has a negative performance impact.
Default: false.
*terminal_prevent_graphics_mode* = <true|false> *terminal_prevent_graphics_mode* = <true|false>
If true this avoids setting the terminal into graphics mode. Will show If true, this avoids setting the terminal into graphics mode. This will
terminal command prompt. Default: false. show the terminal command prompt. Default: false.
*terminal_allow_keyboard_input* = <true|false> *terminal_allow_keyboard_input* = <true|false>
If true this avoids turning off terminal keyboard input. This will show If true, this avoids turning off terminal keyboard input. This will show
your password on the terminal. Default: false. your password on the terminal. Default: false.
# SEE ALSO # SEE ALSO
@@ -93,3 +98,4 @@ will be merged in the following order:
# AUTHORS # AUTHORS
*Undef* <debian@undef.tools> *Undef* <debian@undef.tools>
*Johannes Marbach* <n0-0ne@mailbox.org>

3
main.c
View File

@@ -381,6 +381,9 @@ int main(int argc, char *argv[]) {
#if USE_FBDEV #if USE_FBDEV
case UL_BACKENDS_BACKEND_FBDEV: case UL_BACKENDS_BACKEND_FBDEV:
fbdev_init(); fbdev_init();
if (conf_opts.quirks.fbdev_force_refresh) {
fbdev_force_refresh(true);
}
fbdev_get_sizes(&hor_res, &ver_res, &dpi); fbdev_get_sizes(&hor_res, &ver_res, &dpi);
disp_drv.flush_cb = fbdev_flush; disp_drv.flush_cb = fbdev_flush;
break; break;

View File

@@ -22,5 +22,6 @@ alternate=breezy-dark
#touchscreen=false #touchscreen=false
#[quirks] #[quirks]
#fbdev_force_refresh=true
#terminal_prevent_graphics_mode=true #terminal_prevent_graphics_mode=true
#terminal_allow_keyboard_input=true #terminal_allow_keyboard_input=true