video: Rename structs and functions to avoid VBE

Rename these to VESA, itself an abbreviation, to avoid a conflict with
Verified Boot for Embedded.

Rename this to avoid referencing VBE.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2022-07-30 15:52:05 -06:00 committed by Tom Rini
parent cafe8712e8
commit da62e1e861
11 changed files with 42 additions and 39 deletions

View file

@ -190,7 +190,7 @@ static void setup_realmode_idt(void)
} }
#ifdef CONFIG_FRAMEBUFFER_SET_VESA_MODE #ifdef CONFIG_FRAMEBUFFER_SET_VESA_MODE
static u8 vbe_get_mode_info(struct vbe_mode_info *mi) static u8 vbe_get_mode_info(struct vesa_state *mi)
{ {
u16 buffer_seg; u16 buffer_seg;
u16 buffer_adr; u16 buffer_adr;
@ -204,13 +204,13 @@ static u8 vbe_get_mode_info(struct vbe_mode_info *mi)
realmode_interrupt(0x10, VESA_GET_MODE_INFO, 0x0000, mi->video_mode, realmode_interrupt(0x10, VESA_GET_MODE_INFO, 0x0000, mi->video_mode,
0x0000, buffer_seg, buffer_adr); 0x0000, buffer_seg, buffer_adr);
memcpy(mi->mode_info_block, buffer, sizeof(struct vbe_mode_info)); memcpy(mi->mode_info_block, buffer, sizeof(struct vesa_state));
mi->valid = true; mi->valid = true;
return 0; return 0;
} }
static u8 vbe_set_mode(struct vbe_mode_info *mi) static u8 vbe_set_mode(struct vesa_state *mi)
{ {
int video_mode = mi->video_mode; int video_mode = mi->video_mode;
@ -225,7 +225,7 @@ static u8 vbe_set_mode(struct vbe_mode_info *mi)
return 0; return 0;
} }
static void vbe_set_graphics(int vesa_mode, struct vbe_mode_info *mode_info) static void vbe_set_graphics(int vesa_mode, struct vesa_state *mode_info)
{ {
unsigned char *framebuffer; unsigned char *framebuffer;
@ -249,7 +249,7 @@ static void vbe_set_graphics(int vesa_mode, struct vbe_mode_info *mode_info)
#endif /* CONFIG_FRAMEBUFFER_SET_VESA_MODE */ #endif /* CONFIG_FRAMEBUFFER_SET_VESA_MODE */
void bios_run_on_x86(struct udevice *dev, unsigned long addr, int vesa_mode, void bios_run_on_x86(struct udevice *dev, unsigned long addr, int vesa_mode,
struct vbe_mode_info *mode_info) struct vesa_state *mode_info)
{ {
pci_dev_t pcidev = dm_pci_get_bdf(dev); pci_dev_t pcidev = dm_pci_get_bdf(dev);
u32 num_dev; u32 num_dev;

View file

@ -106,7 +106,7 @@ static int fsp_video_probe(struct udevice *dev)
vesa->phys_base_ptr = dm_pci_read_bar32(dev, 2); vesa->phys_base_ptr = dm_pci_read_bar32(dev, 2);
gd->fb_base = vesa->phys_base_ptr; gd->fb_base = vesa->phys_base_ptr;
ret = vbe_setup_video_priv(vesa, uc_priv, plat); ret = vesa_setup_video_priv(vesa, uc_priv, plat);
if (ret) if (ret)
goto err; goto err;

View file

@ -83,13 +83,13 @@ static const void *bios_ptr(const void *buf, BE_VGAInfo *vga_info,
} }
static int atibios_debug_mode(BE_VGAInfo *vga_info, RMREGS *regs, static int atibios_debug_mode(BE_VGAInfo *vga_info, RMREGS *regs,
int vesa_mode, struct vbe_mode_info *mode_info) int vesa_mode, struct vesa_state *mode_info)
{ {
void *buffer = (void *)(M.mem_base + vbe_offset); void *buffer = (void *)(M.mem_base + vbe_offset);
u16 buffer_seg = (((unsigned long)vbe_offset) >> 4) & 0xff00; u16 buffer_seg = (((unsigned long)vbe_offset) >> 4) & 0xff00;
u16 buffer_adr = ((unsigned long)vbe_offset) & 0xffff; u16 buffer_adr = ((unsigned long)vbe_offset) & 0xffff;
struct vesa_mode_info *vm; struct vesa_mode_info *vm;
struct vbe_info *info; struct vesa_bios_ext_info *info;
const u16 *modes_bios, *ptr; const u16 *modes_bios, *ptr;
u16 *modes; u16 *modes;
int size; int size;
@ -140,7 +140,7 @@ static int atibios_debug_mode(BE_VGAInfo *vga_info, RMREGS *regs,
int attr; int attr;
debug("Mode %x: ", mode); debug("Mode %x: ", mode);
memset(buffer, '\0', sizeof(struct vbe_mode_info)); memset(buffer, '\0', sizeof(struct vesa_state));
regs->e.eax = VESA_GET_MODE_INFO; regs->e.eax = VESA_GET_MODE_INFO;
regs->e.ebx = 0; regs->e.ebx = 0;
regs->e.ecx = mode; regs->e.ecx = mode;
@ -174,7 +174,7 @@ static int atibios_debug_mode(BE_VGAInfo *vga_info, RMREGS *regs,
} }
static int atibios_set_vesa_mode(RMREGS *regs, int vesa_mode, static int atibios_set_vesa_mode(RMREGS *regs, int vesa_mode,
struct vbe_mode_info *mode_info) struct vesa_state *mode_info)
{ {
void *buffer = (void *)(M.mem_base + vbe_offset); void *buffer = (void *)(M.mem_base + vbe_offset);
u16 buffer_seg = (((unsigned long)vbe_offset) >> 4) & 0xff00; u16 buffer_seg = (((unsigned long)vbe_offset) >> 4) & 0xff00;
@ -192,7 +192,7 @@ static int atibios_set_vesa_mode(RMREGS *regs, int vesa_mode,
return -ENOSYS; return -ENOSYS;
} }
memset(buffer, '\0', sizeof(struct vbe_mode_info)); memset(buffer, '\0', sizeof(struct vesa_state));
debug("VBE: Geting info for VESA mode %#04x\n", vesa_mode); debug("VBE: Geting info for VESA mode %#04x\n", vesa_mode);
regs->e.eax = VESA_GET_MODE_INFO; regs->e.eax = VESA_GET_MODE_INFO;
regs->e.ecx = vesa_mode; regs->e.ecx = vesa_mode;
@ -231,7 +231,7 @@ at this stage the controller has its I/O and memory space enabled and
that all other controllers are in a disabled state. that all other controllers are in a disabled state.
****************************************************************************/ ****************************************************************************/
static void PCI_doBIOSPOST(struct udevice *pcidev, BE_VGAInfo *vga_info, static void PCI_doBIOSPOST(struct udevice *pcidev, BE_VGAInfo *vga_info,
int vesa_mode, struct vbe_mode_info *mode_info) int vesa_mode, struct vesa_state *mode_info)
{ {
RMREGS regs; RMREGS regs;
RMSREGS sregs; RMSREGS sregs;
@ -416,7 +416,7 @@ image we can extract over the PCI bus.
****************************************************************************/ ****************************************************************************/
static int PCI_postController(struct udevice *pcidev, uchar *bios_rom, static int PCI_postController(struct udevice *pcidev, uchar *bios_rom,
int bios_len, BE_VGAInfo *vga_info, int bios_len, BE_VGAInfo *vga_info,
int vesa_mode, struct vbe_mode_info *mode_info) int vesa_mode, struct vesa_state *mode_info)
{ {
u32 bios_image_len; u32 bios_image_len;
uchar *mapped_bios; uchar *mapped_bios;
@ -496,7 +496,7 @@ void biosemu_set_interrupt_handler(int intnum, int (*int_func)(void))
int biosemu_run(struct udevice *pcidev, uchar *bios_rom, int bios_len, int biosemu_run(struct udevice *pcidev, uchar *bios_rom, int bios_len,
BE_VGAInfo *vga_info, int clean_up, int vesa_mode, BE_VGAInfo *vga_info, int clean_up, int vesa_mode,
struct vbe_mode_info *mode_info) struct vesa_state *mode_info)
{ {
/*Post all the display controller BIOS'es*/ /*Post all the display controller BIOS'es*/
if (!PCI_postController(pcidev, bios_rom, bios_len, vga_info, if (!PCI_postController(pcidev, bios_rom, bios_len, vga_info,

View file

@ -202,7 +202,7 @@ static int pci_rom_load(struct pci_rom_header *rom_header,
return 0; return 0;
} }
struct vbe_mode_info mode_info; struct vesa_state mode_info;
void setup_video(struct screen_info *screen_info) void setup_video(struct screen_info *screen_info)
{ {
@ -326,7 +326,7 @@ err:
} }
#ifdef CONFIG_DM_VIDEO #ifdef CONFIG_DM_VIDEO
int vbe_setup_video_priv(struct vesa_mode_info *vesa, int vesa_setup_video_priv(struct vesa_mode_info *vesa,
struct video_priv *uc_priv, struct video_priv *uc_priv,
struct video_uc_plat *plat) struct video_uc_plat *plat)
{ {
@ -358,7 +358,7 @@ int vbe_setup_video_priv(struct vesa_mode_info *vesa,
return 0; return 0;
} }
int vbe_setup_video(struct udevice *dev, int (*int15_handler)(void)) int vesa_setup_video(struct udevice *dev, int (*int15_handler)(void))
{ {
struct video_uc_plat *plat = dev_get_uclass_plat(dev); struct video_uc_plat *plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev); struct video_priv *uc_priv = dev_get_uclass_priv(dev);
@ -378,7 +378,7 @@ int vbe_setup_video(struct udevice *dev, int (*int15_handler)(void))
return ret; return ret;
} }
ret = vbe_setup_video_priv(&mode_info.vesa, uc_priv, plat); ret = vesa_setup_video_priv(&mode_info.vesa, uc_priv, plat);
if (ret) { if (ret) {
if (ret == -ENFILE) { if (ret == -ENFILE) {
/* /*

View file

@ -681,7 +681,7 @@ static int broadwell_igd_probe(struct udevice *dev)
debug("%s: is_broadwell=%d\n", __func__, is_broadwell); debug("%s: is_broadwell=%d\n", __func__, is_broadwell);
ret = igd_pre_init(dev, is_broadwell); ret = igd_pre_init(dev, is_broadwell);
if (!ret) { if (!ret) {
ret = vbe_setup_video(dev, broadwell_igd_int15_handler); ret = vesa_setup_video(dev, broadwell_igd_int15_handler);
if (ret) if (ret)
debug("failed to run video BIOS: %d\n", ret); debug("failed to run video BIOS: %d\n", ret);
} }

View file

@ -57,7 +57,7 @@ static int coreboot_video_probe(struct udevice *dev)
goto err; goto err;
} }
ret = vbe_setup_video_priv(vesa, uc_priv, plat); ret = vesa_setup_video_priv(vesa, uc_priv, plat);
if (ret) { if (ret) {
ret = log_msg_ret("setup", ret); ret = log_msg_ret("setup", ret);
goto err; goto err;

View file

@ -149,7 +149,7 @@ static int efi_video_probe(struct udevice *dev)
if (ret) if (ret)
goto err; goto err;
ret = vbe_setup_video_priv(vesa, uc_priv, plat); ret = vesa_setup_video_priv(vesa, uc_priv, plat);
if (ret) if (ret)
goto err; goto err;

View file

@ -762,7 +762,7 @@ static int bd82x6x_video_probe(struct udevice *dev)
rev = gma_func0_init(dev); rev = gma_func0_init(dev);
if (rev < 0) if (rev < 0)
return rev; return rev;
ret = vbe_setup_video(dev, int15_handler); ret = vesa_setup_video(dev, int15_handler);
if (ret) if (ret)
return ret; return ret;

View file

@ -17,7 +17,7 @@ static int vesa_video_probe(struct udevice *dev)
ulong fbbase; ulong fbbase;
int ret; int ret;
ret = vbe_setup_video(dev, NULL); ret = vesa_setup_video(dev, NULL);
if (ret) if (ret)
return log_ret(ret); return log_ret(ret);

View file

@ -36,14 +36,14 @@ typedef struct {
u8 LowMem[1536]; u8 LowMem[1536];
} BE_VGAInfo; } BE_VGAInfo;
struct vbe_mode_info; struct vesa_state;
int BootVideoCardBIOS(struct udevice *pcidev, BE_VGAInfo **pVGAInfo, int BootVideoCardBIOS(struct udevice *pcidev, BE_VGAInfo **pVGAInfo,
int clean_up); int clean_up);
/* Run a BIOS ROM natively (only supported on x86 machines) */ /* Run a BIOS ROM natively (only supported on x86 machines) */
void bios_run_on_x86(struct udevice *dev, unsigned long addr, int vesa_mode, void bios_run_on_x86(struct udevice *dev, unsigned long addr, int vesa_mode,
struct vbe_mode_info *mode_info); struct vesa_state *mode_info);
/** /**
* bios_set_interrupt_handler() - Install an interrupt handler for the BIOS * bios_set_interrupt_handler() - Install an interrupt handler for the BIOS
@ -61,6 +61,6 @@ int biosemu_setup(struct udevice *pcidev, BE_VGAInfo **pVGAInfo);
int biosemu_run(struct udevice *dev, uchar *bios_rom, int bios_len, int biosemu_run(struct udevice *dev, uchar *bios_rom, int bios_len,
BE_VGAInfo *vga_info, int clean_up, int vesa_mode, BE_VGAInfo *vga_info, int clean_up, int vesa_mode,
struct vbe_mode_info *mode_info); struct vesa_state *mode_info);
#endif #endif

View file

@ -11,7 +11,7 @@
#define _VESA_H #define _VESA_H
/* these structs are for input from and output to OF */ /* these structs are for input from and output to OF */
struct __packed vbe_screen_info { struct __packed vesa_screen_info {
u8 display_type; /* 0=NONE, 1= analog, 2=digital */ u8 display_type; /* 0=NONE, 1= analog, 2=digital */
u16 screen_width; u16 screen_width;
u16 screen_height; u16 screen_height;
@ -22,7 +22,7 @@ struct __packed vbe_screen_info {
u8 edid_block_zero[128]; u8 edid_block_zero[128];
}; };
struct __packed vbe_screen_info_input { struct __packed vesa_screen_info_input {
u8 signature[4]; u8 signature[4];
u16 size_reserved; u16 size_reserved;
u8 monitor_number; u8 monitor_number;
@ -30,8 +30,11 @@ struct __packed vbe_screen_info_input {
u8 color_depth; u8 color_depth;
}; };
/* these structs only store the required a subset of the VBE-defined fields */ /*
struct __packed vbe_info { * These structs only store the required subset of fields in Vesa BIOS
* Extensions
*/
struct __packed vesa_bios_ext_info {
char signature[4]; char signature[4];
u16 version; u16 version;
u32 oem_string_ptr; u32 oem_string_ptr;
@ -80,7 +83,7 @@ struct __packed vesa_mode_info {
u8 reserved[206]; u8 reserved[206];
}; };
struct vbe_mode_info { struct vesa_state {
u16 video_mode; u16 video_mode;
bool valid; bool valid;
union { union {
@ -89,7 +92,7 @@ struct vbe_mode_info {
}; };
}; };
struct vbe_ddc_info { struct vesa_ddc_info {
u8 port_number; /* i.e. monitor number */ u8 port_number; /* i.e. monitor number */
u8 edid_transfer_time; u8 edid_transfer_time;
u8 ddc_level; u8 ddc_level;
@ -101,13 +104,13 @@ struct vbe_ddc_info {
#define VESA_SET_MODE 0x4f02 #define VESA_SET_MODE 0x4f02
#define VESA_GET_CUR_MODE 0x4f03 #define VESA_GET_CUR_MODE 0x4f03
extern struct vbe_mode_info mode_info; extern struct vesa_state mode_info;
struct video_priv; struct video_priv;
struct video_uc_plat; struct video_uc_plat;
int vbe_setup_video_priv(struct vesa_mode_info *vesa, int vesa_setup_video_priv(struct vesa_mode_info *vesa,
struct video_priv *uc_priv, struct video_priv *uc_priv,
struct video_uc_plat *plat); struct video_uc_plat *plat);
int vbe_setup_video(struct udevice *dev, int (*int15_handler)(void)); int vesa_setup_video(struct udevice *dev, int (*int15_handler)(void));
#endif #endif