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

This commit is contained in:
48cf 2023-10-24 05:29:45 +02:00
parent 99c8c517f0
commit 41d79eec5f
4 changed files with 17 additions and 10 deletions

View File

@ -55,7 +55,9 @@ override CPPFLAGS_FOR_TARGET := \
-MMD \ -MMD \
-MP -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) ifeq ($(TARGET),bios)
override CFLAGS_FOR_TARGET += \ override CFLAGS_FOR_TARGET += \

View File

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

View File

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

View File

@ -245,7 +245,13 @@ static void limine_main(void) {
fb->address, fb->address,
fb->width, fb->width,
fb->height, fb->height,
fb->pitch fb->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
); );
uint64_t kernel_slide = (uint64_t)kernel_start - 0xffffffff80000000; uint64_t kernel_slide = (uint64_t)kernel_start - 0xffffffff80000000;