fbdev: add support for handoff from firmware to hw framebuffers
[sfrench/cifs-2.6.git] / drivers / video / efifb.c
index 0c5b9a9fd56f178cf0ad10bed907138a2b06fe3c..eb12182b20598861937b46496b8716efcae1e366 100644 (file)
@@ -210,12 +210,15 @@ static int __init efifb_probe(struct platform_device *dev)
        unsigned int size_total;
        int request_succeeded = 0;
 
-       printk(KERN_INFO "efifb: probing for efifb\n");
-
        if (!screen_info.lfb_depth)
                screen_info.lfb_depth = 32;
        if (!screen_info.pages)
                screen_info.pages = 1;
+       if (!screen_info.lfb_base) {
+               printk(KERN_DEBUG "efifb: invalid framebuffer address\n");
+               return -ENODEV;
+       }
+       printk(KERN_INFO "efifb: probing for efifb\n");
 
        /* just assume they're all unset if any are */
        if (!screen_info.blue_size) {
@@ -277,6 +280,9 @@ static int __init efifb_probe(struct platform_device *dev)
        info->pseudo_palette = info->par;
        info->par = NULL;
 
+       info->aperture_base = efifb_fix.smem_start;
+       info->aperture_size = size_total;
+
        info->screen_base = ioremap(efifb_fix.smem_start, efifb_fix.smem_len);
        if (!info->screen_base) {
                printk(KERN_ERR "efifb: abort, cannot ioremap video memory "
@@ -334,7 +340,7 @@ static int __init efifb_probe(struct platform_device *dev)
        info->fbops = &efifb_ops;
        info->var = efifb_defined;
        info->fix = efifb_fix;
-       info->flags = FBINFO_FLAG_DEFAULT;
+       info->flags = FBINFO_FLAG_DEFAULT | FBINFO_MISC_FIRMWARE;
 
        if ((err = fb_alloc_cmap(&info->cmap, 256, 0)) < 0) {
                printk(KERN_ERR "efifb: cannot allocate colormap\n");