Skip to content

Commit c4b4d70

Browse files
Saurabh Sengarhdeller
authored andcommitted
video: fbdev: hyperv_fb: Allow resolutions with size > 64 MB for Gen1
This patch fixes a bug where GEN1 VMs doesn't allow resolutions greater than 64 MB size (eg 7680x4320). Unnecessary PCI check limits Gen1 VRAM to legacy PCI BAR size only (ie 64MB). Thus any, resolution requesting greater then 64MB (eg 7680x4320) would fail. MMIO region assigning this memory shouldn't be limited by PCI bar size. Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com> Reviewed-by: Dexuan Cui <decui@microsoft.com> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 42226c9 commit c4b4d70

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

drivers/video/fbdev/hyperv_fb.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,6 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
10091009
struct pci_dev *pdev = NULL;
10101010
void __iomem *fb_virt;
10111011
int gen2vm = efi_enabled(EFI_BOOT);
1012-
resource_size_t pot_start, pot_end;
10131012
phys_addr_t paddr;
10141013
int ret;
10151014

@@ -1060,23 +1059,7 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
10601059
dio_fb_size =
10611060
screen_width * screen_height * screen_depth / 8;
10621061

1063-
if (gen2vm) {
1064-
pot_start = 0;
1065-
pot_end = -1;
1066-
} else {
1067-
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM) ||
1068-
pci_resource_len(pdev, 0) < screen_fb_size) {
1069-
pr_err("Resource not available or (0x%lx < 0x%lx)\n",
1070-
(unsigned long) pci_resource_len(pdev, 0),
1071-
(unsigned long) screen_fb_size);
1072-
goto err1;
1073-
}
1074-
1075-
pot_end = pci_resource_end(pdev, 0);
1076-
pot_start = pot_end - screen_fb_size + 1;
1077-
}
1078-
1079-
ret = vmbus_allocate_mmio(&par->mem, hdev, pot_start, pot_end,
1062+
ret = vmbus_allocate_mmio(&par->mem, hdev, 0, -1,
10801063
screen_fb_size, 0x100000, true);
10811064
if (ret != 0) {
10821065
pr_err("Unable to allocate framebuffer memory\n");

0 commit comments

Comments
 (0)