diff --git a/src/display.c b/src/display.c index 90bb3508..32fb15d6 100644 --- a/src/display.c +++ b/src/display.c @@ -547,6 +547,7 @@ int display_init(void) } else if (!(cur_boot_args.video.depth & FB_DEPTH_FLAG_RETINA)) { printf("display: Internal display with non-retina flag, assuming Sonoma bug and " "reconfiguring\n"); + fb_clear_direct(); // Old m1n1 stage1 ends up with an ugly logo situation, clear it. return display_configure(NULL); } else { printf("display: Display is already initialized (%ldx%ld)\n", cur_boot_args.video.width, diff --git a/src/fb.c b/src/fb.c index 4c3e8b51..3f61b67e 100644 --- a/src/fb.c +++ b/src/fb.c @@ -325,6 +325,16 @@ static void fb_clear_console(void) fb_update(); } +void fb_clear_direct(void) +{ + size_t fb_size = cur_boot_args.video.stride * cur_boot_args.video.height; + + mmu_add_mapping(cur_boot_args.video.base, cur_boot_args.video.base, ALIGN_UP(fb_size, 0x4000), + MAIR_IDX_NORMAL_NC, PERM_RW); + + memset64((void *)cur_boot_args.video.base, 0, fb_size); +} + void fb_init(bool clear) { fb.hwptr = (void *)cur_boot_args.video.base; diff --git a/src/fb.h b/src/fb.h index 2bfd406f..08f52f49 100644 --- a/src/fb.h +++ b/src/fb.h @@ -45,6 +45,7 @@ void fb_blit(u32 x, u32 y, u32 w, u32 h, void *data, u32 stride, pix_fmt_t forma void fb_unblit(u32 x, u32 y, u32 w, u32 h, void *data, u32 stride); void fb_fill(u32 x, u32 y, u32 w, u32 h, rgb_t color); void fb_clear(rgb_t color); +void fb_clear_direct(void); void fb_display_logo(void); void fb_restore_logo(void);