X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fvideo%2Famifb.c;h=b8e9a8682f2de98011502b762062285febbd6552;hb=00aeb429a0f2daeb21979873060b81095cafe4bd;hp=1a849b870bcc8986a25eae263f053cfd516961e0;hpb=de9e957f12d09793aac7d44ee0f7987dc8019b94;p=linux-2.6-omap-h63xx.git diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c index 1a849b870bc..b8e9a8682f2 100644 --- a/drivers/video/amifb.c +++ b/drivers/video/amifb.c @@ -52,7 +52,7 @@ #include #include -#include +#include #include #include #include @@ -96,7 +96,7 @@ #endif #ifdef DEBUG -# define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args) +# define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args) #else # define DPRINTK(fmt, args...) #endif @@ -112,7 +112,7 @@ +----------+---------------------------------------------+----------+-------+ | | ^ | | | | | |upper_margin | | | - | | ¥ | | | + | | v | | | +----------###############################################----------+-------+ | # ^ # | | | # | # | | @@ -133,15 +133,15 @@ | # | # | | | # | # | | | # | # | | - | # ¥ # | | + | # v # | | +----------###############################################----------+-------+ | | ^ | | | | | |lower_margin | | | - | | ¥ | | | + | | v | | | +----------+---------------------------------------------+----------+-------+ | | ^ | | | | | |vsync_len | | | - | | ¥ | | | + | | v | | | +----------+---------------------------------------------+----------+-------+ @@ -325,7 +325,7 @@ CCIR -> PAL ----------- - - a scanline is 64 µs long, of which 52.48 µs are visible. This is about + - a scanline is 64 µs long, of which 52.48 µs are visible. This is about 736 visible 70 ns pixels per line. - we have 625 scanlines, of which 575 are visible (interlaced); after rounding this becomes 576. @@ -333,7 +333,7 @@ RETMA -> NTSC ------------- - - a scanline is 63.5 µs long, of which 53.5 µs are visible. This is about + - a scanline is 63.5 µs long, of which 53.5 µs are visible. This is about 736 visible 70 ns pixels per line. - we have 525 scanlines, of which 485 are visible (interlaced); after rounding this becomes 484. @@ -802,7 +802,7 @@ static u_short ecs_palette[32]; static u_short do_vmode_full = 0; /* Change the Video Mode */ static u_short do_vmode_pan = 0; /* Update the Video Mode */ -static short do_blank = 0; /* (Un)Blank the Screen (±1) */ +static short do_blank = 0; /* (Un)Blank the Screen (±1) */ static u_short do_cursor = 0; /* Move the Cursor */ @@ -1136,7 +1136,6 @@ static int amifb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg * Interface to the low level console driver */ -int amifb_init(void); static void amifb_deinit(void); /* @@ -2048,13 +2047,16 @@ static void amifb_copyarea(struct fb_info *info, width = x2 - dx; height = y2 - dy; + if (area->sx + dx < area->dx || area->sy + dy < area->dy) + return; + /* update sx,sy */ sx = area->sx + (dx - area->dx); sy = area->sy + (dy - area->dy); /* the source must be completely inside the virtual screen */ - if (sx < 0 || sy < 0 || (sx + width) > info->var.xres_virtual || - (sy + height) > info->var.yres_virtual) + if (sx + width > info->var.xres_virtual || + sy + height > info->var.yres_virtual) return; if (dy > sy || (dy == sy && dx > sx)) { @@ -2245,7 +2247,7 @@ static inline void chipfree(void) * Initialisation */ -int __init amifb_init(void) +static int __init amifb_init(void) { int tag, i, err = 0; u_long chipptr; @@ -2261,7 +2263,7 @@ int __init amifb_init(void) amifb_setup(option); #endif if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_VIDEO)) - return -ENXIO; + return -ENODEV; /* * We request all registers starting from bplpt[0] @@ -2333,7 +2335,7 @@ default_chipset: strcat(fb_info.fix.id, "Unknown"); goto default_chipset; #else /* CONFIG_FB_AMIGA_OCS */ - err = -ENXIO; + err = -ENODEV; goto amifb_error; #endif /* CONFIG_FB_AMIGA_OCS */ break; @@ -2383,6 +2385,9 @@ default_chipset: goto amifb_error; } + fb_videomode_to_modelist(ami_modedb, NUM_TOTAL_MODES, + &fb_info.modelist); + round_down_bpp = 0; chipptr = chipalloc(fb_info.fix.smem_len+ SPRITEMEMSIZE+ @@ -3787,16 +3792,14 @@ static void ami_rebuild_copper(void) } } - -module_init(amifb_init); - -#ifdef MODULE -MODULE_LICENSE("GPL"); - -void cleanup_module(void) +static void __exit amifb_exit(void) { unregister_framebuffer(&fb_info); amifb_deinit(); amifb_video_off(); } -#endif /* MODULE */ + +module_init(amifb_init); +module_exit(amifb_exit); + +MODULE_LICENSE("GPL");