]> asedeno.scripts.mit.edu Git - linux.git/commit
video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs.
authorWei Hu <weh@microsoft.com>
Mon, 9 Dec 2019 07:57:49 +0000 (15:57 +0800)
committerSasha Levin <sashal@kernel.org>
Mon, 27 Jan 2020 02:22:19 +0000 (21:22 -0500)
commit3a6fb6c4255c3893ab61e2bd4e9ae01ca6bbcd94
tree2776381ec574f12994318fc8b56c06473df48939
parentddc9d357b991838c2d975e8d7e4e9db26f37a7ff
video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs.

On Hyper-V, Generation 1 VMs can directly use VM's physical memory for
their framebuffers. This can improve the efficiency of framebuffer and
overall performence for VM. The physical memory assigned to framebuffer
must be contiguous. We use CMA allocator to get contiguouse physicial
memory when the framebuffer size is greater than 4MB. For size under
4MB, we use alloc_pages to achieve this.

To enable framebuffer memory allocation from CMA, supply a kernel
parameter to give enough space to CMA allocator at boot time. For
example:
    cma=130m
This gives 130MB memory to CAM allocator that can be allocated to
framebuffer. If this fails, we fall back to the old way of using
mmio for framebuffer.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Wei Hu <weh@microsoft.com>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/fbdev/Kconfig
drivers/video/fbdev/hyperv_fb.c