Commit a81c9ab6 authored by Aaron Ma's avatar Aaron Ma Committed by Daniel Vetter

vgaarb: Add support for 64-bit frame buffer address

EFI GOP uses 64-bit frame buffer address when some BIOS
disabled CSM support. vgaarb only stores lfb_base,
this will lead boot framebuffer to wrong device.

Add ext_lfb_base support to use 64-bit fb address.
Signed-off-by: default avatarAaron Ma <aaron.ma@canonical.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1535739600-8842-1-git-send-email-aaron.ma@canonical.com
parent e5176727
...@@ -1408,6 +1408,18 @@ static void __init vga_arb_select_default_device(void) ...@@ -1408,6 +1408,18 @@ static void __init vga_arb_select_default_device(void)
struct vga_device *vgadev; struct vga_device *vgadev;
#if defined(CONFIG_X86) || defined(CONFIG_IA64) #if defined(CONFIG_X86) || defined(CONFIG_IA64)
u64 base = screen_info.lfb_base;
u64 size = screen_info.lfb_size;
u64 limit;
resource_size_t start, end;
unsigned long flags;
int i;
if (screen_info.capabilities & VIDEO_CAPABILITY_64BIT_BASE)
base |= (u64)screen_info.ext_lfb_base << 32;
limit = base + size;
list_for_each_entry(vgadev, &vga_list, list) { list_for_each_entry(vgadev, &vga_list, list) {
struct device *dev = &vgadev->pdev->dev; struct device *dev = &vgadev->pdev->dev;
/* /*
...@@ -1418,11 +1430,6 @@ static void __init vga_arb_select_default_device(void) ...@@ -1418,11 +1430,6 @@ static void __init vga_arb_select_default_device(void)
* Select the device owning the boot framebuffer if there is * Select the device owning the boot framebuffer if there is
* one. * one.
*/ */
resource_size_t start, end, limit;
unsigned long flags;
int i;
limit = screen_info.lfb_base + screen_info.lfb_size;
/* Does firmware framebuffer belong to us? */ /* Does firmware framebuffer belong to us? */
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
...@@ -1437,7 +1444,7 @@ static void __init vga_arb_select_default_device(void) ...@@ -1437,7 +1444,7 @@ static void __init vga_arb_select_default_device(void)
if (!start || !end) if (!start || !end)
continue; continue;
if (screen_info.lfb_base < start || limit >= end) if (base < start || limit >= end)
continue; continue;
if (!vga_default_device()) if (!vga_default_device())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment