patch-2.3.1 linux/drivers/video/vgacon.c

Next file: linux/fs/adfs/dir.c
Previous file: linux/drivers/video/fbmem.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.0/linux/drivers/video/vgacon.c linux/drivers/video/vgacon.c
@@ -153,7 +153,7 @@
 __initfunc(static const char *vgacon_startup(void))
 {
 	const char *display_desc = NULL;
-	u16 saved;
+	u16 saved1, saved2;
 	u16 *p;
 
 	if (ORIG_VIDEO_ISVGA == VIDEO_TYPE_VLFB) {
@@ -267,18 +267,24 @@
 	 *	Are there smarter methods around?
 	 */
 	p = (u16 *)vga_vram_base;
-	saved = scr_readw(p);
+	saved1 = scr_readw(p);
+	saved2 = scr_readw(p + 1);
 	scr_writew(0xAA55, p);
-	if (scr_readw(p) != 0xAA55) {
-		scr_writew(saved, p);
+	scr_writew(0x55AA, p + 1);
+	if (scr_readw(p) != 0xAA55 || scr_readw(p + 1) != 0x55AA) {
+		scr_writew(saved1, p);
+		scr_writew(saved2, p + 1);
 		goto no_vga;
 	}
 	scr_writew(0x55AA, p);
-	if (scr_readw(p) != 0x55AA) {
-		scr_writew(saved, p);
+	scr_writew(0xAA55, p + 1);
+	if (scr_readw(p) != 0x55AA || scr_readw(p + 1) != 0xAA55) {
+		scr_writew(saved1, p);
+		scr_writew(saved2, p + 1);
 		goto no_vga;
 	}
-	scr_writew(saved, p);
+	scr_writew(saved1, p);
+	scr_writew(saved2, p + 1);
 
 	if (vga_video_type == VIDEO_TYPE_EGAC
 	    || vga_video_type == VIDEO_TYPE_VGAC

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)