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

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