diff options
author | Dave Airlie <airlied@ppcg5.localdomain> | 2009-12-06 15:01:26 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-12-09 01:09:29 -0500 |
commit | ceae8cbe94f3127253110e2d01b9334069e93177 (patch) | |
tree | 152d0bedbe6a7574db852e90bf5dd0a506180d51 | |
parent | 88358ab08944da726e948d216977ad499dfc15c6 (diff) |
offb: Add support for framebuffer handoff to offb.
This allows offb to be used for initial framebuffer,
and a kms driver to take over later in the boot sequence.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | drivers/video/offb.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/video/offb.c b/drivers/video/offb.c index 4d8c54c23dd7..b043ac83c412 100644 --- a/drivers/video/offb.c +++ b/drivers/video/offb.c | |||
@@ -282,8 +282,17 @@ static int offb_set_par(struct fb_info *info) | |||
282 | return 0; | 282 | return 0; |
283 | } | 283 | } |
284 | 284 | ||
285 | static void offb_destroy(struct fb_info *info) | ||
286 | { | ||
287 | if (info->screen_base) | ||
288 | iounmap(info->screen_base); | ||
289 | release_mem_region(info->aperture_base, info->aperture_size); | ||
290 | framebuffer_release(info); | ||
291 | } | ||
292 | |||
285 | static struct fb_ops offb_ops = { | 293 | static struct fb_ops offb_ops = { |
286 | .owner = THIS_MODULE, | 294 | .owner = THIS_MODULE, |
295 | .fb_destroy = offb_destroy, | ||
287 | .fb_setcolreg = offb_setcolreg, | 296 | .fb_setcolreg = offb_setcolreg, |
288 | .fb_set_par = offb_set_par, | 297 | .fb_set_par = offb_set_par, |
289 | .fb_blank = offb_blank, | 298 | .fb_blank = offb_blank, |
@@ -482,10 +491,14 @@ static void __init offb_init_fb(const char *name, const char *full_name, | |||
482 | var->sync = 0; | 491 | var->sync = 0; |
483 | var->vmode = FB_VMODE_NONINTERLACED; | 492 | var->vmode = FB_VMODE_NONINTERLACED; |
484 | 493 | ||
494 | /* set offb aperture size for generic probing */ | ||
495 | info->aperture_base = address; | ||
496 | info->aperture_size = fix->smem_len; | ||
497 | |||
485 | info->fbops = &offb_ops; | 498 | info->fbops = &offb_ops; |
486 | info->screen_base = ioremap(address, fix->smem_len); | 499 | info->screen_base = ioremap(address, fix->smem_len); |
487 | info->pseudo_palette = (void *) (info + 1); | 500 | info->pseudo_palette = (void *) (info + 1); |
488 | info->flags = FBINFO_DEFAULT | foreign_endian; | 501 | info->flags = FBINFO_DEFAULT | FBINFO_MISC_FIRMWARE | foreign_endian; |
489 | 502 | ||
490 | fb_alloc_cmap(&info->cmap, 256, 0); | 503 | fb_alloc_cmap(&info->cmap, 256, 0); |
491 | 504 | ||