Devices don't get linked to their class.
Hi all.
Some of my suspend2 users have reported that their displays go blank as soon as suspend starts writing to disk. I understand why. I suspend everything else except the storage device and it's parents at the start of writing the image.
Interestingly, though, the issue doesn't occur with all display drivers, perhaps (I guess) because they haven't had PM support written yet. Having switched from the vesafb driver to the radeon one, I'm now able to reproduce the behaviour described above.
This morning I began work on addressing the problem. I thought the best approach would be to use device classes to find the struct dev for the frame buffer driver, and then use the same code I use for storage devices to avoid suspending the frame buffer until later. I successfully wrote a helper to find the 'graphics' class that fbmem.c creates, but now I've run into a more serious issue. register_framebuffer (in the same time) calls class_simple_device_add with a NULL for the pointer to the struct device. Is it possible for this issue to be addressed? I can see that (at least in the Radeon case) one could simply call register_framebuffer with an additional parameter, but thought I'd email you and seek your wisdom.
By the way, am I missing something? It looks like framebuffer_alloc does nothing with the dev parameter passed to it.
Regards,
Nigel
Signature · 15 lines
Nigel Cunningham Pastoral Worker Christian Reformed Church of Tuggeranong PO Box 1004, Tuggeranong, ACT 2901 Many today claim to be tolerant. True tolerance, however, can cope with others being intolerant. ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
Quoted 8 lines · Nigel Cunningham
This morning I began work on addressing the problem. I thought the best approach would be to use device classes to find the struct dev for the frame buffer driver, and then use the same code I use for storage devices to avoid suspending the frame buffer until later. I successfully wrote a helper to find the 'graphics' class that
fbmem.ccreates, but now I've run into a more serious issue.register_framebuffer(in the same time) callsclass_simple_device_addwith a NULL for the pointer to the struct device. Is it possible for this issue to be addressed? I can
I guess it's doable, but will require small changes to all framebuffer drivers. All you need is struct device, right? Maybe I can brew up a test patch next week.
Quoted 6 lines
see that (at least in the Radeon case) one could simply call
register_framebufferwith an additional parameter, but thought I'd email you and seek your wisdom.By the way, am I missing something? It looks like
framebuffer_allocdoes nothing with the dev parameter passed to it.
For now, yes. Maybe in the future, when full-pledged sysfs support is added...
Tony
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
Hi.
Quoted 10 lines · Antonino A. Daplas
Quoted 8 lines · Nigel Cunningham
This morning I began work on addressing the problem. I thought the best approach would be to use device classes to find the struct dev for the frame buffer driver, and then use the same code I use for storage devices to avoid suspending the frame buffer until later. I successfully wrote a helper to find the 'graphics' class that
fbmem.ccreates, but now I've run into a more serious issue.register_framebuffer(in the same time) callsclass_simple_device_addwith a NULL for the pointer to the struct device. Is it possible for this issue to be addressed? I can
Quoted 3 lines
I guess it's doable, but will require small changes to all framebuffer drivers. All you need is struct device, right? Maybe I can brew up a test patch next week.
I'm only just beginning to learn how to use kobjects, so I'm not entirely sure. Looking more after posting that message, I began to think that struct class_device (going from memory) might act as equivalent to a linking table in a many-to-many relationship between classes and devices. If that's right, perhaps the right thing to do is leave the dev blank in the class registration and then register a class_device to link them when the actual driver registers.
Regards,
Nigel
Signature · 15 lines
Nigel Cunningham Pastoral Worker Christian Reformed Church of Tuggeranong PO Box 1004, Tuggeranong, ACT 2901 Many today claim to be tolerant. True tolerance, however, can cope with others being intolerant. ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
Quoted 8 lines · Nigel Cunningham
I'm only just beginning to learn how to use kobjects, so I'm not entirely sure. Looking more after posting that message, I began to think that struct
class_device(going from memory) might act as equivalent to a linking table in a many-to-many relationship between classes and devices. If that's right, perhaps the right thing to do is leave the dev blank in the class registration and then register aclass_deviceto link them when the actual driver registers.
Frankly, I don't know a thing about this stuff. Just let me know what you need and where you need them, and I'll see what I can do.
Tony
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
Hi.
Quoted 2 lines · Antonino A. Daplas
Frankly, I don't know a thing about this stuff. Just let me know what you need and where you need them, and I'll see what I can do.
Okay. I'll work more in figuring it out and will send a patch.
Regards,
Nigel
Signature · 15 lines
Nigel Cunningham Pastoral Worker Christian Reformed Church of Tuggeranong PO Box 1004, Tuggeranong, ACT 2901 Many today claim to be tolerant. True tolerance, however, can cope with others being intolerant. ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
Hi.
Quoted 2 lines · Antonino A. Daplas
Frankly, I don't know a thing about this stuff. Just let me know what you need and where you need them, and I'll see what I can do.
It did turn out to just need the dev parameter to be non null. I've gone through all the frame buffer drivers and done what I believe to be the right thing; if they're PCI based, they get the struct device pointer passed through, otherwise NULL is sent.
The attached patch is against 2.6.9-rc1, and (combined with other code) allows the driver to remain active while we're suspending to disk.
Regards,
Nigel
Signature · 7 lines
Nigel Cunningham Pastoral Worker Christian Reformed Church of Tuggeranong PO Box 1004, Tuggeranong, ACT 2901 Many today claim to be tolerant. True tolerance, however, can cope with others being intolerant.
drivers/video/68328fb.c +1 -1
@@ -470,7 +470,7 @@fb_alloc_cmap (&fb_info.cmap,256 ,0 ); -if (register_framebuffer (&fb_info) <0 ) { +if (register_framebuffer (&fb_info,NULL ) <0 ) {return -EINVAL ; }
drivers/video/acornfb.c +1 -1
@@ -1451,7 +1451,7 @@if (fb_set_var (&fb_info, &fb_info.var))printk (KERN_ERR "Acornfb: unable to set display parameters\n" ); -if (register_framebuffer (&fb_info) <0 ) +if (register_framebuffer (&fb_info,NULL ) <0 )return -EINVAL ;return 0 ; }
drivers/video/amba-clcd.c +1 -1
@@ -396,7 +396,7 @@printk (KERN_INFO "CLCD: %s hardware, %s display\n" , fb->board->name, fb->panel->mode.name); - ret =register_framebuffer (&fb->fb); + ret =register_framebuffer (&fb->fb,NULL );if (ret ==0 ) goto out;
drivers/video/amifb.c +1 -1
@@ -2444,7 +2444,7 @@fb_alloc_cmap (&fb_info.cmap,1 <<fb_info.var.bits_per_pixel,0 ); -if (register_framebuffer (&fb_info) <0 ) { +if (register_framebuffer (&fb_info,NULL ) <0 ) { err = -EINVAL ; goto amifb_error; }
drivers/video/asiliantfb.c +4 -3
@@ -518,7 +518,8 @@ .vsync_len = 2, }; -static void __init init_asiliant (struct fb_info *p,unsigned long addr) +static void __init init_asiliant (struct fb_info *p,unsigned long addr, +struct device * dev) { p->fix = asiliantfb_fix; p->fix.smem_start = addr;
@@ -528,7 +529,7 @@fb_alloc_cmap (&p->cmap,256 ,0 ); -if (register_framebuffer (p) <0 ) { +if (register_framebuffer (p, dev) <0 ) {printk (KERN_ERR "C&T 69000 framebuffer failed to register\n" );return ; }
@@ -573,7 +574,7 @@pci_write_config_dword (dp,4 ,0x02800083 );writeb (3 , p->screen_base +0x400784 ); -init_asiliant (p, addr); +init_asiliant (p, addr, &dp->dev);/* Clear the entire framebuffer */ memset (p->screen_base,0 ,0x200000 );
drivers/video/atafb.c +1 -1
@@ -2806,7 +2806,7 @@atafb_set_disp (-1 , &fb_info);do_install_cmap (0 , &fb_info); -if (register_framebuffer (&fb_info) <0 ) +if (register_framebuffer (&fb_info,NULL ) <0 )return -EINVAL ; printk("Determined %dx%d, depth %d\n",
drivers/video/aty/aty128fb.c +1 -1
@@ -1856,7 +1856,7 @@aty128_init_engine (par); -if (register_framebuffer (info) <0 ) +if (register_framebuffer (info, &pdev->dev) <0 )return 0 ;#ifdef CONFIG_PMAC_BACKLIGHT
drivers/video/aty/atyfb_base.c +7 -5
@@ -161,7 +161,8 @@* Internal routines */ -static int aty_init (struct fb_info *info,const char *name); +static int aty_init (struct fb_info *info,const char *name, +struct device * dev);#ifdef CONFIG_ATARI static int store_video_par (char *videopar,unsigned char m64_num);#endif
@@ -1499,7 +1500,8 @@static struct fb_info *fb_list =NULL ; -static int __init aty_init (struct fb_info *info,const char *name) +static int __init aty_init (struct fb_info *info,const char *name, +struct device * dev) {struct atyfb_par *par = (struct atyfb_par *) info->par;const char *chipname =NULL , *ramname =NULL , *xtal;
@@ -1892,7 +1894,7 @@fb_alloc_cmap (&info->cmap,256 ,0 ); -if (register_framebuffer (info) <0 ) +if (register_framebuffer (info, dev) <0 )return 0 ; fb_list = info;
@@ -2261,7 +2263,7 @@ }#endif /* __sparc__ */ -if (!aty_init (info,"PCI" )) { +if (!aty_init (info,"PCI" , &pdev->dev)) {#ifdef __sparc__if (default_par->mmap_map)kfree (default_par->mmap_map);
@@ -2366,7 +2368,7 @@break ; } -if (!aty_init (info,"ISA bus" )) { +if (!aty_init (info,"ISA bus" ,NULL )) {kfree (default_par);kfree (info);/* This is insufficient! kernel_map has added two large chunks!! */
drivers/video/aty/radeon_base.c +1 -1
@@ -2326,7 +2326,7 @@printk ("radeonfb: Power Management enabled for Mobility chipsets\n" ); } - ret =register_framebuffer (info); + ret =register_framebuffer (info, &pdev->dev);if (ret <0 ) {printk (KERN_ERR "radeonfb: could not register framebuffer\n" ); goto err_unmap_fb;
drivers/video/bw2.c +1 -1
@@ -368,7 +368,7 @@bw2_init_fix (&all->info, linebytes); -if (register_framebuffer (&all->info) <0 ) { +if (register_framebuffer (&all->info,NULL ) <0 ) {printk (KERN_ERR "bw2: Could not register framebuffer.\n" );kfree (all);return ;
drivers/video/cg14.c +1 -1
@@ -565,7 +565,7 @@cg14_init_fix (&all->info, linebytes); -if (register_framebuffer (&all->info) <0 ) { +if (register_framebuffer (&all->info,NULL ) <0 ) {printk (KERN_ERR "cg14: Could not register framebuffer.\n" );fb_dealloc_cmap (&all->info.cmap);kfree (all);
drivers/video/cg3.c +1 -1
@@ -424,7 +424,7 @@cg3_init_fix (&all->info, linebytes); -if (register_framebuffer (&all->info) <0 ) { +if (register_framebuffer (&all->info,NULL ) <0 ) {printk (KERN_ERR "cg3: Could not register framebuffer.\n" );fb_dealloc_cmap (&all->info.cmap);kfree (all);
drivers/video/cg6.c +1 -1
@@ -740,7 +740,7 @@cg6_init_fix (&all->info, linebytes); -if (register_framebuffer (&all->info) <0 ) { +if (register_framebuffer (&all->info,NULL ) <0 ) {printk (KERN_ERR "cg6: Could not register framebuffer.\n" );fb_dealloc_cmap (&all->info.cmap);kfree (all);
drivers/video/chipsfb.c +3 -3
@@ -354,7 +354,7 @@ .vsync_len = 8, }; -static void __init init_chips (struct fb_info *p,unsigned long addr) +static void __init init_chips (struct fb_info *p,unsigned long addr,struct device * dev) { p->fix = chipsfb_fix; p->fix.smem_start = addr;
@@ -366,7 +366,7 @@fb_alloc_cmap (&p->cmap,256 ,0 ); -if (register_framebuffer (p) <0 ) { +if (register_framebuffer (p, dev) <0 ) {printk (KERN_ERR "C&T 65550 framebuffer failed to register\n" );return ; }
@@ -417,7 +417,7 @@return -ENOMEM ; } -init_chips (p, addr); +init_chips (p, addr, &dp->dev);#ifdef CONFIG_PMAC_PBOOK pmu_register_sleep_notifier (&chips_sleep_notifier);
drivers/video/cirrusfb.c +5 -1
@@ -2296,6 +2296,7 @@struct fb_info *info;int err;cirrusfb_board_t btype; +struct device * dev =NULL ;DPRINTK ("ENTER\n" );
@@ -2324,7 +2325,10 @@/* set all the vital stuff */ cirrusfb_set_fbinfo (cinfo); - err =register_framebuffer (info); +if (cinfo->pdev) + dev = &cinfo->pdev->dev; + + err =register_framebuffer (info, dev);if (err <0 ) {printk (KERN_ERR "cirrusfb: could not register fb device; err = %d!\n" , err); goto err_dealloc_cmap;
drivers/video/clps711xfb.c +1 -1
@@ -413,7 +413,7 @@clps_writeb (clps_readb (PDDR ) |EDB_PD3_LCDBL ,PDDR ); } - err =register_framebuffer (cfb); + err =register_framebuffer (cfb,NULL ); out:return err; }
drivers/video/controlfb.c +1 -1
@@ -480,7 +480,7 @@ goto try_again;/* Register with fbdev layer */ -if (register_framebuffer (&p->info) <0 ) +if (register_framebuffer (&p->info,NULL ) <0 )return -ENXIO ;printk (KERN_INFO "fb%d: control display adapter\n" , p->info.node);
drivers/video/cyber2000fb.c +4 -1
@@ -1342,6 +1342,7 @@u_long smem_size;u_int h_sync, v_sync;int err; +struct device * dev =NULL ;cyberpro_init_hw (cfb);
@@ -1399,7 +1400,9 @@ cfb->fb.var.xres, cfb->fb.var.yres, h_sync / 1000, h_sync % 1000, v_sync); - err =register_framebuffer (&cfb->fb); +if (cfb->dev) + dev = &cfb->dev->dev; + err =register_framebuffer (&cfb->fb, dev); failed:return err;
drivers/video/cyberfb.c +1 -1
@@ -1054,7 +1054,7 @@cyberfb_set_disp (-1 , &fb_info);do_install_cmap (0 , &fb_info); -if (register_framebuffer (&fb_info) <0 ) { +if (register_framebuffer (&fb_info,NULL ) <0 ) {DPRINTK ("EXIT - register_framebuffer failed\n" );release_mem_region (CyberMem_phys,0x400000 );release_mem_region (CyberRegs_phys,0x10000 );
drivers/video/dnfb.c +1 -1
@@ -250,7 +250,7 @@return err; } - err =register_framebuffer (info); + err =register_framebuffer (info, device);if (err <0 ) {fb_dealloc_cmap (&info->cmap);framebuffer_release (info);
drivers/video/epson1355fb.c +1 -1
@@ -702,7 +702,7 @@backlight_enable (1 );lcd_enable (default_par,1 ); -if (register_framebuffer (info) <0 ) { +if (register_framebuffer (info,NULL ) <0 ) { rc = -EINVAL ; goto bail; }
drivers/video/fbmem.c +2 -2
@@ -1431,7 +1431,7 @@*/ int -register_framebuffer (struct fb_info *fb_info) +register_framebuffer (struct fb_info *fb_info,struct device * dev) {int i;struct class_device *c;
@@ -1444,7 +1444,7 @@break ; fb_info->node = i; - c =class_simple_device_add (fb_class,MKDEV (FB_MAJOR , i),NULL ,"fb%d" , i); + c =class_simple_device_add (fb_class,MKDEV (FB_MAJOR , i), dev,"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));
drivers/video/ffb.c +1 -1
@@ -1079,7 +1079,7 @@ffb_init_fix (&all->info); -if (register_framebuffer (&all->info) <0 ) { +if (register_framebuffer (&all->info,NULL ) <0 ) {printk (KERN_ERR "ffb: Could not register framebuffer.\n" );fb_dealloc_cmap (&all->info.cmap);kfree (all);
drivers/video/fm2fb.c +1 -1
@@ -282,7 +282,7 @@ info->fix = fb_fix; info->flags =FBINFO_DEFAULT ; -if (register_framebuffer (info) <0 ) { +if (register_framebuffer (info,NULL ) <0 ) {fb_dealloc_cmap (&info->cmap);framebuffer_release (info);zorro_release_device (z);
drivers/video/g364fb.c +1 -1
@@ -245,7 +245,7 @@fb_alloc_cmap (&fb_info.cmap,255 ,0 ); -if (register_framebuffer (&fb_info) <0 ) +if (register_framebuffer (&fb_info,NULL ) <0 )return -EINVAL ;return 0 ; }
drivers/video/gbefb.c +1 -1
@@ -1151,7 +1151,7 @@gbefb_encode_fix (&fb_info.fix, &fb_info.var); fb_info.par = &par_current; -if (register_framebuffer (&fb_info) <0 ) { +if (register_framebuffer (&fb_info,NULL ) <0 ) { ret = -ENXIO ;printk (KERN_ERR "gbefb: couldn't register framebuffer\n" ); goto out_gbe_unmap;
drivers/video/hgafb.c +1 -1
@@ -569,7 +569,7 @@ fb_info.fbops = &hgafb_ops; fb_info.screen_base = (char *)hga_fix.smem_start; -if (register_framebuffer (&fb_info) <0 ) +if (register_framebuffer (&fb_info,NULL ) <0 )return -EINVAL ; printk(KERN_INFO "fb%d: %s frame buffer device\n",
drivers/video/hitfb.c +1 -1
@@ -328,7 +328,7 @@ size = (fb_info.var.bits_per_pixel ==8 ) ?256 :16 ;fb_alloc_cmap (&fb_info.cmap, size,0 ); -if (register_framebuffer (&fb_info) <0 ) +if (register_framebuffer (&fb_info,NULL ) <0 )return -EINVAL ; printk(KERN_INFO "fb%d: %s frame buffer device\n",
drivers/video/hpfb.c +1 -1
@@ -158,7 +158,7 @@fb_alloc_cmap (&fb_info.cmap,256 ,0 ); -if (register_framebuffer (&fb_info) <0 ) +if (register_framebuffer (&fb_info,NULL ) <0 )return 1 ;return 0 ; }
drivers/video/i810/i810_main.c +1 -1
@@ -1905,7 +1905,7 @@encode_fix (&info->fix, info);i810fb_init_ringbuffer (info); - err =register_framebuffer (info); + err =register_framebuffer (info, &dev->dev);if (err <0 ) {i810fb_release_resource (info, par);printk ("i810fb_init: cannot register framebuffer device\n" );
drivers/video/igafb.c +4 -3
@@ -332,7 +332,8 @@#endif }; -static int __init iga_init (struct fb_info *info,struct iga_par *par) +static int __init iga_init (struct fb_info *info,struct iga_par *par, +struct device * dev) {char vramsz =iga_inb (par,IGA_EXT_CNTRL ,IGA_IDX_EXT_BUS_CNTL ) &MEM_SIZE_ALIAS ;
@@ -361,7 +362,7 @@fb_alloc_cmap (&info->cmap, video_cmap_len,0 ); -if (register_framebuffer (info) <0 ) +if (register_framebuffer (info, dev) <0 )return 0 ; printk("fb%d: %s frame buffer device at 0x%08lx [%dMB VRAM]\n",
@@ -529,7 +530,7 @@ info->fix = igafb_fix; info->pseudo_palette = (void *)(par +1 ); -if (!iga_init (info, par)) { +if (!iga_init (info, par, &pdev->dev)) {iounmap ((void *)par->io_base);iounmap (info->screen_base);if (par->mmap_map)
drivers/video/imsttfb.c +3 -3
@@ -1349,7 +1349,7 @@ };static void __init -init_imstt (struct fb_info *info) +init_imstt (struct fb_info *info,struct device * dev) {struct imstt_par *par = (struct imstt_par *) info->par;__u32 i, tmp, *ip, *end;
@@ -1449,7 +1449,7 @@fb_alloc_cmap (&info->cmap,0 ,0 ); -if (register_framebuffer (info) <0 ) { +if (register_framebuffer (info, dev) <0 ) {kfree (info);return ; }
@@ -1524,7 +1524,7 @@ par->cmap_regs = (__u8 *)ioremap (addr +0x840000 ,0x1000 ); info->par = par; info->pseudo_palette = (void *) (par +1 ); -init_imstt (info); +init_imstt (info, &pdev->dev);pci_set_drvdata (pdev, info);return 0 ;
drivers/video/kyro/fbdev.c +1 -1
@@ -735,7 +735,7 @@fb_memset (info->screen_base,0 , size); -if (register_framebuffer (info) <0 ) +if (register_framebuffer (info, &pdev->dev) <0 ) goto out_unmap; printk("fb%d: %s frame buffer device, at %dx%d@%d using %ldk/%ldk of VRAM\n",
drivers/video/leo.c +1 -1
@@ -606,7 +606,7 @@leo_init_fix (&all->info); -if (register_framebuffer (&all->info) <0 ) { +if (register_framebuffer (&all->info,NULL ) <0 ) {printk (KERN_ERR "leo: Could not register framebuffer.\n" );fb_dealloc_cmap (&all->info.cmap);kfree (all);
drivers/video/macfb.c +1 -1
@@ -954,7 +954,7 @@fb_alloc_cmap (&fb_info.cmap, video_cmap_len,0 ); -if (register_framebuffer (&fb_info) <0 ) +if (register_framebuffer (&fb_info,NULL ) <0 )return ; printk("fb%d: %s frame buffer device\n",
drivers/video/matrox/matroxfb_base.c +4 -3
@@ -1572,7 +1572,8 @@ outputs[0 ] =0 ; } -static int initMatrox2(WPMINFO struct board* b){ +static int initMatrox2(WPMINFO struct board* b, +struct device * dev){unsigned long ctrlptr_phys =0 ;unsigned long video_base_phys =0 ;unsigned int memsize;
@@ -1864,7 +1865,7 @@/* We do not have to set currcon to 0... register_framebuffer do it for us on first console * and we do not want currcon == 0 for subsequent framebuffers */ -if (register_framebuffer (&ACCESS_FBINFO (fbcon)) <0 ) { +if (register_framebuffer (&ACCESS_FBINFO (fbcon), dev) <0 ) { goto failVideoIO; } printk("fb%d: %s frame buffer device\n",
@@ -2056,7 +2057,7 @@init_waitqueue_head (&ACCESS_FBINFO (crtc2.vsync.wait));ACCESS_FBINFO (crtc1.panpos) =-1 ; - err = initMatrox2(PMINFO b); + err = initMatrox2(PMINFO b, &pdev->dev);if (!err) {#ifndef CONFIG_FB_MATROX_MULTIHEAD registered =1 ;
drivers/video/matrox/matroxfb_crtc2.c +1 -1
@@ -629,7 +629,7 @@ m2info->mmio.len =ACCESS_FBINFO (mmio.len);matroxfb_dh_init_fix (m2info); -if (register_framebuffer (&m2info->fbcon)) { +if (register_framebuffer (&m2info->fbcon,NULL )) {return -ENXIO ; }if (m2info->fbcon.currcon <0 ) {
drivers/video/maxinefb.c +1 -1
@@ -163,7 +163,7 @@fb_alloc_cmap (&fb_info.cmap,256 ,0 ); -if (register_framebuffer (&fb_info) <0 ) +if (register_framebuffer (&fb_info,NULL ) <0 )return 1 ;return 0 ; }
drivers/video/neofb.c +1 -1
@@ -2139,7 +2139,7 @@if (fb_alloc_cmap (&info->cmap,256 ,0 ) <0 ) goto err_map_video; - err =register_framebuffer (info); + err =register_framebuffer (info, &dev->dev);if (err <0 ) goto err_reg_fb;
drivers/video/offb.c +1 -1
@@ -531,7 +531,7 @@fb_alloc_cmap (&info->cmap,256 ,0 ); -if (register_framebuffer (info) <0 ) { +if (register_framebuffer (info,NULL ) <0 ) {kfree (info);release_mem_region (res_start, res_size);return ;
drivers/video/p9100.c +1 -1
@@ -320,7 +320,7 @@p9100_init_fix (&all->info, linebytes); -if (register_framebuffer (&all->info) <0 ) { +if (register_framebuffer (&all->info,NULL ) <0 ) {printk (KERN_ERR "p9100: Could not register framebuffer.\n" );fb_dealloc_cmap (&all->info.cmap);kfree (all);
drivers/video/platinumfb.c +1 -1
@@ -388,7 +388,7 @@ goto try_again;/* Register with fbdev layer */ - rc =register_framebuffer (info); + rc =register_framebuffer (info,NULL );if (rc <0 )return rc;
drivers/video/pm2fb.c +1 -1
@@ -1139,7 +1139,7 @@if (fb_alloc_cmap (&info->cmap,256 ,0 ) <0 ) goto err_exit_all; -if (register_framebuffer (info) <0 ) +if (register_framebuffer (info, &pdev->dev) <0 ) goto err_exit_both; printk(KERN_INFO "fb%d: %s frame buffer device, memory = %dK.\n",
drivers/video/pm3fb.c +2 -2
@@ -1631,7 +1631,7 @@do_install_cmap (0 , &l_fb_info->gen.info); -if (register_framebuffer (&l_fb_info->gen.info) <0 ) { +if (register_framebuffer (&l_fb_info->gen.info, &l_fb_info->dev->dev) <0 ) {DPRINTK (1 ,"Couldn't register framebuffer\n" );return ; }
@@ -3494,7 +3494,7 @@#endif /* KERNEL_2_4 or KERNEL_2_5 */ if (forcesize[l_fb_info->board_num]) l_fb_info->fb_size = forcesize[l_fb_info->board_num]; - + l_fb_info->fb_size =pm3fb_size_memory (l_fb_info);
drivers/video/pmag-ba-fb.c +1 -1
@@ -146,7 +146,7 @@fb_alloc_cmap (&fb_info.cmap,256 ,0 ); -if (register_framebuffer (info) <0 ) +if (register_framebuffer (info,NULL ) <0 )return 1 ;return 0 ; }
drivers/video/pmagb-b-fb.c +1 -1
@@ -149,7 +149,7 @@fb_alloc_cmap (&fb_info.cmap,256 ,0 ); -if (register_framebuffer (info) <0 ) +if (register_framebuffer (info,NULL ) <0 )return 1 ;return 0 ; }
drivers/video/pvr2fb.c +4 -4
@@ -766,7 +766,7 @@* in for flexibility anyways. Who knows, maybe someone has tv-out on a * PCI-based version of these things ;-) */ -static int __init pvr2fb_common_init (void ) +static int __init pvr2fb_common_init (struct device * dev) {struct pvr2fb_par *par = currentpar;unsigned long modememused, rev;
@@ -809,7 +809,7 @@fb_alloc_cmap (&fb_info->cmap,256 ,0 ); -if (register_framebuffer (fb_info) <0 ) +if (register_framebuffer (fb_info, dev) <0 ) goto out_err; modememused = get_line_length(fb_info->var.xres_virtual,
@@ -901,7 +901,7 @@ }#endif -return pvr2fb_common_init (); +return pvr2fb_common_init (NULL ); }static void pvr2fb_dc_exit (void )
@@ -940,7 +940,7 @@ pvr2_fix.mmio_start =pci_resource_start (pdev,1 ); pvr2_fix.mmio_len =pci_resource_len (pdev,1 ); -return pvr2fb_common_init (); +return pvr2fb_common_init (&pdev->dev); } static void __devexit pvr2fb_pci_remove(struct pci_dev *pdev)
drivers/video/pxafb.c +1 -1
@@ -1318,7 +1318,7 @@dev_set_drvdata (dev, fbi); - ret =register_framebuffer (&fbi->fb); + ret =register_framebuffer (&fbi->fb, dev);if (ret <0 ) {dev_err (dev,"Failed to register framebuffer device: %d\n" , ret); goto failed;
drivers/video/q40fb.c +1 -1
@@ -117,7 +117,7 @@master_outb (3 ,DISPLAY_CONTROL_REG ); -if (register_framebuffer (info) <0 ) { +if (register_framebuffer (info, device) <0 ) {printk (KERN_ERR "Unable to register Q40 frame buffer\n" );fb_dealloc_cmap (&info->cmap);framebuffer_release (info);
drivers/video/radeonfb.c +1 -1
@@ -3041,7 +3041,7 @@ rinfo->next = board_list; board_list = rinfo; -if (register_framebuffer ((struct fb_info *) rinfo) <0 ) { +if (register_framebuffer ((struct fb_info *) rinfo, &pdev->dev) <0 ) {printk ("radeonfb: could not register framebuffer\n" );iounmap ((void *)rinfo->fb_base);iounmap ((void *)rinfo->mmio_base);
drivers/video/retz3fb.c +1 -1
@@ -1424,7 +1424,7 @@do_install_cmap (0 , fb_info); -if (register_framebuffer (fb_info) <0 ) +if (register_framebuffer (fb_info,NULL ) <0 )return -EINVAL ; printk(KERN_INFO "fb%d: %s frame buffer device, using %ldK of "
drivers/video/riva/fbdev.c +1 -1
@@ -1995,7 +1995,7 @@ info->monspecs.modedb_len =0 ; info->monspecs.modedb =NULL ; -if (register_framebuffer (info) <0 ) { +if (register_framebuffer (info, &pd->dev) <0 ) { printk(KERN_ERR PFX "error registering riva framebuffer\n"); goto err_out_iounmap_fb;
drivers/video/S3triofb.c +1 -1
@@ -537,7 +537,7 @@#endif fb_info.flags =FBINFO_FLAG_DEFAULT ; -if (register_framebuffer (&fb_info) <0 ) +if (register_framebuffer (&fb_info,NULL ) <0 )return ; printk("fb%d: S3 Trio frame buffer device on %s\n",
drivers/video/sa1100fb.c +1 -1
@@ -1772,7 +1772,7 @@dev_set_drvdata (dev, fbi); - ret =register_framebuffer (&fbi->fb); + ret =register_framebuffer (&fbi->fb,NULL );if (ret <0 ) goto failed;
drivers/video/sgivwfb.c +1 -1
@@ -811,7 +811,7 @@if (fb_alloc_cmap (&info->cmap,256 ,0 ) <0 ) goto fail_color_map; -if (register_framebuffer (info) <0 ) { +if (register_framebuffer (info, device) <0 ) {printk (KERN_ERR "sgivwfb: couldn't register framebuffer\n" ); goto fail_register_framebuffer; }
drivers/video/sis/sis_main.c +1 -1
@@ -5572,7 +5572,7 @@vc_resize_con (1 ,1 ,0 );#endif -if (register_framebuffer (sis_fb_info) <0 ) { +if (register_framebuffer (sis_fb_info, &pdev->dev) <0 ) {printk (KERN_ERR "sisfb: Fatal error: Failed to register framebuffer\n" );iounmap ((void *)ivideo->video_vbase);iounmap ((void *)ivideo->mmio_vbase);
drivers/video/skeletonfb.c +8 -1
@@ -569,7 +569,14 @@*/ info.var = xxxfb_var; -if (register_framebuffer (&info) <0 ) +/* +* The second parameter is the struct device. If your framebuffer +* is a PCI device or otherwise maps to the device tree, you +* should send the struct device to register_framebuffer. Code such +* as suspend2 will then be able to keep your device enabled while +* suspending other devices. (Nigel Cunningham) +*/ +if (register_framebuffer (&info,NULL ) <0 )return -EINVAL ;printk (KERN_INFO "fb%d: %s frame buffer device\n" , info.node, info.fix.id);
drivers/video/sstfb.c +1 -1
@@ -1507,7 +1507,7 @@fb_alloc_cmap (&info->cmap,256 ,0 );/* register fb */ -if (register_framebuffer (info) <0 ) { +if (register_framebuffer (info, &pdev->dev) <0 ) {eprintk ("can't register framebuffer.\n" ); goto fail; }
drivers/video/stifb.c +1 -1
@@ -1344,7 +1344,7 @@ goto out_err2; } -if (register_framebuffer (&fb->info) <0 ) +if (register_framebuffer (&fb->info,NULL ) <0 ) goto out_err3; sti->info = info;/* save for unregister_framebuffer() */
drivers/video/sun3fb.c +1 -1
@@ -641,7 +641,7 @@sun3fb_set_var (var,-1 , &fb->info); -if (register_framebuffer (&fb->info) <0 ) { +if (register_framebuffer (&fb->info,NULL ) <0 ) {kfree (fb);return -EINVAL ; }
drivers/video/tcx.c +1 -1
@@ -447,7 +447,7 @@tcx_init_fix (&all->info, linebytes); -if (register_framebuffer (&all->info) <0 ) { +if (register_framebuffer (&all->info,NULL ) <0 ) {printk (KERN_ERR "tcx: Could not register framebuffer.\n" );fb_dealloc_cmap (&all->info.cmap);kfree (all);
drivers/video/tdfxfb.c +1 -1
@@ -1293,7 +1293,7 @@ goto out_err; } -if (register_framebuffer (info) <0 ) { +if (register_framebuffer (info, &pdev->dev) <0 ) {printk ("tdfxfb: can't register framebuffer\n" );fb_dealloc_cmap (&info->cmap); goto out_err;
drivers/video/tgafb.c +1 -1
@@ -1454,7 +1454,7 @@tgafb_set_par (&all->info);tgafb_init_fix (&all->info); -if (register_framebuffer (&all->info) <0 ) { +if (register_framebuffer (&all->info, &pdev->dev) <0 ) {printk (KERN_ERR "tgafb: Could not register framebuffer\n" ); ret = -EINVAL ; goto err1;
drivers/video/tridentfb.c +1 -1
@@ -1164,7 +1164,7 @@ default_var.accel_flags &= ~FB_ACCELF_TEXT ; default_var.activate |=FB_ACTIVATE_NOW ; fb_info.var = default_var; -if (register_framebuffer (&fb_info) <0 ) { +if (register_framebuffer (&fb_info, &dev->dev) <0 ) {output ("Could not register Trident framebuffer\n" );return -EINVAL ; }
drivers/video/tx3912fb.c +1 -1
@@ -307,7 +307,7 @@fb_alloc_cmap (&info->cmap, size,0 ); -if (register_framebuffer (&fb_info) <0 ) +if (register_framebuffer (&fb_info,NULL ) <0 )return -1 ; printk(KERN_INFO "fb%d: TX3912 frame buffer using %uKB.\n",
drivers/video/valkyriefb.c +1 -1
@@ -385,7 +385,7 @@/* "can't happen" */ printk (KERN_ERR "valkyriefb: can't set default video mode\n" ); -if ((err =register_framebuffer (&p->info)) !=0 ) +if ((err =register_framebuffer (&p->info,NULL )) !=0 ) goto out_free;printk (KERN_INFO "fb%d: valkyrie frame buffer device\n" , p->info.node);
drivers/video/vesafb.c +1 -1
@@ -383,7 +383,7 @@ err = -ENXIO ; goto err; } -if (register_framebuffer (info)<0 ) { +if (register_framebuffer (info, device)<0 ) { err = -EINVAL ;fb_dealloc_cmap (&info->cmap); goto err;
drivers/video/vfb.c +1 -1
@@ -447,7 +447,7 @@if (retval <0 ) goto err1; - retval =register_framebuffer (info); + retval =register_framebuffer (info, device);if (retval <0 ) goto err2;dev_set_drvdata (&dev->dev, info);
drivers/video/vga16fb.c +1 -1
@@ -1389,7 +1389,7 @@vga16fb_update_fix (&vga16fb); -if (register_framebuffer (&vga16fb) <0 ) { +if (register_framebuffer (&vga16fb,NULL ) <0 ) {printk (KERN_ERR "vga16fb: unable to register framebuffer\n" ); ret = -EINVAL ; goto err_check_var;
drivers/video/virgefb.c +1 -1
@@ -1797,7 +1797,7 @@virgefb_set_disp (-1 , &fb_info);do_install_cmap (0 , &fb_info); -if (register_framebuffer (&fb_info) <0 ) { +if (register_framebuffer (&fb_info,NULL ) <0 ) {#warning release resourcesprintk (KERN_ERR "virgefb.c: register_framebuffer failed\n" );DPRINTK ("EXIT\n" );
include/linux/fb.h +1 -1
@@ -681,7 +681,7 @@extern void cfb_imageblit (struct fb_info *info,const struct fb_image *image);/* drivers/video/fbmem.c */ -extern int register_framebuffer (struct fb_info *fb_info); +extern int register_framebuffer (struct fb_info *fb_info,struct device * dev);extern int unregister_framebuffer (struct fb_info *fb_info);extern int fb_prepare_logo (struct fb_info *fb_info);extern int fb_show_logo (struct fb_info *fb_info);
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi.
Quoted 4 lines · Antonino A. Daplas
I'll modify the patch a little bit so struct
fb_infohas a struct device *device. This way, we need not add a new parameter toregister_framebuffer(), and we don't need to modify all drivers, only those where we can set the device field.
Sounds great. I knew there was more than one way of skinning this cat, and just went for the simplest :>
Nigel
Signature · 15 lines
Nigel Cunningham Pastoral Worker Christian Reformed Church of Tuggeranong PO Box 1004, Tuggeranong, ACT 2901 Many today claim to be tolerant. True tolerance, however, can cope with others being intolerant. ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
Il Mon, Sep 06, 2004 at 01:38:16PM +1000, Nigel Cunningham ha scritto:
Quoted 11 lines · Antonino A. Daplas
Quoted 2 lines
Frankly, I don't know a thing about this stuff. Just let me know what you need and where you need them, and I'll see what I can do.
It did turn out to just need the dev parameter to be non null. I've gone through all the frame buffer drivers and done what I believe to be the right thing; if they're PCI based, they get the struct device pointer passed through, otherwise NULL is sent.
The attached patch is against 2.6.9-rc1, and (combined with other code) allows the driver to remain active while we're suspending to disk.
There's framebuffer_alloc for that. I forgot to re-add a struct device * to fb_info after I added the class_simple stuff:
drivers/video/fbsysfs.c +1 -0
@@ -47,6 +47,7 @@return NULL ;memset (p,0 , fb_info_size + size); info = (struct fb_info *) p; + info->device = dev;if (size) info->par = p + fb_info_size;
drivers/video/fbmem.c +1 -1
@@ -1380,7 +1380,7 @@break ; fb_info->node = i; - c =class_simple_device_add (fb_class,MKDEV (FB_MAJOR , i),NULL ,"fb%d" , i); + c =class_simple_device_add (fb_class,MKDEV (FB_MAJOR , i), fb_info->device,"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));
include/linux/fb.h +1 -0
@@ -588,6 +588,7 @@#define FBINFO_STATE_RUNNING 0#define FBINFO_STATE_SUSPENDED 1u32 state;/* Hardware state i.e suspend */ +struct device *device;/* From here on everything is device dependent */ void *par;
Luca
Signature · 10 lines
Home: http://kronoz.cjb.net Recursion n.: See Recursion. ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
Quoted 10 lines · Kronos
Il Mon, Sep 06, 2004 at 01:38:16PM +1000, Nigel Cunningham ha scritto:
Quoted 9 lines · Antonino A. Daplas
Quoted 2 lines
Frankly, I don't know a thing about this stuff. Just let me know what you need and where you need them, and I'll see what I can do.
It did turn out to just need the dev parameter to be non null. I've gone through all the frame buffer drivers and done what I believe to be the right thing; if they're PCI based, they get the struct device pointer passed through, otherwise NULL is sent.
Quoted 6 lines
Quoted 2 lines
The attached patch is against 2.6.9-rc1, and (combined with other code) allows the driver to remain active while we're suspending to disk.
There's
framebuffer_allocfor that. I forgot to re-add a struct device * tofb_infoafter I added theclass_simplestuff:
Hey, nice!
Nigel, here's an updated patch. For drivers already using framebuffer_alloc(), we let them be. For the rest, some I updated to use framebuffer_alloc(), rivafb and i810fb, and the remainder, set info->device during the initialization stage.
I'll push this to Andrew at the end of the week, I'll just let the previous patches I submitted simmer in his tree first.
You need to reverse the patch I sent you. You'll probably get offsets.
Tony
drivers/video/aty/atyfb_base.c +1 -1
@@ -1976,7 +1976,7 @@ int __init atyfb_init(void) info->fix = atyfb_fix; info->par = default_par; - + info->device = &pdev->dev;#ifdef __sparc__/* * Map memory-mapped registers.
drivers/video/chipsfb.c +1 -1
@@ -416,7 +416,7 @@ chipsfb_pci_init(struct pci_dev *dp, conrelease_mem_region (addr, size);return -ENOMEM ; } - + p->device = &dp->dev;init_chips (p, addr);#ifdef CONFIG_PMAC_PBOOK
drivers/video/cyber2000fb.c +2 -0
@@ -1399,6 +1399,8 @@ static int __devinit cyberpro_common_pro cfb->fb.var.xres, cfb->fb.var.yres, h_sync / 1000, h_sync % 1000, v_sync); +if (cfb->dev) + cfb->fb.device = &cfb->dev->dev; err =register_framebuffer (&cfb->fb); failed:
drivers/video/fbmem.c +2 -1
@@ -1131,7 +1131,8 @@ register_framebuffer(struct fb_info *fb_break ; fb_info->node = i; - c =class_simple_device_add (fb_class,MKDEV (FB_MAJOR , i),NULL ,"fb%d" , i); + c =class_simple_device_add (fb_class,MKDEV (FB_MAJOR , i), + fb_info->device,"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));
drivers/video/fbsysfs.c +2 -0
@@ -51,6 +51,8 @@ struct fb_info *framebuffer_alloc(size_tif (size) info->par = p + fb_info_size; + info->device = dev; +return info;#undef PADDING#undef BYTES_PER_LONG
drivers/video/i810/i810_main.c +33 -42
91 lines not on this page · raw message
drivers/video/igafb.c +1 -0
@@ -528,6 +528,7 @@ int __init igafb_init(void) info->var = default_var; info->fix = igafb_fix; info->pseudo_palette = (void *)(par +1 ); + info->device = &pdev->dev;if (!iga_init (info, par)) {iounmap ((void *)par->io_base);
drivers/video/imsttfb.c +1 -0
@@ -1524,6 +1524,7 @@ imsttfb_probe(struct pci_dev *pdev, cons par->cmap_regs = (__u8 *)ioremap (addr +0x840000 ,0x1000 ); info->par = par; info->pseudo_palette = (void *) (par +1 ); + info->device = &pdev->dev;init_imstt (info);pci_set_drvdata (pdev, info);
drivers/video/kyro/fbdev.c +1 -0
@@ -735,6 +735,7 @@ static int __devinit kyrofb_probe(structfb_memset (info->screen_base,0 , size); + info->device = &pdev->dev;if (register_framebuffer (info) <0 ) goto out_unmap;
drivers/video/matrox/matroxfb_base.c +1 -0
@@ -1864,6 +1864,7 @@ static int initMatrox2(WPMINFO struct bo/* We do not have to set currcon to 0... register_framebuffer do it for us on first console * and we do not want currcon == 0 for subsequent framebuffers */ +ACCESS_FBINFO (fbcon).device = &ACCESS_FBINFO (pcidev)->dev;if (register_framebuffer (&ACCESS_FBINFO (fbcon)) <0 ) { goto failVideoIO; }
drivers/video/pvr2fb.c +1 -0
@@ -939,6 +939,7 @@ static int __devinit pvr2fb_pci_probe(st pvr2_fix.mmio_start =pci_resource_start (pdev,1 ); pvr2_fix.mmio_len =pci_resource_len (pdev,1 ); + fbinfo->device = &pdev->dev;return pvr2fb_common_init (); }
drivers/video/radeonfb.c +1 -1
@@ -3040,7 +3040,7 @@ static int radeonfb_pci_register (structpci_set_drvdata (pdev, rinfo); rinfo->next = board_list; board_list = rinfo; - + ((struct fb_info *) rinfo)->device = &pdev->dev;if (register_framebuffer ((struct fb_info *) rinfo) <0 ) {printk ("radeonfb: could not register framebuffer\n" );iounmap ((void *)rinfo->fb_base);
drivers/video/riva/fbdev.c +7 -15
@@ -1858,21 +1858,17 @@ static int __devinit rivafb_probe(structNVTRACE_ENTER ();assert (pd !=NULL ); - info =kmalloc (sizeof (struct fb_info ),GFP_KERNEL ); + info =framebuffer_alloc (sizeof (struct riva_par ), &pd->dev); +if (!info) goto err_out; - default_par =kmalloc (sizeof (struct riva_par ),GFP_KERNEL ); -if (!default_par) - goto err_out_kfree; - -memset (info,0 ,sizeof (struct fb_info )); -memset (default_par,0 ,sizeof (struct riva_par )); + default_par = (struct riva_par *) info->par; default_par->pdev = pd; info->pixmap.addr =kmalloc (64 *1024 ,GFP_KERNEL );if (info->pixmap.addr ==NULL ) - goto err_out_kfree1; + goto err_out_kfree;memset (info->pixmap.addr,0 ,64 *1024 );if (pci_enable_device (pd)) {
@@ -1896,7 +1892,7 @@ static int __devinit rivafb_probe(structif (default_par->riva.Architecture ==0 ) { printk(KERN_ERR PFX "unknown NV_ARCH\n"); - goto err_out_kfree1; + goto err_out_free_base0; } if(default_par->riva.Architecture == NV_ARCH_10 || default_par->riva.Architecture == NV_ARCH_20 ||
@@ -2001,7 +1997,6 @@ static int __devinit rivafb_probe(structfb_destroy_modedb (info->monspecs.modedb); info->monspecs.modedb_len =0 ; info->monspecs.modedb =NULL ; -if (register_framebuffer (info) <0 ) { printk(KERN_ERR PFX "error registering riva framebuffer\n");
@@ -2040,10 +2035,8 @@ err_out_request:pci_disable_device (pd); err_out_enable:kfree (info->pixmap.addr); -err_out_kfree1: -kfree (default_par); err_out_kfree: -kfree (info); +framebuffer_release (info); err_out:return -ENODEV ; }
@@ -2077,8 +2070,7 @@ static void __exit rivafb_remove(structpci_release_regions (pd);pci_disable_device (pd);kfree (info->pixmap.addr); -kfree (par); -kfree (info); +framebuffer_release (info);pci_set_drvdata (pd,NULL );NVTRACE_LEAVE (); }
drivers/video/sstfb.c +1 -0
@@ -1507,6 +1507,7 @@ static int __devinit sstfb_probe(structfb_alloc_cmap (&info->cmap,256 ,0 );/* register fb */ + info->device = &pdev->dev;if (register_framebuffer (info) <0 ) {eprintk ("can't register framebuffer.\n" ); goto fail;
drivers/video/tgafb.c +1 -0
@@ -1454,6 +1454,7 @@ tgafb_pci_register(struct pci_dev *pdev,tgafb_set_par (&all->info);tgafb_init_fix (&all->info); + all->info.device = &pdev->dev;if (register_framebuffer (&all->info) <0 ) {printk (KERN_ERR "tgafb: Could not register framebuffer\n" ); ret = -EINVAL ;
drivers/video/tridentfb.c +1 -0
@@ -1164,6 +1164,7 @@ static int __devinit trident_pci_probe(s default_var.accel_flags &= ~FB_ACCELF_TEXT ; default_var.activate |=FB_ACTIVATE_NOW ; fb_info.var = default_var; + fb_info.device = &dev->dev;if (register_framebuffer (&fb_info) <0 ) {output ("Could not register Trident framebuffer\n" );return -EINVAL ;
include/linux/fb.h +1 -0
@@ -602,6 +602,7 @@ struct fb_info {struct fb_cmap cmap;/* Current cmap */ struct list_head modelist;/* mode list */ struct fb_ops *fbops; +struct device *device;char *screen_base;/* Virtual address */ int currcon;/* Current VC. */ void *pseudo_palette;/* Fake palette of 16 colors */
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
Thanks!
Nigel
Quoted 15 lines · Antonino A. Daplas
Quoted 3 lines
There's
framebuffer_allocfor that. I forgot to re-add a struct device * tofb_infoafter I added theclass_simplestuff:Hey, nice!
Nigel, here's an updated patch. For drivers already using
framebuffer_alloc(), we let them be. For the rest, some I updated to useframebuffer_alloc(), rivafb and i810fb, and the remainder, setinfo->deviceduring the initialization stage.I'll push this to Andrew at the end of the week, I'll just let the previous patches I submitted simmer in his tree first.
You need to reverse the patch I sent you. You'll probably get offsets.
Signature · 15 lines
Nigel Cunningham Pastoral Worker Christian Reformed Church of Tuggeranong PO Box 1004, Tuggeranong, ACT 2901 Many today claim to be tolerant. True tolerance, however, can cope with others being intolerant. ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click