From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LtNQQ-0001t4-Hv for mharc-grub-devel@gnu.org; Mon, 13 Apr 2009 10:46:18 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LtNQO-0001sn-VR for grub-devel@gnu.org; Mon, 13 Apr 2009 10:46:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LtNQK-0001rn-C4 for grub-devel@gnu.org; Mon, 13 Apr 2009 10:46:16 -0400 Received: from [199.232.76.173] (port=58872 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LtNQK-0001ri-7n for grub-devel@gnu.org; Mon, 13 Apr 2009 10:46:12 -0400 Received: from aybabtu.com ([69.60.117.155]:52825) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LtNQ9-00029h-RR; Mon, 13 Apr 2009 10:46:02 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1LtNEi-0003oD-6f; Mon, 13 Apr 2009 16:34:12 +0200 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1LtNQ6-0005nj-Gr; Mon, 13 Apr 2009 16:45:58 +0200 Date: Mon, 13 Apr 2009 16:45:58 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20090413144558.GA22165@thorin> References: <1239032043.8986.27.camel@mj> <20090413141657.GE12170@thorin> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="JP+T4n/bALQSJXh8" Content-Disposition: inline In-Reply-To: <20090413141657.GE12170@thorin> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Pavel Roskin Subject: Re: [PATCH] Video mode fixes in linux loader X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2009 14:46:17 -0000 --JP+T4n/bALQSJXh8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Apr 13, 2009 at 04:16:57PM +0200, Robert Millan wrote: > > The default VGA mode is now GRUB_LINUX_VID_MODE_NORMAL, not the mode of > > the kernel we tried to load before. > > Ok, BUT if we're already in vesa mode, and we know it works (since we're using > it), there's no point in wasting time only to get a worse mode. > > We should just make sure subsequent calls to "linux" command override the > previous one. I think this should do it. Can you confirm this works for you? (note: this patch is intentionally missing indentation, for readability) -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all." --JP+T4n/bALQSJXh8 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="vid_mode.diff" * loader/i386/linux.c (grub_linux_boot): Only go back to text mode when `vid_mode' wasn't initialized. Otherwise leave the current mode (whatever that is). (grub_cmd_linux): Default to `vid_mode = 0' rather than `GRUB_LINUX_VID_MODE_NORMAL'. Index: loader/i386/linux.c =================================================================== --- loader/i386/linux.c (revision 2097) +++ loader/i386/linux.c (working copy) @@ -331,12 +331,14 @@ grub_linux_boot (void) params = real_mode_mem; - if (vid_mode < GRUB_LINUX_VID_MODE_VESA_START || - vid_mode >= GRUB_LINUX_VID_MODE_VESA_START + - ARRAY_SIZE (linux_vesafb_modes)) - grub_video_restore (); - else if (vid_mode) + if (vid_mode) { + if (vid_mode < GRUB_LINUX_VID_MODE_VESA_START || + vid_mode >= GRUB_LINUX_VID_MODE_VESA_START + + ARRAY_SIZE (linux_vesafb_modes)) + grub_video_restore (); + else + { struct linux_vesafb_mode *linux_mode; int depth, flags; @@ -366,6 +368,7 @@ grub_linux_boot (void) return grub_errno; } } + } if (! grub_linux_setup_video (params)) params->have_vga = GRUB_VIDEO_TYPE_VLFB; @@ -570,8 +573,7 @@ grub_cmd_linux (grub_command_t cmd __att (unsigned) real_size, (unsigned) prot_size); /* Look for memory size and video mode specified on the command line. */ - vid_mode = GRUB_LINUX_VID_MODE_NORMAL; - linux_mem_size = 0; + vid_mode = linux_mem_size = 0; for (i = 1; i < argc; i++) if (grub_memcmp (argv[i], "vga=", 4) == 0) { --JP+T4n/bALQSJXh8--