summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Loup A. Griffais <pgriffais@nvidia.com>2010-04-21 18:11:05 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2010-05-04 07:45:59 +1000
commit2f5b5bc8f4c70dab99dd616064219de5c7fbf244 (patch)
tree6677bfa5eb78019325cf80affc8727dd60791fac
parent7317dc45bcf2cac0b8313a2703ae7b0bff2f1cd8 (diff)
xf86: Don't crash when switching modes through RandR without owning the VT.
While VT-switched, FB access is disabled and should remain so. Trying to switch modes in that state would re-enable it, potentially causing crashes if trying to access it before the driver has recovered from the mode switch. Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 41bdb6c003cca3ef0ff88d9c7de318115bab1ba2)
-rw-r--r--hw/xfree86/common/xf86RandR.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c
index 02dcc34b4..d4beb2ce2 100644
--- a/hw/xfree86/common/xf86RandR.c
+++ b/hw/xfree86/common/xf86RandR.c
@@ -163,7 +163,7 @@ xf86RandRSetMode (ScreenPtr pScreen,
WindowPtr pRoot = WindowTable[pScreen->myNum];
Bool ret = TRUE;
- if (pRoot)
+ if (pRoot && scrp->vtSema)
(*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE);
if (useVirtual)
{
@@ -229,7 +229,7 @@ xf86RandRSetMode (ScreenPtr pScreen,
*/
xf86SetViewport (pScreen, pScreen->width, pScreen->height);
xf86SetViewport (pScreen, 0, 0);
- if (pRoot)
+ if (pRoot && scrp->vtSema)
(*scrp->EnableDisableFBAccess) (pScreen->myNum, TRUE);
return ret;
}