Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105508
b: refs/heads/master
c: 74a933f
h: refs/heads/master
v: v3
  • Loading branch information
Krzysztof Helt authored and Linus Torvalds committed Jul 24, 2008
1 parent d5f8d12 commit d8e4ec7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aa0aa8ab2f28d8985daa79ecab51970376e17157
refs/heads/master: 74a933feaf13f705e6c798d87efe6a9d758b3ca0
34 changes: 34 additions & 0 deletions trunk/drivers/video/tridentfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ static int tridentfb_check_var(struct fb_var_screeninfo *var,
{
struct tridentfb_par *par = info->par;
int bpp = var->bits_per_pixel;
int ramdac = 230000; /* 230MHz for most 3D chips */
debug("enter\n");

/* check color depth */
Expand All @@ -837,6 +838,12 @@ static int tridentfb_check_var(struct fb_var_screeninfo *var,
/* check whether resolution fits on panel and in memory */
if (par->flatpanel && nativex && var->xres > nativex)
return -EINVAL;
/* various resolution checks */
var->xres = (var->xres + 7) & ~0x7;
if (var->xres != var->xres_virtual)
var->xres_virtual = var->xres;
if (var->yres > var->yres_virtual)
var->yres_virtual = var->yres;
if (var->xres * var->yres_virtual * bpp / 8 > info->fix.smem_len)
return -EINVAL;

Expand Down Expand Up @@ -868,6 +875,33 @@ static int tridentfb_check_var(struct fb_var_screeninfo *var,
default:
return -EINVAL;
}

if (is_xp(par->chip_id))
ramdac = 350000;

switch (par->chip_id) {
case TGUI9440:
ramdac = 90000;
break;
case CYBER9320:
case TGUI9660:
ramdac = 135000;
break;
case PROVIDIA9685:
case CYBER9388:
case CYBER9382:
case CYBER9385:
ramdac = 170000;
break;
}

/* The clock is doubled for 32 bpp */
if (bpp == 32)
ramdac /= 2;

if (PICOS2KHZ(var->pixclock) > ramdac)
return -EINVAL;

debug("exit\n");

return 0;
Expand Down

0 comments on commit d8e4ec7

Please sign in to comment.