]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Avoid retrieving video info when no video is active
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 15 Jan 2010 23:31:24 +0000 (00:31 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 15 Jan 2010 23:31:24 +0000 (00:31 +0100)
loader/i386/bsd.c

index e6c5273cdfcb312d8279f4b08b909c06be3b3a2c..de4a256de5447174c94a3504545ff6ef089e5392 100644 (file)
@@ -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;