Commit 2194f957 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Helge Deller

video: fbdev: amiga: Simplify amifb_pan_display()

The fb_pan_display() function in the core already takes care of
validating most panning parameters before calling the driver's
.fb_pan_display() callback, and of updating the panning state
afterwards, so there is no need to repeat that in the driver.

Remove the duplicate code.
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent ff699273
...@@ -2540,27 +2540,16 @@ static int amifb_blank(int blank, struct fb_info *info) ...@@ -2540,27 +2540,16 @@ static int amifb_blank(int blank, struct fb_info *info)
static int amifb_pan_display(struct fb_var_screeninfo *var, static int amifb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info) struct fb_info *info)
{ {
if (var->vmode & FB_VMODE_YWRAP) { if (!(var->vmode & FB_VMODE_YWRAP)) {
if (var->yoffset < 0 ||
var->yoffset >= info->var.yres_virtual || var->xoffset)
return -EINVAL;
} else {
/* /*
* TODO: There will be problems when xpan!=1, so some columns * TODO: There will be problems when xpan!=1, so some columns
* on the right side will never be seen * on the right side will never be seen
*/ */
if (var->xoffset + info->var.xres > if (var->xoffset + info->var.xres >
upx(16 << maxfmode, info->var.xres_virtual) || upx(16 << maxfmode, info->var.xres_virtual))
var->yoffset + info->var.yres > info->var.yres_virtual)
return -EINVAL; return -EINVAL;
} }
ami_pan_var(var, info); ami_pan_var(var, info);
info->var.xoffset = var->xoffset;
info->var.yoffset = var->yoffset;
if (var->vmode & FB_VMODE_YWRAP)
info->var.vmode |= FB_VMODE_YWRAP;
else
info->var.vmode &= ~FB_VMODE_YWRAP;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment