Add priorities support
This commit is contained in:
parent
601c84fd16
commit
d49703d151
8 changed files with 33 additions and 3 deletions
|
@ -183,9 +183,19 @@ typedef enum grub_video_driver_id
|
|||
GRUB_VIDEO_DRIVER_EFI_UGA,
|
||||
GRUB_VIDEO_DRIVER_EFI_GOP,
|
||||
GRUB_VIDEO_DRIVER_SM712,
|
||||
GRUB_VIDEO_DRIVER_VGA
|
||||
GRUB_VIDEO_DRIVER_VGA,
|
||||
GRUB_VIDEO_DRIVER_SDL
|
||||
} grub_video_driver_id_t;
|
||||
|
||||
typedef enum grub_video_adapter_prio
|
||||
{
|
||||
GRUB_VIDEO_ADAPTER_PRIO_FALLBACK = 60,
|
||||
GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY = 70,
|
||||
GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE = 80,
|
||||
GRUB_VIDEO_ADAPTER_PRIO_NATIVE = 100
|
||||
} grub_video_adapter_prio_t;
|
||||
|
||||
|
||||
struct grub_video_adapter
|
||||
{
|
||||
/* The next video adapter. */
|
||||
|
@ -195,6 +205,8 @@ struct grub_video_adapter
|
|||
const char *name;
|
||||
grub_video_driver_id_t id;
|
||||
|
||||
grub_video_adapter_prio_t prio;
|
||||
|
||||
/* Initialize the video adapter. */
|
||||
grub_err_t (*init) (void);
|
||||
|
||||
|
@ -269,8 +281,11 @@ extern grub_video_adapter_t EXPORT_VAR(grub_video_adapter_list);
|
|||
static inline void
|
||||
grub_video_register (grub_video_adapter_t adapter)
|
||||
{
|
||||
grub_list_push (GRUB_AS_LIST_P (&grub_video_adapter_list),
|
||||
GRUB_AS_LIST (adapter));
|
||||
grub_video_adapter_t *p;
|
||||
for (p = &grub_video_adapter_list; *p && (*p)->prio > adapter->prio;
|
||||
p = &((*p)->next));
|
||||
adapter->next = *p;
|
||||
*p = adapter;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -355,6 +355,8 @@ static struct grub_video_adapter grub_video_gop_adapter =
|
|||
.name = "EFI GOP driver",
|
||||
.id = GRUB_VIDEO_DRIVER_EFI_GOP,
|
||||
|
||||
.prio = GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE,
|
||||
|
||||
.init = grub_video_gop_init,
|
||||
.fini = grub_video_gop_fini,
|
||||
.setup = grub_video_gop_setup,
|
||||
|
|
|
@ -302,6 +302,8 @@ static struct grub_video_adapter grub_video_uga_adapter =
|
|||
.name = "EFI UGA driver",
|
||||
.id = GRUB_VIDEO_DRIVER_EFI_UGA,
|
||||
|
||||
.prio = GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY,
|
||||
|
||||
.init = grub_video_uga_init,
|
||||
.fini = grub_video_uga_fini,
|
||||
.setup = grub_video_uga_setup,
|
||||
|
|
|
@ -200,6 +200,9 @@ grub_video_sdl_set_active_render_target (struct grub_video_render_target *target
|
|||
static struct grub_video_adapter grub_video_sdl_adapter =
|
||||
{
|
||||
.name = "SDL Video Driver",
|
||||
.id = GRUB_VIDEO_DRIVER_SDL,
|
||||
|
||||
.prio = GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE,
|
||||
|
||||
.init = grub_video_sdl_init,
|
||||
.fini = grub_video_sdl_fini,
|
||||
|
|
|
@ -783,6 +783,8 @@ static struct grub_video_adapter grub_video_vbe_adapter =
|
|||
.name = "VESA BIOS Extension Video Driver",
|
||||
.id = GRUB_VIDEO_DRIVER_VBE,
|
||||
|
||||
.prio = GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE,
|
||||
|
||||
.init = grub_video_vbe_init,
|
||||
.fini = grub_video_vbe_fini,
|
||||
.setup = grub_video_vbe_setup,
|
||||
|
|
|
@ -375,6 +375,8 @@ static struct grub_video_adapter grub_video_vga_adapter =
|
|||
.name = "VGA Video Driver",
|
||||
.id = GRUB_VIDEO_DRIVER_VGA,
|
||||
|
||||
.prio = GRUB_VIDEO_ADAPTER_PRIO_FALLBACK,
|
||||
|
||||
.init = grub_video_vga_init,
|
||||
.fini = grub_video_vga_fini,
|
||||
.setup = grub_video_vga_setup,
|
||||
|
|
|
@ -254,6 +254,8 @@ static struct grub_video_adapter grub_video_ieee1275_adapter =
|
|||
{
|
||||
.name = "IEEE1275 video driver",
|
||||
|
||||
.prio = GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE,
|
||||
|
||||
.init = grub_video_ieee1275_init,
|
||||
.fini = grub_video_ieee1275_fini,
|
||||
.setup = grub_video_ieee1275_setup,
|
||||
|
|
|
@ -193,6 +193,8 @@ static struct grub_video_adapter grub_video_sm712_adapter =
|
|||
.name = "SM712 Video Driver",
|
||||
.id = GRUB_VIDEO_DRIVER_SM712,
|
||||
|
||||
.prio = GRUB_VIDEO_ADAPTER_PRIO_NATIVE,
|
||||
|
||||
.init = grub_video_sm712_video_init,
|
||||
.fini = grub_video_sm712_video_fini,
|
||||
.setup = grub_video_sm712_setup,
|
||||
|
|
Loading…
Reference in a new issue