From 820e8e55fd31f719c951ce9bcf56b15dfd578b82 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 16 Jan 2010 00:31:24 +0100 Subject: [PATCH] Avoid retrieving video info when no video is active --- loader/i386/bsd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index e6c5273cd..de4a256de 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -789,6 +789,7 @@ grub_netbsd_setup_video (void) const char *modevar; struct grub_netbsd_btinfo_framebuf params; grub_err_t err; + grub_video_driver_id_t driv_id; modevar = grub_env_get ("gfxpayload"); @@ -811,6 +812,10 @@ grub_netbsd_setup_video (void) if (err) return err; + driv_id = grub_video_get_driver_id (); + if (driv_id == GRUB_VIDEO_DRIVER_NONE) + return GRUB_ERR_NONE; + err = grub_video_get_info_and_fini (&mode_info, &framebuffer); if (err) @@ -835,7 +840,7 @@ grub_netbsd_setup_video (void) /* VESA packed modes may come with zeroed mask sizes, which need to be set here according to DAC Palette width. If we don't, this results in Linux displaying a black screen. */ - if (mode_info.bpp <= 8) + if (mode_info.bpp <= 8 && driv_id == GRUB_VIDEO_DRIVER_VBE) { struct grub_vbe_info_block controller_info; int status;