All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/5] i386: Set 6-bit DAC channel properties in vesa video setup
@ 2007-06-05 11:21 Antonino A. Daplas
  0 siblings, 0 replies; only message in thread
From: Antonino A. Daplas @ 2007-06-05 11:21 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Fbdev development list, H. Peter Anvin

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/

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-06-05 11:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-05 11:21 [PATCH 3/5] i386: Set 6-bit DAC channel properties in vesa video setup Antonino A. Daplas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.