These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / video / fbdev / efifb.c
index 4bfff34..95d293b 100644 (file)
@@ -114,6 +114,20 @@ static int efifb_setup(char *options)
        return 0;
 }
 
+static inline bool fb_base_is_valid(void)
+{
+       if (screen_info.lfb_base)
+               return true;
+
+       if (!(screen_info.capabilities & VIDEO_CAPABILITY_64BIT_BASE))
+               return false;
+
+       if (screen_info.ext_lfb_base)
+               return true;
+
+       return false;
+}
+
 static int efifb_probe(struct platform_device *dev)
 {
        struct fb_info *info;
@@ -141,7 +155,7 @@ static int efifb_probe(struct platform_device *dev)
                screen_info.lfb_depth = 32;
        if (!screen_info.pages)
                screen_info.pages = 1;
-       if (!screen_info.lfb_base) {
+       if (!fb_base_is_valid()) {
                printk(KERN_DEBUG "efifb: invalid framebuffer address\n");
                return -ENODEV;
        }
@@ -160,6 +174,14 @@ static int efifb_probe(struct platform_device *dev)
        }
 
        efifb_fix.smem_start = screen_info.lfb_base;
+
+       if (screen_info.capabilities & VIDEO_CAPABILITY_64BIT_BASE) {
+               u64 ext_lfb_base;
+
+               ext_lfb_base = (u64)(unsigned long)screen_info.ext_lfb_base << 32;
+               efifb_fix.smem_start |= ext_lfb_base;
+       }
+
        efifb_defined.bits_per_pixel = screen_info.lfb_depth;
        efifb_defined.xres = screen_info.lfb_width;
        efifb_defined.yres = screen_info.lfb_height;