summaryrefslogtreecommitdiff
path: root/drivers/video/neofb.c
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2008-10-16 09:03:17 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 22:21:41 +0400
commitd15d56f9f10295a992cc7a7697d6fd8b01823cfc (patch)
tree149d6b571ea3c350fad0fffca7d99da3f2975405 /drivers/video/neofb.c
parent319fcb224d66a4702731ec13b8ac670ad1e923bf (diff)
downloadlinux-d15d56f9f10295a992cc7a7697d6fd8b01823cfc.tar.xz
neofb: reduce panning function
Reduce panning function by deleting checks done by higher layer and folding remaining function into the called one. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/neofb.c')
-rw-r--r--drivers/video/neofb.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index 25172b2a2a94..6249960b9393 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -1186,8 +1186,11 @@ static int neofb_set_par(struct fb_info *info)
return 0;
}
-static void neofb_update_start(struct fb_info *info,
- struct fb_var_screeninfo *var)
+/*
+ * Pan or Wrap the Display
+ */
+static int neofb_pan_display(struct fb_var_screeninfo *var,
+ struct fb_info *info)
{
struct neofb_par *par = info->par;
struct vgastate *state = &par->state;
@@ -1216,35 +1219,7 @@ static void neofb_update_start(struct fb_info *info,
vga_wgfx(state->vgabase, 0x0E, (((Base >> 16) & 0x0f) | (oldExtCRTDispAddr & 0xf0)));
neoLock(state);
-}
-/*
- * Pan or Wrap the Display
- */
-static int neofb_pan_display(struct fb_var_screeninfo *var,
- struct fb_info *info)
-{
- u_int y_bottom;
-
- y_bottom = var->yoffset;
-
- if (!(var->vmode & FB_VMODE_YWRAP))
- y_bottom += var->yres;
-
- if (var->xoffset > (var->xres_virtual - var->xres))
- return -EINVAL;
- if (y_bottom > info->var.yres_virtual)
- return -EINVAL;
-
- neofb_update_start(info, var);
-
- 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;
}