summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2018-05-30 11:46:46 -0400
committerAdam Jackson <ajax@redhat.com>2018-10-16 15:12:03 -0400
commit583cd769fd8d116fedcbba38db3a8666213f8568 (patch)
tree322873d53b036cc68bd493c2d7fcb735465bd5c5
parent2645e0aa9c17c2c966a0533e52ad00510311483e (diff)
downloadxorg-driver-xf86-video-vesa-no-virt-shadow.tar.gz
Disable shadow by default on known-virtual GPUsno-virt-shadow
Device memory is the same domain as host memory, in this case, so the shadow just introduces more memcpy. Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--src/vesa.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/vesa.c b/src/vesa.c
index af750e2..f19642f 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -851,9 +851,38 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags)
memcpy(pVesa->Options, VESAOptions, sizeof(VESAOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pVesa->Options);
- /* Use shadow by default */
- pVesa->shadowFB = xf86ReturnOptValBool(pVesa->Options, OPTION_SHADOW_FB,
- TRUE);
+ /* Use shadow by default, for non-virt hardware */
+ if (!xf86GetOptValBool(pVesa->Options, OPTION_SHADOW_FB, &pVesa->shadowFB))
+ {
+ switch (pVesa->pciInfo->vendor_id) {
+ case 0x1234: /* bochs vga (not in pci.ids) */
+ case 0x15ad: /* vmware */
+ case 0x1b36: /* qemu qxl */
+ case 0x80ee: /* virtualbox */
+ case 0xaaaa: /* parallels (not in pci.ids) */
+ pVesa->shadowFB = FALSE;
+ break;
+
+ case 0x1013: /* qemu's cirrus emulation */
+ if (pVesa->pciInfo->subvendor_id == 0x1af4)
+ pVesa->shadowFB = FALSE;
+ else
+ pVesa->shadowFB = TRUE;
+ break;
+
+ case 0x1414: /* microsoft hyper-v */
+ if (pVesa->pciInfo->device_id == 0x5353)
+ pVesa->shadowFB = FALSE;
+ else
+ pVesa->shadowFB = TRUE;
+ break;
+
+ default:
+ pVesa->shadowFB = TRUE;
+ break;
+ }
+ }
+
/* Use default refresh by default. Too many VBE 3.0
* BIOSes are incorrectly implemented.
*/