summaryrefslogtreecommitdiffstats
path: root/sys/dev/vt
diff options
context:
space:
mode:
authorsephe <sephe@FreeBSD.org>2016-03-28 07:36:54 +0000
committersephe <sephe@FreeBSD.org>2016-03-28 07:36:54 +0000
commitaa300db87e32eb4497657225750a8692d1116175 (patch)
tree8e688bc1feef21b92bf2b101082b0abc833dec63 /sys/dev/vt
parent2b800612daf9f1e49be89fbebf8432f23f01cbc4 (diff)
downloadFreeBSD-src-aa300db87e32eb4497657225750a8692d1116175.zip
FreeBSD-src-aa300db87e32eb4497657225750a8692d1116175.tar.gz
vt: Use textmode when we're running on hypervisors
The graphic mode is noticeably slow on hypervisors, especially on Hyper-V (1 second to each line). Submitted by: Dexuan Cui <decui microsoft com> Reviewed by: kib, sephe, royger (early loader version) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5739
Diffstat (limited to 'sys/dev/vt')
-rw-r--r--sys/dev/vt/hw/vga/vt_vga.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/vt/hw/vga/vt_vga.c b/sys/dev/vt/hw/vga/vt_vga.c
index 4661f35..62c9bf3 100644
--- a/sys/dev/vt/hw/vga/vt_vga.c
+++ b/sys/dev/vt/hw/vga/vt_vga.c
@@ -1214,7 +1214,6 @@ vga_init(struct vt_device *vd)
if (vd->vd_softc == NULL)
vd->vd_softc = (void *)&vga_conssoftc;
sc = vd->vd_softc;
- textmode = 0;
if (vd->vd_flags & VDF_DOWNGRADE && vd->vd_video_dev != NULL)
vga_pci_repost(vd->vd_video_dev);
@@ -1229,6 +1228,13 @@ vga_init(struct vt_device *vd)
bus_space_map(sc->vga_reg_tag, VGA_REG_BASE, VGA_REG_SIZE, 0,
&sc->vga_reg_handle);
+ /*
+ * If "hw.vga.textmode" is not set and we're running on hypervisor,
+ * we use text mode by default, this is because when we're on
+ * hypervisor, vt(4) is usually much slower in graphics mode than
+ * in text mode, especially when we're on Hyper-V.
+ */
+ textmode = vm_guest != VM_GUEST_NO;
TUNABLE_INT_FETCH("hw.vga.textmode", &textmode);
if (textmode) {
vd->vd_flags |= VDF_TEXTMODE;
OpenPOWER on IntegriCloud