2010-01-15 Vladimir Serbinenko <phcoder@gmail.com>

Video driver ids.

	* include/grub/video.h (grub_video_driver_id): New type.
	(grub_video_adapter): New member 'id'. All users updated.
	(grub_video_get_driver_id): New proto.
	* video/video.c (grub_video_get_driver_id): New function.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-01-15 16:11:18 +01:00
parent 5c71db1b9b
commit 0d90e8a6fb
6 changed files with 32 additions and 0 deletions

View file

@ -1,3 +1,12 @@
2010-01-15 Vladimir Serbinenko <phcoder@gmail.com>
Video driver ids.
* include/grub/video.h (grub_video_driver_id): New type.
(grub_video_adapter): New member 'id'. All users updated.
(grub_video_get_driver_id): New proto.
* video/video.c (grub_video_get_driver_id): New function.
2010-01-14 Carles Pina i Estany <carles@pina.cat>
* util/grub.d/30_os-prober.in: Use `set var=val' rather than plain

View file

@ -159,10 +159,19 @@ struct grub_video_palette_data
grub_uint8_t a; /* Reserved bits value (0-255). */
};
typedef enum grub_video_driver_id
{
GRUB_VIDEO_DRIVER_NONE,
GRUB_VIDEO_DRIVER_VBE,
GRUB_VIDEO_DRIVER_EFI_UGA,
GRUB_VIDEO_DRIVER_EFI_GOP
} grub_video_driver_id_t;
struct grub_video_adapter
{
/* The video adapter name. */
const char *name;
grub_video_driver_id_t id;
/* Initialize the video adapter. */
grub_err_t (*init) (void);
@ -310,4 +319,7 @@ grub_err_t grub_video_set_mode (const char *modestring,
int NESTED_FUNC_ATTR (*hook) (grub_video_adapter_t p,
struct grub_video_mode_info *mode_info));
grub_video_driver_id_t
grub_video_get_driver_id (void);
#endif /* ! GRUB_VIDEO_HEADER */

View file

@ -353,6 +353,7 @@ grub_video_gop_get_info_and_fini (struct grub_video_mode_info *mode_info,
static struct grub_video_adapter grub_video_gop_adapter =
{
.name = "EFI GOP driver",
.id = GRUB_VIDEO_DRIVER_EFI_GOP,
.init = grub_video_gop_init,
.fini = grub_video_gop_fini,

View file

@ -300,6 +300,7 @@ grub_video_uga_get_info_and_fini (struct grub_video_mode_info *mode_info,
static struct grub_video_adapter grub_video_uga_adapter =
{
.name = "EFI UGA driver",
.id = GRUB_VIDEO_DRIVER_EFI_UGA,
.init = grub_video_uga_init,
.fini = grub_video_uga_fini,

View file

@ -557,6 +557,7 @@ grub_video_vbe_get_info_and_fini (struct grub_video_mode_info *mode_info,
static struct grub_video_adapter grub_video_vbe_adapter =
{
.name = "VESA BIOS Extension Video Driver",
.id = GRUB_VIDEO_DRIVER_VBE,
.init = grub_video_vbe_init,
.fini = grub_video_vbe_fini,

View file

@ -93,6 +93,14 @@ grub_video_get_info (struct grub_video_mode_info *mode_info)
return grub_video_adapter_active->get_info (mode_info);
}
grub_video_driver_id_t
grub_video_get_driver_id (void)
{
if (! grub_video_adapter_active)
return GRUB_VIDEO_DRIVER_NONE;
return grub_video_adapter_active->id;
}
/* Get information about active video mode. */
grub_err_t
grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info,