lib/gterm: Try to initialize all 32-bpp framebuffers

This commit is contained in:
48cf 2023-10-24 05:29:45 +02:00 committed by mintsuki
parent 3f040cf1a9
commit 9bcea9911c
3 changed files with 10 additions and 9 deletions

View File

@ -56,7 +56,9 @@ override CPPFLAGS_FOR_TARGET := \
-MMD \
-MP
$(call MKESCAPE,$(BUILDDIR))/./flanterm/backends/fb.o: override CPPFLAGS_FOR_TARGET += -DFLANTERM_FB_DISABLE_BUMP_ALLOC
$(call MKESCAPE,$(BUILDDIR))/./flanterm/backends/fb.o: override CPPFLAGS_FOR_TARGET += \
-DFLANTERM_FB_DISABLE_BUMP_ALLOC \
-DFLANTERM_FB_SUPPORT_BPP
ifeq ($(TARGET),bios)
override CFLAGS_FOR_TARGET += \

View File

@ -10,6 +10,7 @@
#include <lib/image.h>
#include <mm/pmm.h>
#include <flanterm/flanterm.h>
#define FLANTERM_FB_SUPPORT_BPP
#include <flanterm/backends/fb.h>
#include <lib/term.h>
@ -673,13 +674,8 @@ no_load_font:;
for (size_t i = 0; i < fbs_count; i++) {
struct fb_info *fb = &fbs[i];
// Ensure this is xRGB8888, we only support that for the menu
if (fb->red_mask_size != 8
|| fb->red_mask_shift != 16
|| fb->green_mask_size != 8
|| fb->green_mask_shift != 8
|| fb->blue_mask_size != 8
|| fb->blue_mask_shift != 0) {
// Ensure that this framebuffer uses 32-bits per pixel.
if (fb->framebuffer_bpp != 32) {
continue;
}
@ -714,6 +710,9 @@ no_load_font:;
pmm_free,
(void *)(uintptr_t)fb->framebuffer_addr,
fb->framebuffer_width, fb->framebuffer_height, fb->framebuffer_pitch,
fb->red_mask_size, fb->red_mask_shift,
fb->green_mask_size, fb->green_mask_shift,
fb->blue_mask_size, fb->blue_mask_shift,
bg_canvas,
ansi_colours, ansi_bright_colours,
&default_bg, &default_fg,

View File

@ -6,7 +6,7 @@ export OBJCOPY_FOR_TARGET
export READELF_FOR_TARGET
override CC := $(CC_FOR_TARGET)
CFLAGS = -O2 -g -Wall -Wextra
CFLAGS = -O2 -g -Wall -Wextra -DFLANTERM_FB_SUPPORT_BPP
LDFLAGS =
override LD := $(LD_FOR_TARGET)
override QEMU := qemu-system-x86_64