Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15102
b: refs/heads/master
c: 1207069
h: refs/heads/master
v: v3
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Dec 13, 2005
1 parent 2ad7efe commit 489c4cd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 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: 4743484718e1d710321f24f8ef7d0124a48291b3
refs/heads/master: 1207069f6f8f3d1b71641fdaa6cc04fca6fff9f5
26 changes: 21 additions & 5 deletions trunk/drivers/video/fbmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,14 +722,30 @@ static void try_to_load(int fb)
int
fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
{
struct fb_fix_screeninfo *fix = &info->fix;
int xoffset = var->xoffset;
int yoffset = var->yoffset;
int err;
int err = 0, yres = info->var.yres;

if (var->yoffset > 0) {
if (var->vmode & FB_VMODE_YWRAP) {
if (!fix->ywrapstep || (var->yoffset % fix->ywrapstep))
err = -EINVAL;
else
yres = 0;
} else if (!fix->ypanstep || (var->yoffset % fix->ypanstep))
err = -EINVAL;
}

if (var->xoffset > 0 && (!fix->xpanstep ||
(var->xoffset % fix->xpanstep)))
err = -EINVAL;

if (err || !info->fbops->fb_pan_display || xoffset < 0 ||
yoffset < 0 || var->yoffset + yres > info->var.yres_virtual ||
var->xoffset + info->var.xres > info->var.xres_virtual)
return -EINVAL;

if (xoffset < 0 || yoffset < 0 || !info->fbops->fb_pan_display ||
xoffset + info->var.xres > info->var.xres_virtual ||
yoffset + info->var.yres > info->var.yres_virtual)
return -EINVAL;
if ((err = info->fbops->fb_pan_display(var, info)))
return err;
info->var.xoffset = var->xoffset;
Expand Down

0 comments on commit 489c4cd

Please sign in to comment.