Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Saurabh Sengar and committed by
Helge Deller
c4b4d704 42226c98

+1 -18
+1 -18
drivers/video/fbdev/hyperv_fb.c
··· 1009 1009 struct pci_dev *pdev = NULL; 1010 1010 void __iomem *fb_virt; 1011 1011 int gen2vm = efi_enabled(EFI_BOOT); 1012 - resource_size_t pot_start, pot_end; 1013 1012 phys_addr_t paddr; 1014 1013 int ret; 1015 1014 ··· 1059 1060 dio_fb_size = 1060 1061 screen_width * screen_height * screen_depth / 8; 1061 1062 1062 - if (gen2vm) { 1063 - pot_start = 0; 1064 - pot_end = -1; 1065 - } else { 1066 - if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM) || 1067 - pci_resource_len(pdev, 0) < screen_fb_size) { 1068 - pr_err("Resource not available or (0x%lx < 0x%lx)\n", 1069 - (unsigned long) pci_resource_len(pdev, 0), 1070 - (unsigned long) screen_fb_size); 1071 - goto err1; 1072 - } 1073 - 1074 - pot_end = pci_resource_end(pdev, 0); 1075 - pot_start = pot_end - screen_fb_size + 1; 1076 - } 1077 - 1078 - ret = vmbus_allocate_mmio(&par->mem, hdev, pot_start, pot_end, 1063 + ret = vmbus_allocate_mmio(&par->mem, hdev, 0, -1, 1079 1064 screen_fb_size, 0x100000, true); 1080 1065 if (ret != 0) { 1081 1066 pr_err("Unable to allocate framebuffer memory\n");