Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83564
b: refs/heads/master
c: 74f482c
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt authored and Linus Torvalds committed Feb 6, 2008
1 parent 0818df9 commit 5f6928e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 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: 2e9750272cd49732293b6fe771ae110be8d87273
refs/heads/master: 74f482cca5f76643e7f323e66cc38b1a882d5e6f
22 changes: 20 additions & 2 deletions trunk/drivers/video/nvidia/nvidia.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,9 +849,27 @@ static int nvidiafb_check_var(struct fb_var_screeninfo *var,
if (!mode_valid && info->monspecs.modedb_len)
return -EINVAL;

/*
* If we're on a flat panel, check if the mode is outside of the
* panel dimensions. If so, cap it and try for the next best mode
* before bailing out.
*/
if (par->fpWidth && par->fpHeight && (par->fpWidth < var->xres ||
par->fpHeight < var->yres))
return -EINVAL;
par->fpHeight < var->yres)) {
const struct fb_videomode *mode;

var->xres = par->fpWidth;
var->yres = par->fpHeight;

mode = fb_find_best_mode(var, &info->modelist);
if (!mode) {
printk(KERN_ERR PFX "mode out of range of flat "
"panel dimensions\n");
return -EINVAL;
}

fb_videomode_to_var(var, mode);
}

if (var->yres_virtual < var->yres)
var->yres_virtual = var->yres;
Expand Down

0 comments on commit 5f6928e

Please sign in to comment.