aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/amifb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/amifb.c')
-rw-r--r--drivers/video/amifb.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c
index 05a328c11a8b..b8e9a8682f2d 100644
--- a/drivers/video/amifb.c
+++ b/drivers/video/amifb.c
@@ -1136,7 +1136,6 @@ static int amifb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg
1136 * Interface to the low level console driver 1136 * Interface to the low level console driver
1137 */ 1137 */
1138 1138
1139int amifb_init(void);
1140static void amifb_deinit(void); 1139static void amifb_deinit(void);
1141 1140
1142 /* 1141 /*
@@ -2048,13 +2047,16 @@ static void amifb_copyarea(struct fb_info *info,
2048 width = x2 - dx; 2047 width = x2 - dx;
2049 height = y2 - dy; 2048 height = y2 - dy;
2050 2049
2050 if (area->sx + dx < area->dx || area->sy + dy < area->dy)
2051 return;
2052
2051 /* update sx,sy */ 2053 /* update sx,sy */
2052 sx = area->sx + (dx - area->dx); 2054 sx = area->sx + (dx - area->dx);
2053 sy = area->sy + (dy - area->dy); 2055 sy = area->sy + (dy - area->dy);
2054 2056
2055 /* the source must be completely inside the virtual screen */ 2057 /* the source must be completely inside the virtual screen */
2056 if (sx < 0 || sy < 0 || (sx + width) > info->var.xres_virtual || 2058 if (sx + width > info->var.xres_virtual ||
2057 (sy + height) > info->var.yres_virtual) 2059 sy + height > info->var.yres_virtual)
2058 return; 2060 return;
2059 2061
2060 if (dy > sy || (dy == sy && dx > sx)) { 2062 if (dy > sy || (dy == sy && dx > sx)) {
@@ -2245,7 +2247,7 @@ static inline void chipfree(void)
2245 * Initialisation 2247 * Initialisation
2246 */ 2248 */
2247 2249
2248int __init amifb_init(void) 2250static int __init amifb_init(void)
2249{ 2251{
2250 int tag, i, err = 0; 2252 int tag, i, err = 0;
2251 u_long chipptr; 2253 u_long chipptr;
@@ -2383,6 +2385,9 @@ default_chipset:
2383 goto amifb_error; 2385 goto amifb_error;
2384 } 2386 }
2385 2387
2388 fb_videomode_to_modelist(ami_modedb, NUM_TOTAL_MODES,
2389 &fb_info.modelist);
2390
2386 round_down_bpp = 0; 2391 round_down_bpp = 0;
2387 chipptr = chipalloc(fb_info.fix.smem_len+ 2392 chipptr = chipalloc(fb_info.fix.smem_len+
2388 SPRITEMEMSIZE+ 2393 SPRITEMEMSIZE+
@@ -3787,16 +3792,14 @@ static void ami_rebuild_copper(void)
3787 } 3792 }
3788} 3793}
3789 3794
3790 3795static void __exit amifb_exit(void)
3791module_init(amifb_init);
3792
3793#ifdef MODULE
3794MODULE_LICENSE("GPL");
3795
3796void cleanup_module(void)
3797{ 3796{
3798 unregister_framebuffer(&fb_info); 3797 unregister_framebuffer(&fb_info);
3799 amifb_deinit(); 3798 amifb_deinit();
3800 amifb_video_off(); 3799 amifb_video_off();
3801} 3800}
3802#endif /* MODULE */ 3801
3802module_init(amifb_init);
3803module_exit(amifb_exit);
3804
3805MODULE_LICENSE("GPL");