Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752529Ab0KWV5R (ORCPT ); Tue, 23 Nov 2010 16:57:17 -0500 Received: from mtxmxout2.matrox.com ([138.11.2.92]:40111 "EHLO mtxmxout2.matrox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752299Ab0KWV5Q (ORCPT ); Tue, 23 Nov 2010 16:57:16 -0500 X-Virus-MTX-Scanned: by Matrox Virus scanner at venus.matrox.com Message-ID: <4CEC3149.60004@matrox.com> Date: Tue, 23 Nov 2010 16:25:29 -0500 From: Yannick Heneault User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100915 Thunderbird/3.0.8 MIME-Version: 1.0 To: linux-kernel@vger.kernel.org Subject: [BUG] VGA palette corruption in vgacon.c for EFI machine Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2005 Lines: 48 Hi, It seems there is a small problem of VGA palette corruption on EFI machine. When the kernel initializes the architecture, it checks if the machine is a EFI machine and if the memory at 0xa0000 is not tagged as conventional memory, which should not be the case because this is VGA memory. In that case, the kernel assumes that a VGA console can exist. I would think that this assumption is correct. When the kernel initialize the console in vgacon_startup it checks if it can really use the VGA console. I think this is where a check is missing. Currently, the function can fail if a VESA boot mode is detected but not if a EFI boot mode was used. I think the code should be modified like this : --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -377,7 +377,8 @@ static const char *vgacon_startup(void) u16 saved1, saved2; volatile u16 *p; - if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB) { + if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB || + screen_info.orig_video_isVGA == VIDEO_TYPE_EFI) { no_vga: #ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; In that case, the VGA console will fail and a dummy console will be temporary used until the EFI driver get loaded. At that point the console will be mapped to the EFI driver and graphics (splash screen and penguins) will appear correctly. Currently, the function vgacon_startup doesn't fail and initialize the video card for a real VGA mode. This function change the first 16 entries of the VGA palette. When the efifb driver kick-in, the palette is not restored to default ramp value, thus the 16 first entry remain in a modified state. Thanks, Yannick Heneault -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/