Skip to content

Commit

Permalink
hyperv_fb: use 2560x1440x32 by force
Browse files Browse the repository at this point in the history
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 <decui@microsoft.com>
  • Loading branch information
dcui committed Apr 27, 2017
1 parent ee91aaf commit c031eec
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions drivers/video/fbdev/hyperv_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit c031eec

Please sign in to comment.