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 41bdb6c003)

Signed-off-by: Julien Cristau <jcristau@debian.org>
This commit is contained in:
Pierre-Loup A. Griffais 2010-04-21 18:11:05 -07:00 committed by Julien Cristau
parent 5154dede3d
commit b963839139

View File

@ -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;
}