public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG] VGA palette corruption in vgacon.c for EFI machine
@ 2010-11-23 21:39 Yannick Heneault
  0 siblings, 0 replies; 4+ messages in thread
From: Yannick Heneault @ 2010-11-23 21:39 UTC (permalink / raw)
  To: linux kernel mailing list

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

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [BUG] VGA palette corruption in vgacon.c for EFI machine
@ 2010-11-26 14:44 Yannick Heneault
  2011-01-05  1:05 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Yannick Heneault @ 2010-11-26 14:44 UTC (permalink / raw)
  To: linux kernel mailing list; +Cc: airlied, akpm, hpa

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

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [BUG] VGA palette corruption in vgacon.c for EFI machine
@ 2010-11-23 21:25 Yannick Heneault
  0 siblings, 0 replies; 4+ messages in thread
From: Yannick Heneault @ 2010-11-23 21:25 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-05  1:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-23 21:39 [BUG] VGA palette corruption in vgacon.c for EFI machine Yannick Heneault
  -- strict thread matches above, loose matches on Subject: below --
2010-11-26 14:44 Yannick Heneault
2011-01-05  1:05 ` Andrew Morton
2010-11-23 21:25 Yannick Heneault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox