Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30298
b: refs/heads/master
c: 6dbde38
h: refs/heads/master
v: v3
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Jun 26, 2006
1 parent ba7ce17 commit 6b1e552
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 313ca22f0bfab792adeb447146d9cb86536c64d3
refs/heads/master: 6dbde380ca525bbfedd65e11402f345e1d64cba9
32 changes: 17 additions & 15 deletions trunk/drivers/video/vesafb.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static int inverse = 0;
static int mtrr = 0; /* disable mtrr */
static int vram_remap __initdata = 0; /* Set amount of memory to be used */
static int vram_total __initdata = 0; /* Set total amount of memory */
static int pmi_setpal = 0; /* pmi for palette changes ??? */
static int pmi_setpal = 1; /* pmi for palette changes ??? */
static int ypan = 0; /* 0..nothing, 1..ypan, 2..ywrap */
static unsigned short *pmi_base = NULL;
static void (*pmi_start)(void);
Expand Down Expand Up @@ -86,10 +86,24 @@ static int vesa_setpalette(int regno, unsigned red, unsigned green,
int shift = 16 - depth;
int err = -EINVAL;

/*
* Try VGA registers first...
*/
if (vga_compat) {
outb_p(regno, dac_reg);
outb_p(red >> shift, dac_val);
outb_p(green >> shift, dac_val);
outb_p(blue >> shift, dac_val);
err = 0;
}

#ifdef __i386__
struct { u_char blue, green, red, pad; } entry;
/*
* Fallback to the PMI....
*/
if (err && pmi_setpal) {
struct { u_char blue, green, red, pad; } entry;

if (pmi_setpal) {
entry.red = red >> shift;
entry.green = green >> shift;
entry.blue = blue >> shift;
Expand All @@ -107,18 +121,6 @@ static int vesa_setpalette(int regno, unsigned red, unsigned green,
}
#endif

/*
* without protected mode interface and if VGA compatible,
* try VGA registers...
*/
if (err && vga_compat) {
outb_p(regno, dac_reg);
outb_p(red >> shift, dac_val);
outb_p(green >> shift, dac_val);
outb_p(blue >> shift, dac_val);
err = 0;
}

return err;
}

Expand Down

0 comments on commit 6b1e552

Please sign in to comment.