Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143190
b: refs/heads/master
c: 0ca1071
h: refs/heads/master
v: v3
  • Loading branch information
Michal Januszewski authored and Linus Torvalds committed Apr 13, 2009
1 parent f77b560 commit e23ff83
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 26 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: ebde441177da3bad156701d351509f34295282ab
refs/heads/master: 0ca1071f7dbd673de826eb3fb01bfdfd1d423433
35 changes: 10 additions & 25 deletions trunk/drivers/video/uvesafb.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static u16 maxvf __devinitdata; /* maximum vertical frequency */
static u16 maxhf __devinitdata; /* maximum horizontal frequency */
static u16 vbemode __devinitdata; /* force use of a specific VBE mode */
static char *mode_option __devinitdata;
static u8 dac_width = 6;

static struct uvesafb_ktask *uvfb_tasks[UVESAFB_TASKS_MAX];
static DEFINE_MUTEX(uvfb_lock);
Expand Down Expand Up @@ -303,22 +304,10 @@ static void uvesafb_setup_var(struct fb_var_screeninfo *var,
var->blue.offset = 0;
var->transp.offset = 0;

/*
* We're assuming that we can switch the DAC to 8 bits. If
* this proves to be incorrect, we'll update the fields
* later in set_par().
*/
if (par->vbe_ib.capabilities & VBE_CAP_CAN_SWITCH_DAC) {
var->red.length = 8;
var->green.length = 8;
var->blue.length = 8;
var->transp.length = 0;
} else {
var->red.length = 6;
var->green.length = 6;
var->blue.length = 6;
var->transp.length = 0;
}
var->red.length = 8;
var->green.length = 8;
var->blue.length = 8;
var->transp.length = 0;
}
}

Expand Down Expand Up @@ -1006,7 +995,7 @@ static int uvesafb_setcolreg(unsigned regno, unsigned red, unsigned green,
struct fb_info *info)
{
struct uvesafb_pal_entry entry;
int shift = 16 - info->var.green.length;
int shift = 16 - dac_width;
int err = 0;

if (regno >= info->cmap.len)
Expand Down Expand Up @@ -1055,7 +1044,7 @@ static int uvesafb_setcolreg(unsigned regno, unsigned red, unsigned green,
static int uvesafb_setcmap(struct fb_cmap *cmap, struct fb_info *info)
{
struct uvesafb_pal_entry *entries;
int shift = 16 - info->var.green.length;
int shift = 16 - dac_width;
int i, err = 0;

if (info->var.bits_per_pixel == 8) {
Expand Down Expand Up @@ -1317,13 +1306,9 @@ static int uvesafb_set_par(struct fb_info *info)
err = uvesafb_exec(task);
if (err || (task->t.regs.eax & 0xffff) != 0x004f ||
((task->t.regs.ebx & 0xff00) >> 8) != 8) {
/*
* We've failed to set the DAC palette format -
* time to correct var.
*/
info->var.red.length = 6;
info->var.green.length = 6;
info->var.blue.length = 6;
dac_width = 6;
} else {
dac_width = 8;
}
}

Expand Down

0 comments on commit e23ff83

Please sign in to comment.