video: hyperv: hyperv_fb: Support deferred IO for Hyper-V frame buffer driver
Wei Hu
maintainerPATCH v3 1/1 video: hyperv: hyperv_fb: Support deferred IO for Hyper-V frame buffer driver
Without deferred IO support, hyperv_fb driver informs the host to refresh the entire guest frame buffer at fixed rate, e.g. at 20Hz, no matter there is screen update or not. This patch supports deferred IO for screens in graphics mode and also enables the frame buffer on-demand refresh. The highest refresh rate is still set at 20Hz.
Currently Hyper-V only takes a physical address from guest as the starting address of frame buffer. This implies the guest must allocate contiguous physical memory for frame buffer. In addition, Hyper-V Gen 2 VMs only accept address from MMIO region as frame buffer address. Due to these limitations on Hyper-V host, we keep a shadow copy of frame buffer in the guest. This means one more copy of the dirty rectangle inside guest when doing the on-demand refresh. This can be optimized in the future with help from host. For now the host performance gain from deferred IO outweighs the shadow copy impact in the guest.
---
v2: Incorporated review comments from Michael Kelley
- Increased dirty rectangle by one row in deferred IO case when sending to Hyper-V.
- Corrected the dirty rectangle size in the text mode.
- Added more comments.
- Other minor code cleanups.
v3: Incorporated more review comments
- Removed a few unnecessary variable tests
drivers/video/fbdev/Kconfig | 1 + drivers/video/fbdev/hyperv_fb.c | 216 +++++++++++++++++++++++++++++--- 2 files changed, 197 insertions(+), 20 deletions(-)
drivers/video/fbdev/Kconfig +1 -0
@@ -2241,6 +2241,7 @@ config FB_HYPERV select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT + select FB_DEFERRED_IO help This framebuffer driver supports Microsoft Hyper-V Synthetic Video.
drivers/video/fbdev/hyperv_fb.c +196 -20
364 lines not on this page · raw message
Signature · 1 line
2.20.1
From: Wei Hu <[email protected]> Sent: Thursday, September 5, 2019 1:29 AM
Quoted 26 lines
Without deferred IO support,
hyperv_fbdriver informs the host to refresh the entire guest frame buffer at fixed rate, e.g. at 20Hz, no matter there is screen update or not. This patch supports deferred IO for screens in graphics mode and also enables the frame buffer on-demand refresh. The highest refresh rate is still set at 20Hz.Currently Hyper-V only takes a physical address from guest as the starting address of frame buffer. This implies the guest must allocate contiguous physical memory for frame buffer. In addition, Hyper-V Gen 2 VMs only accept address from MMIO region as frame buffer address. Due to these limitations on Hyper-V host, we keep a shadow copy of frame buffer in the guest. This means one more copy of the dirty rectangle inside guest when doing the on-demand refresh. This can be optimized in the future with help from host. For now the host performance gain from deferred IO outweighs the shadow copy impact in the guest.
Signed-off-by Wei Hu <[email protected]>---
v2: Incorporated review comments from Michael Kelley
- Increased dirty rectangle by one row in deferred IO case when sending to Hyper-V.
- Corrected the dirty rectangle size in the text mode.
- Added more comments.
- Other minor code cleanups.
Quoted 7 lines
v3: Incorporated more review comments
- Removed a few unnecessary variable testsdrivers/video/fbdev/Kconfig | 1 + drivers/video/fbdev/hyperv_fb.c | 216 +++++++++++++++++++++++++++++--- 2 files changed, 197 insertions(+), 20 deletions(-)