aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/offb.c
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2010-05-16 11:27:03 -0400
committerDave Airlie <airlied@redhat.com>2010-05-18 02:19:27 -0400
commit1471ca9aa71cd37b6a7476bb6f06a3a8622ea1bd (patch)
tree3bf5ef9fea79b0b92220cfcc3842db7afb5cd63d /drivers/video/offb.c
parent3da1f33e79a5922c1a31077e7b33aba1cec19b94 (diff)
fbdev: allow passing more than one aperture for handoff
It removes a hack from nouveau code which had to detect which region to pass to kick vesafb/efifb. Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: Eric Anholt <eric@anholt.net> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Thomas Hellstrom <thellstrom@vmware.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Peter Jones <pjones@redhat.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/video/offb.c')
-rw-r--r--drivers/video/offb.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/video/offb.c b/drivers/video/offb.c
index 61f8b8f919b0..46dda7d8aaee 100644
--- a/drivers/video/offb.c
+++ b/drivers/video/offb.c
@@ -285,7 +285,7 @@ static void offb_destroy(struct fb_info *info)
285{ 285{
286 if (info->screen_base) 286 if (info->screen_base)
287 iounmap(info->screen_base); 287 iounmap(info->screen_base);
288 release_mem_region(info->aperture_base, info->aperture_size); 288 release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size);
289 framebuffer_release(info); 289 framebuffer_release(info);
290} 290}
291 291
@@ -491,8 +491,11 @@ static void __init offb_init_fb(const char *name, const char *full_name,
491 var->vmode = FB_VMODE_NONINTERLACED; 491 var->vmode = FB_VMODE_NONINTERLACED;
492 492
493 /* set offb aperture size for generic probing */ 493 /* set offb aperture size for generic probing */
494 info->aperture_base = address; 494 info->apertures = alloc_apertures(1);
495 info->aperture_size = fix->smem_len; 495 if (!info->apertures)
496 goto out_aper;
497 info->apertures->ranges[0].base = address;
498 info->apertures->ranges[0].size = fix->smem_len;
496 499
497 info->fbops = &offb_ops; 500 info->fbops = &offb_ops;
498 info->screen_base = ioremap(address, fix->smem_len); 501 info->screen_base = ioremap(address, fix->smem_len);
@@ -501,17 +504,20 @@ static void __init offb_init_fb(const char *name, const char *full_name,
501 504
502 fb_alloc_cmap(&info->cmap, 256, 0); 505 fb_alloc_cmap(&info->cmap, 256, 0);
503 506
504 if (register_framebuffer(info) < 0) { 507 if (register_framebuffer(info) < 0)
505 iounmap(par->cmap_adr); 508 goto out_err;
506 par->cmap_adr = NULL;
507 iounmap(info->screen_base);
508 framebuffer_release(info);
509 release_mem_region(res_start, res_size);
510 return;
511 }
512 509
513 printk(KERN_INFO "fb%d: Open Firmware frame buffer device on %s\n", 510 printk(KERN_INFO "fb%d: Open Firmware frame buffer device on %s\n",
514 info->node, full_name); 511 info->node, full_name);
512 return;
513
514out_err:
515 iounmap(info->screen_base);
516out_aper:
517 iounmap(par->cmap_adr);
518 par->cmap_adr = NULL;
519 framebuffer_release(info);
520 release_mem_region(res_start, res_size);
515} 521}
516 522
517 523