From 98ab62f12d8d562229a76a054a25fd5e89df8f9d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 9 Nov 2017 00:08:15 +0000 Subject: [PATCH xf86-video-intel] sna: Change vtSema state on Leave/Enter VT 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/Enter VT. So we must do so ourselves (albeit a bit belated in noticing the change!) Signed-off-by: Chris Wilson --- src/sna/sna_driver.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index 1b4015d..5492c59 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -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) { -- 2.7.4