Skip to contentSkip to conversation

vgacon: checking for efi machine

PATCH New Yannick Heneault 1 participant 1 message Jan 6, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vgacon: checking for efi machine

It seems there is a small problem of VGA palette corruption on EFI machine. When the kernel initializes the architecture, it checks if themachine is a EFI machine and assumes that a VGA console can exist. When it initialize the console in vgacon_startup it checks if itcan really use the VGA console. I think this is where a check ismissing. Currently, the function can fail if a VESA boot mode isdetected but not if a EFI boot mode was used. Thus, the function vgacon_startup doesn't fail and initialize thevideo card for a real VGA mode. This function change the first 16entries of the VGA palette. When the efifb driver kick-in, the paletteis not restored to default ramp value, thus the 16 first entry remain ina modified state. The following patch prevent this corruption.

---

drivers/video/console/vgacon.c +2 -1
diff -Nur linux-2.6.37-ori/drivers/video/console/vgacon.c linux-2.6.37/drivers/video/console/vgacon.c
@@ -375,7 +375,8 @@
 	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;