atyfb: Add option to disable hardware cursor.
PATCH 1/1 atyfb: Add option to disable hardware cursor.
The hardware cursor code in atyfb didn't work for me so I added this swcursor option to disable it. The fbops->fb_cursor change good even without the option since aty_init_cursor() is only called for chips with integrated RAMDAC.
Signature · 3 lines
Ville Syrjälä [email protected] http://www.sci.fi/~syrjala/
drivers/video/aty/atyfb.h +0 -1
@@ -297,7 +297,6 @@*/ extern int aty_init_cursor (struct fb_info *info); -extern int atyfb_cursor (struct fb_info *info,struct fb_cursor *cursor);/* * Hardware acceleration
drivers/video/aty/atyfb_base.c +7 -4
@@ -255,7 +255,7 @@ .fb_fillrect = atyfb_fillrect, .fb_copyarea = atyfb_copyarea, .fb_imageblit = atyfb_imageblit, - .fb_cursor = atyfb_cursor, + .fb_cursor = soft_cursor, /* changed in aty_init_cursor() */#ifdef __sparc__ .fb_mmap = atyfb_mmap,#endif
@@ -263,6 +263,7 @@ };static char noaccel__initdata =0 ; +static char swcursor__initdata =0 ;static u32 default_vram__initdata =0 ;static int default_pll__initdata =0 ;static int default_mclk__initdata =0 ;
@@ -2353,7 +2354,7 @@#endif #ifdef CONFIG_FB_ATY_CT -if (M64_HAS (INTEGRATED )) +if (!swcursor &&M64_HAS (INTEGRATED ))aty_init_cursor (info);#endif /* CONFIG_FB_ATY_CT */ info->var = var;
@@ -2379,9 +2380,11 @@return 0 ;while ((this_opt =strsep (&options,"," )) !=NULL ) { -if (!strncmp (this_opt,"noaccel" ,7 )) { +if (!strncmp (this_opt,"noaccel" ,7 )) noaccel =1 ; - }else if (!strncmp (this_opt,"vram:" ,5 )) +else if (!strncmp (this_opt,"swcursor" ,8 )) + swcursor =1 ; +else if (!strncmp (this_opt,"vram:" ,5 )) default_vram =simple_strtoul (this_opt +5 ,NULL ,0 );else if (!strncmp (this_opt,"pll:" ,4 ))
drivers/video/aty/mach64_cursor.c +5 -2
@@ -71,7 +71,7 @@ 0xa8, 0x28, 0x88, 0x08, 0xa0, 0x20, 0x80, 0x00 }; -void aty_set_cursor_shape (struct fb_info *info,u8 *dst,u8 *src,unsigned int width) +static void aty_set_cursor_shape (struct fb_info *info,u8 *dst,u8 *src,unsigned int width) {int i, j, offset = info->sprite.scan_align - width*2 ;u8 *mask = info->cursor.mask, m, b;
@@ -91,7 +91,7 @@ } } -int atyfb_cursor (struct fb_info *info,struct fb_cursor *cursor) +static int atyfb_cursor (struct fb_info *info,struct fb_cursor *cursor) {struct atyfb_par *par = (struct atyfb_par *) info->par;u16 xoff, yoff;
@@ -214,6 +214,9 @@ info->sprite.buf_align =16 ;// *64; // and 64 lines tall. info->sprite.flags =FB_PIXMAP_IO ; info->sprite.outbuf = aty_set_cursor_shape; + + info->fbops->fb_cursor = atyfb_cursor; +return 0 ; }