Skip to contentSkip to conversation

i386: Set 6-bit DAC channel properties in vesa video setup

PATCH New Antonino A. Daplas 1 participant 1 message Jun 5, 2007 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

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

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.

---

 arch/i386/boot/video-vesa.c |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)
arch/i386/boot/video-vesa.c +13 -12
index 26d66a7..3c21bd7 100644
@@ -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/