Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions loader/arch/x86/bios/bios_video_services.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,12 @@ static u16 mode_fb_format(
);
}

#define VBE_MODE_ATTR_SUPPORTED (1 << 0)
#define VBE_MODE_ATTR_GRAPHICS (1 << 4)
#define VBE_MODE_ATTR_LINEAR_FB (1 << 7)
#define VBE_MODE_ATTR_REQUIRED \
(VBE_MODE_ATTR_SUPPORTED | VBE_MODE_ATTR_GRAPHICS | VBE_MODE_ATTR_LINEAR_FB)

static void fetch_all_video_modes(void)
{
struct super_vga_info vga_info = { 0 };
Expand Down Expand Up @@ -369,6 +375,12 @@ static void fetch_all_video_modes(void)
if (!fetch_mode_info(mode_id, &info))
continue;

if ((info.attributes & VBE_MODE_ATTR_REQUIRED) != VBE_MODE_ATTR_REQUIRED)
continue;

if (info.framebuffer_address == 0)
continue;

fb_format = mode_fb_format(&info, mode_id, vesa_detected_major >= 3);
if (fb_format == FB_FORMAT_INVALID)
continue;
Expand Down
Loading