From: <aot...@us...> - 2004-05-11 17:48:45
|
Update of /cvsroot/gc-linux/linux/drivers/video In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26801/drivers/video Modified Files: Kconfig fbmem.c Log Message: Merged 2.6.6 Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/video/Kconfig,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Kconfig 24 Apr 2004 18:31:44 -0000 1.5 +++ Kconfig 11 May 2004 17:48:35 -0000 1.6 @@ -55,7 +55,7 @@ config FB_PM2 tristate "Permedia2 support" - depends on FB && (AMIGA || PCI) + depends on FB && ((AMIGA && BROKEN) || PCI) help This is the frame buffer device driver for the Permedia2 AGP frame buffer card from ASK, aka `Graphic Blaster Exxtreme'. There is a Index: fbmem.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/video/fbmem.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- fbmem.c 24 Apr 2004 18:31:44 -0000 1.6 +++ fbmem.c 11 May 2004 17:48:35 -0000 1.7 @@ -32,6 +32,9 @@ #include <linux/kmod.h> #endif #include <linux/devfs_fs_kernel.h> +#include <linux/err.h> +#include <linux/kernel.h> +#include <linux/device.h> #if defined(__mc68000__) || defined(CONFIG_APUS) #include <asm/setup.h> @@ -916,7 +919,7 @@ return -ENOMEM; } - if (copy_from_user(&cursor.image.data, sprite->image.data, size) || + if (copy_from_user(cursor.image.data, sprite->image.data, size) || copy_from_user(cursor.mask, sprite->mask, size)) { kfree(cursor.image.data); kfree(cursor.mask); @@ -1043,7 +1046,7 @@ case FBIOGETCMAP: if (copy_from_user(&cmap, (void *) arg, sizeof(cmap))) return -EFAULT; - return (fb_copy_cmap(&info->cmap, &cmap, 0)); + return (fb_copy_cmap(&info->cmap, &cmap, 2)); case FBIOPAN_DISPLAY: if (copy_from_user(&var, (void *) arg, sizeof(var))) return -EFAULT; @@ -1250,6 +1253,8 @@ #endif }; +static struct class_simple *fb_class; + /** * register_framebuffer - registers a frame buffer device * @fb_info: frame buffer info structure @@ -1264,6 +1269,7 @@ register_framebuffer(struct fb_info *fb_info) { int i; + struct class_device *c; if (num_registered_fb == FB_MAX) return -ENXIO; @@ -1272,6 +1278,12 @@ if (!registered_fb[i]) break; fb_info->node = i; + + c = class_simple_device_add(fb_class, MKDEV(FB_MAJOR, i), NULL, "fb%d", i); + if (IS_ERR(c)) { + /* Not fatal */ + printk(KERN_WARNING "Unable to create class_device for framebuffer %d; errno = %ld\n", i, PTR_ERR(c)); + } if (fb_info->pixmap.addr == NULL) { fb_info->pixmap.addr = kmalloc(FBPIXMAPSIZE, GFP_KERNEL); @@ -1337,6 +1349,7 @@ kfree(fb_info->sprite.addr); registered_fb[i]=NULL; num_registered_fb--; + class_simple_device_remove(MKDEV(FB_MAJOR, i)); return 0; } @@ -1398,6 +1411,12 @@ if (register_chrdev(FB_MAJOR,"fb",&fb_fops)) printk("unable to get major %d for fb devs\n", FB_MAJOR); + fb_class = class_simple_create(THIS_MODULE, "graphics"); + if (IS_ERR(fb_class)) { + printk(KERN_WARNING "Unable to create fb class; errno = %ld\n", PTR_ERR(fb_class)); + fb_class = NULL; + } + #ifdef CONFIG_FB_OF if (ofonly) { offb_init(); |