diff options
Diffstat (limited to 'arch/ia64/pci/fixup.c')
-rw-r--r-- | arch/ia64/pci/fixup.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c index 1fe9aa5068ea..ec73b2cf912a 100644 --- a/arch/ia64/pci/fixup.c +++ b/arch/ia64/pci/fixup.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/pci.h> | 6 | #include <linux/pci.h> |
7 | #include <linux/init.h> | 7 | #include <linux/init.h> |
8 | #include <linux/vgaarb.h> | 8 | #include <linux/vgaarb.h> |
9 | #include <linux/screen_info.h> | ||
9 | 10 | ||
10 | #include <asm/machvec.h> | 11 | #include <asm/machvec.h> |
11 | 12 | ||
@@ -37,6 +38,27 @@ static void pci_fixup_video(struct pci_dev *pdev) | |||
37 | return; | 38 | return; |
38 | /* Maybe, this machine supports legacy memory map. */ | 39 | /* Maybe, this machine supports legacy memory map. */ |
39 | 40 | ||
41 | if (!vga_default_device()) { | ||
42 | resource_size_t start, end; | ||
43 | int i; | ||
44 | |||
45 | /* Does firmware framebuffer belong to us? */ | ||
46 | for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { | ||
47 | if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM)) | ||
48 | continue; | ||
49 | |||
50 | start = pci_resource_start(pdev, i); | ||
51 | end = pci_resource_end(pdev, i); | ||
52 | |||
53 | if (!start || !end) | ||
54 | continue; | ||
55 | |||
56 | if (screen_info.lfb_base >= start && | ||
57 | (screen_info.lfb_base + screen_info.lfb_size) < end) | ||
58 | vga_set_default_device(pdev); | ||
59 | } | ||
60 | } | ||
61 | |||
40 | /* Is VGA routed to us? */ | 62 | /* Is VGA routed to us? */ |
41 | bus = pdev->bus; | 63 | bus = pdev->bus; |
42 | while (bus) { | 64 | while (bus) { |