Commit 81d23934 authored by Thomas Zimmermann's avatar Thomas Zimmermann
Browse files

fbdev/hyperv-fb: Do not set struct fb_info.apertures



Generic fbdev drivers use the apertures field in struct fb_info to
control ownership of the framebuffer memory and graphics device. Do
not set the values in hyperv-fb.

Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Reviewed-by: default avatarMichael Kelley <mikelley@microsoft.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-9-tzimmermann@suse.de
parent 7a73465e
Loading
Loading
Loading
Loading
+6 −11
Original line number Diff line number Diff line
@@ -988,13 +988,10 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
	struct pci_dev *pdev  = NULL;
	void __iomem *fb_virt;
	int gen2vm = efi_enabled(EFI_BOOT);
	resource_size_t base, size;
	phys_addr_t paddr;
	int ret;

	info->apertures = alloc_apertures(1);
	if (!info->apertures)
		return -ENOMEM;

	if (!gen2vm) {
		pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
			PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
@@ -1003,8 +1000,8 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
			return -ENODEV;
		}

		info->apertures->ranges[0].base = pci_resource_start(pdev, 0);
		info->apertures->ranges[0].size = pci_resource_len(pdev, 0);
		base = pci_resource_start(pdev, 0);
		size = pci_resource_len(pdev, 0);

		/*
		 * For Gen 1 VM, we can directly use the contiguous memory
@@ -1027,8 +1024,8 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
		}
		pr_info("Unable to allocate enough contiguous physical memory on Gen 1 VM. Using MMIO instead.\n");
	} else {
		info->apertures->ranges[0].base = screen_info.lfb_base;
		info->apertures->ranges[0].size = screen_info.lfb_size;
		base = screen_info.lfb_base;
		size = screen_info.lfb_size;
	}

	/*
@@ -1070,9 +1067,7 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
	info->screen_size = dio_fb_size;

getmem_done:
	aperture_remove_conflicting_devices(info->apertures->ranges[0].base,
					    info->apertures->ranges[0].size,
					    false, KBUILD_MODNAME);
	aperture_remove_conflicting_devices(base, size, false, KBUILD_MODNAME);

	if (gen2vm) {
		/* framebuffer is reallocated, clear screen_info to avoid misuse from kexec */