sna: Update vtSema for Leave/EnterVT

Xorg changed behaviour in 78f0667d6df9 (xf86Events: split xf86VTSwitch
into xf86VTLeave and xf86VTEnter functions) and stopped altering the
state of scrn->vtSema around calls to Leave/EnterVT. So we must do so
ourselves (albeit a bit belated in noticing the change!)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2017-11-09 00:08:15 +00:00
parent 8dfb6477be
commit 37a682aa8a
1 changed files with 6 additions and 3 deletions

View File

@ -945,14 +945,16 @@ static void sna_leave_vt(VT_FUNC_ARGS_DECL)
SCRN_INFO_PTR(arg);
struct sna *sna = to_sna(scrn);
DBG(("%s\n", __FUNCTION__));
DBG(("%s(vtSema=%d)\n", __FUNCTION__, scrn->vtSema));
sna_mode_reset(sna);
sna_accel_leave(sna);
if (intel_put_master(sna->dev))
if (scrn->vtSema && intel_put_master(sna->dev))
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"drmDropMaster failed: %s\n", strerror(errno));
scrn->vtSema = FALSE;
}
static Bool sna_early_close_screen(CLOSE_SCREEN_ARGS_DECL)
@ -1272,10 +1274,11 @@ static Bool sna_enter_vt(VT_FUNC_ARGS_DECL)
SCRN_INFO_PTR(arg);
struct sna *sna = to_sna(scrn);
DBG(("%s\n", __FUNCTION__));
DBG(("%s(vtSema=%d)\n", __FUNCTION__, scrn->vtSema));
if (intel_get_master(sna->dev))
return FALSE;
scrn->vtSema = TRUE;
sna_accel_enter(sna);
if (sna->flags & SNA_REPROBE) {