aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2008-10-16 01:03:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 14:21:41 -0400
commitd15d56f9f10295a992cc7a7697d6fd8b01823cfc (patch)
tree149d6b571ea3c350fad0fffca7d99da3f2975405 /drivers/video
parent319fcb224d66a4702731ec13b8ac670ad1e923bf (diff)
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')
-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)
1186 return 0; 1186 return 0;
1187} 1187}
1188 1188
1189static void neofb_update_start(struct fb_info *info, 1189/*
1190 struct fb_var_screeninfo *var) 1190 * Pan or Wrap the Display
1191 */
1192static int neofb_pan_display(struct fb_var_screeninfo *var,
1193 struct fb_info *info)
1191{ 1194{
1192 struct neofb_par *par = info->par; 1195 struct neofb_par *par = info->par;
1193 struct vgastate *state = &par->state; 1196 struct vgastate *state = &par->state;
@@ -1216,35 +1219,7 @@ static void neofb_update_start(struct fb_info *info,
1216 vga_wgfx(state->vgabase, 0x0E, (((Base >> 16) & 0x0f) | (oldExtCRTDispAddr & 0xf0))); 1219 vga_wgfx(state->vgabase, 0x0E, (((Base >> 16) & 0x0f) | (oldExtCRTDispAddr & 0xf0)));
1217 1220
1218 neoLock(state); 1221 neoLock(state);
1219}
1220 1222
1221/*
1222 * Pan or Wrap the Display
1223 */
1224static int neofb_pan_display(struct fb_var_screeninfo *var,
1225 struct fb_info *info)
1226{
1227 u_int y_bottom;
1228
1229 y_bottom = var->yoffset;
1230
1231 if (!(var->vmode & FB_VMODE_YWRAP))
1232 y_bottom += var->yres;
1233
1234 if (var->xoffset > (var->xres_virtual - var->xres))
1235 return -EINVAL;
1236 if (y_bottom > info->var.yres_virtual)
1237 return -EINVAL;
1238
1239 neofb_update_start(info, var);
1240
1241 info->var.xoffset = var->xoffset;
1242 info->var.yoffset = var->yoffset;
1243
1244 if (var->vmode & FB_VMODE_YWRAP)
1245 info->var.vmode |= FB_VMODE_YWRAP;
1246 else
1247 info->var.vmode &= ~FB_VMODE_YWRAP;
1248 return 0; 1223 return 0;
1249} 1224}
1250 1225