Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271210
b: refs/heads/master
c: 8e42a96
h: refs/heads/master
v: v3
  • Loading branch information
Laurent Pinchart committed Aug 19, 2011
1 parent 361b0ad commit 088574d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 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: e1599cf8c7ab93cb4bbd67516f5c989211335df1
refs/heads/master: 8e42a962a279369ba3e6a25f321c7cd4d471e633
30 changes: 10 additions & 20 deletions trunk/drivers/video/sis/sis_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1333,19 +1333,14 @@ sisfb_set_base_CRT2(struct sis_video_info *ivideo, unsigned int base)
}

static int
sisfb_pan_var(struct sis_video_info *ivideo, struct fb_var_screeninfo *var)
sisfb_pan_var(struct sis_video_info *ivideo, struct fb_info *info,
struct fb_var_screeninfo *var)
{
if(var->xoffset > (var->xres_virtual - var->xres)) {
return -EINVAL;
}
if(var->yoffset > (var->yres_virtual - var->yres)) {
return -EINVAL;
}

ivideo->current_base = (var->yoffset * var->xres_virtual) + var->xoffset;
ivideo->current_base = var->yoffset * info->var.xres_virtual
+ var->xoffset;

/* calculate base bpp dep. */
switch(var->bits_per_pixel) {
switch (info->var.bits_per_pixel) {
case 32:
break;
case 16:
Expand Down Expand Up @@ -1635,20 +1630,15 @@ sisfb_pan_display(struct fb_var_screeninfo *var, struct fb_info* info)
struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
int err;

if(var->xoffset > (var->xres_virtual - var->xres))
return -EINVAL;

if(var->yoffset > (var->yres_virtual - var->yres))
return -EINVAL;

if(var->vmode & FB_VMODE_YWRAP)
if (var->vmode & FB_VMODE_YWRAP)
return -EINVAL;

if(var->xoffset + info->var.xres > info->var.xres_virtual ||
var->yoffset + info->var.yres > info->var.yres_virtual)
if (var->xoffset + info->var.xres > info->var.xres_virtual ||
var->yoffset + info->var.yres > info->var.yres_virtual)
return -EINVAL;

if((err = sisfb_pan_var(ivideo, var)) < 0)
err = sisfb_pan_var(ivideo, info, var);
if (err < 0)
return err;

info->var.xoffset = var->xoffset;
Expand Down

0 comments on commit 088574d

Please sign in to comment.