public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yannick Heneault <yannick_heneault@matrox.com>
To: linux kernel mailing list <linux-kernel@vger.kernel.org>
Cc: airlied@redhat.com, akpm@linux-foundation.org, hpa@zytor.com
Subject: [BUG] VGA palette corruption in vgacon.c for EFI machine
Date: Fri, 26 Nov 2010 09:44:51 -0500	[thread overview]
Message-ID: <4CEFC7E3.4060402@matrox.com> (raw)

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

             reply	other threads:[~2010-11-26 14:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-26 14:44 Yannick Heneault [this message]
2011-01-05  1:05 ` [BUG] VGA palette corruption in vgacon.c for EFI machine Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2010-11-23 21:39 Yannick Heneault
2010-11-23 21:25 Yannick Heneault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CEFC7E3.4060402@matrox.com \
    --to=yannick_heneault@matrox.com \
    --cc=airlied@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox