summaryrefslogtreecommitdiff
path: root/src/driver.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-04-17 11:50:40 +0100
committerDave Airlie <airlied@redhat.com>2012-04-17 11:50:40 +0100
commit296d08ef590063fcc6f268778bc012df2d0243c4 (patch)
treebdf9f0ef404ce1f40600b3529884b0305487d680 /src/driver.c
parentd0db3b74acad13106cac19199da115b78a29207b (diff)
modesetting: add set/drop master around VT switch
Diffstat (limited to 'src/driver.c')
-rw-r--r--src/driver.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/driver.c b/src/driver.c
index 516bf61..827438a 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -756,10 +756,12 @@ static void
LeaveVT(int scrnIndex, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
-
+ modesettingPtr ms = modesettingPTR(pScrn);
xf86_hide_cursors(pScrn);
pScrn->vtSema = FALSE;
+
+ drmDropMaster(ms->fd);
}
/*
@@ -773,6 +775,11 @@ EnterVT(int scrnIndex, int flags)
pScrn->vtSema = TRUE;
+ if (drmSetMaster(ms->fd)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "drmSetMaster failed: %s\n",
+ strerror(errno));
+ }
+
if (!drmmode_set_desired_modes(pScrn, &ms->drmmode))
return FALSE;
@@ -815,8 +822,6 @@ CloseScreen(int scrnIndex, ScreenPtr pScreen)
pScreen->CreateScreenResources = ms->createScreenResources;
pScreen->BlockHandler = ms->BlockHandler;
- drmDropMaster(ms->fd);
-
pScrn->vtSema = FALSE;
pScreen->CloseScreen = ms->CloseScreen;
return (*pScreen->CloseScreen) (scrnIndex, pScreen);