summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/qxl_driver.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index ae0b196..cb99067 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -508,11 +508,23 @@ paint_shadow (qxlScreen *qxl)
submit_copy (qxl, &qrect);
}
+static void qxlSanityCheck(qxlScreen *qxl)
+{
+ /* read the mode back from the rom */
+ if (!qxl->rom || !qxl->pScrn)
+ return;
+
+ if (qxl->rom->mode == ~0) {
+ ErrorF("QXL device jumped back to VGA mode - resetting mode\n");
+ qxlSwitchMode(qxl->pScrn->scrnIndex, qxl->pScrn->currentMode, 0);
+ }
+}
static void
qxlBlockHandler(pointer data, OSTimePtr pTimeout, pointer pRead)
{
qxlScreen *qxl = (qxlScreen *) data;
+ qxlSanityCheck(qxl);
qxlSendCopies (qxl);
}