From: "Antonino A. Daplas" <adaplas@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux Fbdev development list
<linux-fbdev-devel@lists.sourceforge.net>,
"H. Peter Anvin" <hpa@zytor.com>
Subject: [PATCH 3/5] i386: Set 6-bit DAC channel properties in vesa video setup
Date: Tue, 05 Jun 2007 19:21:05 +0800 [thread overview]
Message-ID: <46654721.9040503@gmail.com> (raw)
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/
reply other threads:[~2007-06-05 11:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46654721.9040503@gmail.com \
--to=adaplas@gmail.com \
--cc=akpm@osdl.org \
--cc=hpa@zytor.com \
--cc=linux-fbdev-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.