Skip to content

Commit

Permalink
fix(core): fix gfx_bitblt initialization
Browse files Browse the repository at this point in the history
[no changelog]
  • Loading branch information
cepetr committed Jan 17, 2025
1 parent d4cd1a3 commit 046d9ca
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 6 deletions.
4 changes: 4 additions & 0 deletions core/embed/io/display/ltdc_dsi/display_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ bool display_init(display_content_mode_t mode) {

__HAL_LTDC_ENABLE_IT(&drv->hlcd_ltdc, LTDC_IT_LI | LTDC_IT_FU | LTDC_IT_TE);

gfx_bitblt_init();

drv->initialized = true;
return true;

Expand All @@ -427,6 +429,8 @@ void display_deinit(display_content_mode_t mode) {

GPIO_InitTypeDef GPIO_InitStructure = {0};

gfx_bitblt_deinit();

NVIC_DisableIRQ(LTDC_IRQn);
NVIC_DisableIRQ(LTDC_ER_IRQn);

Expand Down
4 changes: 4 additions & 0 deletions core/embed/io/display/st-7789/display_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ bool display_init(display_content_mode_t mode) {
#endif
#endif

gfx_bitblt_init();

drv->initialized = true;
return true;
}
Expand All @@ -110,6 +112,8 @@ void display_deinit(display_content_mode_t mode) {
#endif
#endif

gfx_bitblt_deinit();

mpu_set_active_fb(NULL, 0);

backlight_pwm_deinit(mode == DISPLAY_RESET_CONTENT ? BACKLIGHT_RESET
Expand Down
4 changes: 4 additions & 0 deletions core/embed/io/display/stm32f429i-disc1/display_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,17 @@ bool display_init(display_content_mode_t mode) {
ili9341_init();
}

gfx_bitblt_init();

drv->initialized = true;
return true;
}

void display_deinit(display_content_mode_t mode) {
display_driver_t *drv = &g_display_driver;

gfx_bitblt_deinit();

mpu_set_active_fb(NULL, 0);

drv->initialized = false;
Expand Down
5 changes: 5 additions & 0 deletions core/embed/io/display/unix/display_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ bool display_init(display_content_mode_t mode) {
#else
drv->orientation_angle = 0;
#endif

gfx_bitblt_init();

drv->initialized = true;
return true;
}
Expand All @@ -189,6 +192,8 @@ void display_deinit(display_content_mode_t mode) {
return;
}

gfx_bitblt_deinit();

SDL_FreeSurface(drv->prev_saved);
SDL_FreeSurface(drv->buffer);
if (drv->background != NULL) {
Expand Down
4 changes: 4 additions & 0 deletions core/embed/io/display/vg-2864/display_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ bool display_init(display_content_mode_t mode) {
display_init_spi(drv);
}

gfx_bitblt_init();

drv->initialized = true;
return true;
}
Expand All @@ -327,6 +329,8 @@ void display_deinit(display_content_mode_t mode) {

mpu_set_active_fb(NULL, 0);

gfx_bitblt_deinit();

drv->initialized = false;
}

Expand Down
2 changes: 0 additions & 2 deletions core/embed/projects/boardloader/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ static void drivers_init(void) {
#ifdef USE_HASH_PROCESSOR
hash_processor_init();
#endif
gfx_bitblt_init();
display_init(DISPLAY_RESET_CONTENT);
#ifdef USE_SD_CARD
sdcard_init();
Expand All @@ -103,7 +102,6 @@ static void drivers_deinit(void) {
#ifdef FIXED_HW_DEINIT
// TODO
#endif
gfx_bitblt_deinit();
display_deinit(DISPLAY_JUMP_BEHAVIOR);
#ifdef USE_POWERCTL
powerctl_deinit();
Expand Down
2 changes: 0 additions & 2 deletions core/embed/projects/bootloader/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ static void drivers_init(secbool *touch_initialized) {
#ifdef USE_HASH_PROCESSOR
hash_processor_init();
#endif
gfx_bitblt_init();
display_init(DISPLAY_JUMP_BEHAVIOR);
unit_properties_init();

Expand Down Expand Up @@ -138,7 +137,6 @@ static void drivers_deinit(void) {
button_deinit();
#endif
#endif
gfx_bitblt_deinit();
display_deinit(DISPLAY_JUMP_BEHAVIOR);
}

Expand Down
2 changes: 0 additions & 2 deletions core/embed/projects/kernel/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ void drivers_init() {
hash_processor_init();
#endif

gfx_bitblt_init();

display_init(DISPLAY_JUMP_BEHAVIOR);

#ifdef USE_OEM_KEYS_CHECK
Expand Down

0 comments on commit 046d9ca

Please sign in to comment.