xf86: use new xf86VTOwner interface in a few places

This replaces some previous uses of direct xf86Screens[0] accesses.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@gmail.com>
This commit is contained in:
Dave Airlie 2013-04-10 16:32:11 +10:00
parent d61ea1f64d
commit 5b359cf613
4 changed files with 4 additions and 4 deletions

View File

@ -427,7 +427,7 @@ xf86VTSwitch(void)
* Since all screens are currently all in the same state it is sufficient * Since all screens are currently all in the same state it is sufficient
* check the first. This might change in future. * check the first. This might change in future.
*/ */
if (xf86Screens[0]->vtSema) { if (xf86VTOwner()) {
DebugF("xf86VTSwitch: Leaving, xf86Exiting is %s\n", DebugF("xf86VTSwitch: Leaving, xf86Exiting is %s\n",
BOOLTOSTRING((dispatchException & DE_TERMINATE) ? TRUE : FALSE)); BOOLTOSTRING((dispatchException & DE_TERMINATE) ? TRUE : FALSE));

View File

@ -819,7 +819,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
if (serverGeneration != 1) { if (serverGeneration != 1) {
xf86Resetting = TRUE; xf86Resetting = TRUE;
/* All screens are in the same state, so just check the first */ /* All screens are in the same state, so just check the first */
if (!xf86Screens[0]->vtSema) { if (!xf86VTOwner()) {
#ifdef HAS_USL_VTS #ifdef HAS_USL_VTS
ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ); ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ);
#endif #endif

View File

@ -870,7 +870,7 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
} }
/* Enable it if it's properly initialised and we're currently in the VT */ /* Enable it if it's properly initialised and we're currently in the VT */
if (enable && dev->inited && dev->startup && xf86Screens[0]->vtSema) { if (enable && dev->inited && dev->startup && xf86VTOwner()) {
OsBlockSignals(); OsBlockSignals();
EnableDevice(dev, TRUE); EnableDevice(dev, TRUE);
if (!dev->enabled) { if (!dev->enabled) {

View File

@ -274,7 +274,7 @@ xf86OpenConsole(void)
* this is to make sure we don't continue until the activate * this is to make sure we don't continue until the activate
* signal is received. * signal is received.
*/ */
if (!xf86Screens[0]->vtSema) if (!xf86VTOwner())
sleep(5); sleep(5);
} }
#endif /* HAS_USL_VTS */ #endif /* HAS_USL_VTS */