From c031eec626cd2c41ae1c0e70f51c03284017edf9 Mon Sep 17 00:00:00 2001 From: Dexuan Cui Date: Thu, 27 Apr 2017 14:52:42 +0800 Subject: [PATCH] hyperv_fb: use 2560x1440x32 by force MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tested on Windows Server 2016 RTM host: systeminfo.exe on the host shows “OS Version: 10.0.14393 N/A Build 14393”, and winver.exe shows "Version 1607 (OS Build 14393.1066)" The Linux VM is Generation-1 VM (the default). Note: we need to run this PowerShell command on the host: Set-VMVideo -VMName the_vm_name -HorizontalResolution 7680 -VerticalResolution 4320 -ResolutionType Maximum References: https://github.com/MicrosoftDocs/windows-powershell-docs/blob/master/docset/windows/hyper-v/set-vmvideo.md https://technet.microsoft.com/en-us/itpro/powershell/windows/hyper-v/set-vmvideo https://charbelnemnom.com/2015/02/whats-new-in-powershell-for-hyper-v-in-windows-server-technical-preview-hyperv-powershell-vnext/ http://windowsitpro.com/hyper-v/increase-vram-vms-2016-hyper-v-host Signed-off-by: Dexuan Cui --- drivers/video/fbdev/hyperv_fb.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c index 2fd49b2358f8b1..5f6e8fd0a4a99a 100644 --- a/drivers/video/fbdev/hyperv_fb.c +++ b/drivers/video/fbdev/hyperv_fb.c @@ -61,7 +61,7 @@ #define SYNTHVID_WIDTH_MAX_WIN7 1600 #define SYNTHVID_HEIGHT_MAX_WIN7 1200 -#define SYNTHVID_FB_SIZE_WIN8 (8 * 1024 * 1024) +#define SYNTHVID_FB_SIZE_WIN8 (64 * 1024 * 1024) #define PCI_VENDOR_ID_MICROSOFT 0x1414 #define PCI_DEVICE_ID_HYPERV_VIDEO 0x5353 @@ -202,8 +202,8 @@ struct synthvid_msg { /* FB driver definitions and structures */ -#define HVFB_WIDTH 1152 /* default screen width */ -#define HVFB_HEIGHT 864 /* default screen height */ +#define HVFB_WIDTH 2560 /* default screen width */ +#define HVFB_HEIGHT 1440 /* default screen height */ #define HVFB_WIDTH_MIN 640 #define HVFB_HEIGHT_MIN 480 @@ -476,6 +476,9 @@ static int synthvid_connect_vsp(struct hv_device *hdev) screen_fb_size = hdev->channel->offermsg.offer. mmio_megabytes * 1024 * 1024; + if (screen_fb_size >= SYNTHVID_FB_SIZE_WIN8) + screen_fb_size = SYNTHVID_FB_SIZE_WIN8; + return 0; error: @@ -685,6 +688,10 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info) int gen2vm = efi_enabled(EFI_BOOT); resource_size_t pot_start, pot_end; int ret; + static struct resource res = { + .start = 0xf8000000, + .end = 0xfbffffff, + }; if (gen2vm) { pot_start = 0; @@ -708,8 +715,10 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info) ret = vmbus_allocate_mmio(&par->mem, hdev, pot_start, pot_end, screen_fb_size, 0x100000, true); if (ret != 0) { - pr_err("Unable to allocate framebuffer memory\n"); - goto err1; + ret = 0; + par->mem = &res; + pr_err("Unable to allocate framebuffer memory, but trying to use it be force...\n"); + //goto err1; } fb_virt = ioremap(par->mem->start, screen_fb_size);