From abe2ffe39eccd635f7abb675844dd687faaeffa8 Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Wed, 11 Dec 2024 23:00:32 +0100 Subject: [PATCH] fixup! fixup! refactor(core): extract framebuffer queue for reuse --- core/embed/io/display/st-7789/display_driver.c | 2 ++ core/embed/io/display/st-7789/display_fb.c | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/embed/io/display/st-7789/display_driver.c b/core/embed/io/display/st-7789/display_driver.c index 1b6a2659f1..10ccf43827 100644 --- a/core/embed/io/display/st-7789/display_driver.c +++ b/core/embed/io/display/st-7789/display_driver.c @@ -56,11 +56,13 @@ void display_init(display_content_mode_t mode) { memset(drv, 0, sizeof(display_driver_t)); +#ifdef FRAMEBUFFER fb_queue_reset(&drv->empty_frames); fb_queue_reset(&drv->ready_frames); fb_queue_put(&drv->empty_frames, 0); fb_queue_put(&drv->empty_frames, 1); +#endif if (mode == DISPLAY_RESET_CONTENT) { display_io_init_gpio(); diff --git a/core/embed/io/display/st-7789/display_fb.c b/core/embed/io/display/st-7789/display_fb.c index 29c0d562ca..63153f5b27 100644 --- a/core/embed/io/display/st-7789/display_fb.c +++ b/core/embed/io/display/st-7789/display_fb.c @@ -216,11 +216,10 @@ void display_refresh(void) { #else // BOARDLOADER wait_for_te_signal(); - fb_queue_set_ready_for_transfer(&drv->queue); - fb_idx = fb_queue_get_for_transfer(&drv->queue); + int16_t fb_idx = fb_queue_take(&drv->empty_frames); if (fb_idx >= 0) { copy_fb_to_display(fb_idx); - fb_queue_set_done(&drv->queue); + fb_queue_put(&drv->empty_frames, fb_idx); } #endif }