Blame SOURCES/vesa-2.3.0-no-virt-shadowfb.patch

40f983
diff -up xf86-video-vesa-2.4.0/src/vesa.c.jx xf86-video-vesa-2.4.0/src/vesa.c
40f983
--- xf86-video-vesa-2.4.0/src/vesa.c.jx	2018-10-16 15:06:11.000000000 -0400
40f983
+++ xf86-video-vesa-2.4.0/src/vesa.c	2018-10-16 15:06:56.659622560 -0400
40f983
@@ -846,9 +846,38 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags
40f983
     memcpy(pVesa->Options, VESAOptions, sizeof(VESAOptions));
40f983
     xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pVesa->Options);
40f983
 
40f983
-    /* Use shadow by default */
40f983
-    pVesa->shadowFB = xf86ReturnOptValBool(pVesa->Options, OPTION_SHADOW_FB,
40f983
-                                           TRUE);
40f983
+    /* Use shadow by default, for non-virt hardware */
40f983
+    if (!xf86GetOptValBool(pVesa->Options, OPTION_SHADOW_FB, &pVesa->shadowFB))
40f983
+    {
40f983
+	switch (pVesa->pciInfo->vendor_id) {
40f983
+	    case 0x1234: /* bochs vga (not in pci.ids) */
40f983
+	    case 0x15ad: /* vmware */
40f983
+	    case 0x1b36: /* qemu qxl */
40f983
+	    case 0x80ee: /* virtualbox */
40f983
+	    case 0xaaaa: /* parallels (not in pci.ids) */
40f983
+		pVesa->shadowFB = FALSE;
40f983
+		break;
40f983
+
40f983
+	    case 0x1013: /* qemu's cirrus emulation */
40f983
+		if (pVesa->pciInfo->subvendor_id == 0x1af4)
40f983
+		    pVesa->shadowFB = FALSE;
40f983
+		else
40f983
+		    pVesa->shadowFB = TRUE;
40f983
+		break;
40f983
+
40f983
+	    case 0x1414: /* microsoft hyper-v */
40f983
+		if (pVesa->pciInfo->device_id == 0x5353)
40f983
+		    pVesa->shadowFB = FALSE;
40f983
+		else
40f983
+		    pVesa->shadowFB = TRUE;
40f983
+		break;
40f983
+
40f983
+	    default:
40f983
+		pVesa->shadowFB = TRUE;
40f983
+		break;
40f983
+	}	    
40f983
+    }
40f983
+
40f983
     /*  Use default refresh by default. Too many VBE 3.0
40f983
      *   BIOSes are incorrectly implemented.
40f983
      */