diff options
author | Dave Airlie <airlied@dhcp-1-4.bne.redhat.com> | 2009-12-23 13:26:15 +1000 |
---|---|---|
committer | Dave Airlie <airlied@dhcp-1-4.bne.redhat.com> | 2009-12-23 13:26:15 +1000 |
commit | 92c535f4ea0c3dbe50ccca2c730e0ab06c3aba55 (patch) | |
tree | 7b7ab5e8761cbc5260a997421f01610af8a0f9d0 | |
parent | f7ba4bae1372e1c6f29416c69ee68856630aad52 (diff) |
qxl: add sanity check to make sure we aren't back in VGA mode.
For some reason we still sometimes end up back in VGA mode,
I suspect a kernel VGA access somewhere while under KD_GRAPHICS,
on real HW it would ignore this, qxl seems to "unique" and not
in a good way.
-rw-r--r-- | src/qxl_driver.c | 12 |
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); } |