[U-Boot] [PATCH v2 10/18] bios: vesa: Guard setting vesa mode with CONFIG_FRAMEBUFFER_SET_VESA_MODE
Bin Meng
bmeng.cn at gmail.com
Thu Apr 12 05:02:15 UTC 2018
If CONFIG_FRAMEBUFFER_SET_VESA_MODE is not set, don't switch
graphics card to VESA mode. This applies to both native mode
and emulator mode of running the VGA BIOS.
Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
---
Changes in v2: None
arch/x86/lib/bios.c | 4 ++++
drivers/bios_emulator/atibios.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/arch/x86/lib/bios.c b/arch/x86/lib/bios.c
index 66d7629..f9092fd 100644
--- a/arch/x86/lib/bios.c
+++ b/arch/x86/lib/bios.c
@@ -185,6 +185,7 @@ static void setup_realmode_idt(void)
write_idt_stub((void *)0xffe6e, 0x1a);
}
+#ifdef CONFIG_FRAMEBUFFER_SET_VESA_MODE
static u8 vbe_get_mode_info(struct vbe_mode_info *mi)
{
u16 buffer_seg;
@@ -241,6 +242,7 @@ static void vbe_set_graphics(int vesa_mode, struct vbe_mode_info *mode_info)
mode_info->video_mode &= 0x3ff;
vbe_set_mode(mode_info);
}
+#endif /* CONFIG_FRAMEBUFFER_SET_VESA_MODE */
void bios_run_on_x86(struct udevice *dev, unsigned long addr, int vesa_mode,
struct vbe_mode_info *mode_info)
@@ -273,8 +275,10 @@ void bios_run_on_x86(struct udevice *dev, unsigned long addr, int vesa_mode,
0x0);
debug("done\n");
+#ifdef CONFIG_FRAMEBUFFER_SET_VESA_MODE
if (vesa_mode != -1)
vbe_set_graphics(vesa_mode, mode_info);
+#endif
}
asmlinkage int interrupt_handler(u32 intnumber, u32 gsfs, u32 dses,
diff --git a/drivers/bios_emulator/atibios.c b/drivers/bios_emulator/atibios.c
index 2d5b5dc..07e45f2 100644
--- a/drivers/bios_emulator/atibios.c
+++ b/drivers/bios_emulator/atibios.c
@@ -78,6 +78,7 @@ static const void *bios_ptr(const void *buf, BE_VGAInfo *vga_info,
return buf + (flat - vbe_offset);
}
+#ifdef CONFIG_FRAMEBUFFER_SET_VESA_MODE
static int atibios_debug_mode(BE_VGAInfo *vga_info, RMREGS *regs,
int vesa_mode, struct vbe_mode_info *mode_info)
{
@@ -215,6 +216,7 @@ static int atibios_set_vesa_mode(RMREGS *regs, int vesa_mode,
return 0;
}
+#endif /* CONFIG_FRAMEBUFFER_SET_VESA_MODE */
/****************************************************************************
PARAMETERS:
@@ -263,11 +265,13 @@ static void PCI_doBIOSPOST(pci_dev_t pcidev, BE_VGAInfo *vga_info,
/*Cleanup and exit*/
BE_getVGA(vga_info);
+#ifdef CONFIG_FRAMEBUFFER_SET_VESA_MODE
/* Useful for debugging */
if (0)
atibios_debug_mode(vga_info, ®s, vesa_mode, mode_info);
if (vesa_mode != -1)
atibios_set_vesa_mode(®s, vesa_mode, mode_info);
+#endif
}
/****************************************************************************
--
2.7.4
More information about the U-Boot
mailing list