video: fbdev: atari: Simplify atafb_pan_display()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Mon, 11 Jul 2022 15:50:25 +0000 (17:50 +0200)
committerHelge Deller <deller@gmx.de>
Mon, 18 Jul 2022 05:56:17 +0000 (07:56 +0200)
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: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/atafb.c

index 102c727..c0683d2 100644 (file)
@@ -2407,35 +2407,10 @@ static void atafb_set_disp(struct fb_info *info)
 static int
 atafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
 {
-       int xoffset = var->xoffset;
-       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
+       if (!fbhw->pan_display)
                return -EINVAL;
 
-       info->var.xoffset = xoffset;
-       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;
+       return fbhw->pan_display(var, info);
 }
 
 /*