[PATCH 3/5] i386: Set 6-bit DAC channel properties in vesa video setup

DORMANTno replies

From: "Antonino A. Daplas" <adaplas@gmail.com>
Date: 2007-06-05 11:28:57
Subsystem: the rest · Maintainer: Linus Torvalds

If the video BIOS is not capable of switching or failed to switch the
hardware to 8-bit DAC, the channel properties are not set.  This leads
to a blank (all black) display with vesafb at 8 bpp. Fix by defaulting
to a 6-bit DAC.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
---

 arch/i386/boot/video-vesa.c |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/arch/i386/boot/video-vesa.c b/arch/i386/boot/video-vesa.c
index 26d66a7..3c21bd7 100644
--- a/arch/i386/boot/video-vesa.c
+++ b/arch/i386/boot/video-vesa.c
@@ -153,19 +153,21 @@ static int vesa_set_mode(struct mode_inf
 /* Switch DAC to 8-bit mode */
 static void vesa_dac_set_8bits(void)
 {
-	u16 ax, bx;
-	u8 dac_size;
+	u8 dac_size = 6;
 
-	ax = 0x4f08;
-	bx = 0x0800;
-	asm volatile(INT10
-		     : "+a" (ax), "+b" (bx)
-		     : : "ecx", "edx", "esi", "edi");
+	/* If possible, switch the DAC to 8-bit mode */
+	if (vginfo.capabilities & 1) {
+		u16 ax, bx;
 
-	if (ax != 0x004f)
-		return;
+		ax = 0x4f08;
+		bx = 0x0800;
+		asm volatile(INT10
+			     : "+a" (ax), "+b" (bx)
+			     : : "ecx", "edx", "esi", "edi");
 
-	dac_size = bx >> 8;
+		if (ax == 0x004f)
+			dac_size = bx >> 8;
+	}
 
 	/* Set the color sizes to the DAC size, and offsets to 0 */
 	boot_params.screen_info.red_size = dac_size;
@@ -219,8 +221,7 @@ static void vesa_store_mode_params_graph
 	/* General parameters */
 	boot_params.screen_info.lfb_size = vginfo.total_memory;
 
-	/* If possible, switch the DAC to 8-bit mode */
-	if (vminfo.bpp <= 8 && (vginfo.capabilities & 1))
+	if (vminfo.bpp <= 8)
 		vesa_dac_set_8bits();
 
 	vesa_store_pm_info();


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help