Commit f3bd0c2b authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Helge Deller

video: fbdev: atari: Simplify atafb_pan_display()

The fb_pan_display() function in the core already takes care of
validating the 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>
Tested-by: default avatarMichael Schmitz <schmitzmic@gmail.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 6a7d270e
...@@ -2407,35 +2407,10 @@ static void atafb_set_disp(struct fb_info *info) ...@@ -2407,35 +2407,10 @@ static void atafb_set_disp(struct fb_info *info)
static int static int
atafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) atafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
{ {
int xoffset = var->xoffset; if (!fbhw->pan_display)
int yoffset = var->yoffset;
int err;
if (var->vmode & FB_VMODE_YWRAP) {
if (yoffset < 0 || yoffset >= info->var.yres_virtual || xoffset)
return -EINVAL;
} else {
if (xoffset + info->var.xres > info->var.xres_virtual ||
yoffset + info->var.yres > info->var.yres_virtual)
return -EINVAL;
}
if (fbhw->pan_display) {
err = fbhw->pan_display(var, info);
if (err)
return err;
} else
return -EINVAL; return -EINVAL;
info->var.xoffset = xoffset; return fbhw->pan_display(var, info);
info->var.yoffset = yoffset;
if (var->vmode & FB_VMODE_YWRAP)
info->var.vmode |= FB_VMODE_YWRAP;
else
info->var.vmode &= ~FB_VMODE_YWRAP;
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