mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-10 01:34:12 +00:00
display,fb: Clear framebuffer early in the Sonoma stage2 fixup path
stage1 ends up with an ugly Asahi 100% logo on top of a 200% Apple logo. Let's just clear it so it looks nicer. Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
6af39a9b40
commit
40a9444484
3 changed files with 12 additions and 0 deletions
|
@ -547,6 +547,7 @@ int display_init(void)
|
||||||
} else if (!(cur_boot_args.video.depth & FB_DEPTH_FLAG_RETINA)) {
|
} else if (!(cur_boot_args.video.depth & FB_DEPTH_FLAG_RETINA)) {
|
||||||
printf("display: Internal display with non-retina flag, assuming Sonoma bug and "
|
printf("display: Internal display with non-retina flag, assuming Sonoma bug and "
|
||||||
"reconfiguring\n");
|
"reconfiguring\n");
|
||||||
|
fb_clear_direct(); // Old m1n1 stage1 ends up with an ugly logo situation, clear it.
|
||||||
return display_configure(NULL);
|
return display_configure(NULL);
|
||||||
} else {
|
} else {
|
||||||
printf("display: Display is already initialized (%ldx%ld)\n", cur_boot_args.video.width,
|
printf("display: Display is already initialized (%ldx%ld)\n", cur_boot_args.video.width,
|
||||||
|
|
10
src/fb.c
10
src/fb.c
|
@ -325,6 +325,16 @@ static void fb_clear_console(void)
|
||||||
fb_update();
|
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)
|
void fb_init(bool clear)
|
||||||
{
|
{
|
||||||
fb.hwptr = (void *)cur_boot_args.video.base;
|
fb.hwptr = (void *)cur_boot_args.video.base;
|
||||||
|
|
1
src/fb.h
1
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_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_fill(u32 x, u32 y, u32 w, u32 h, rgb_t color);
|
||||||
void fb_clear(rgb_t color);
|
void fb_clear(rgb_t color);
|
||||||
|
void fb_clear_direct(void);
|
||||||
|
|
||||||
void fb_display_logo(void);
|
void fb_display_logo(void);
|
||||||
void fb_restore_logo(void);
|
void fb_restore_logo(void);
|
||||||
|
|
Loading…
Reference in a new issue