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>
This commit is contained in:
parent
2a763c9023
commit
41bdb6c003
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user