xfree86: add VT owner interface

This is just a simple interface to avoid accessing x86Screens[0]
directly.

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:02 +10:00
parent ecf6275508
commit d61ea1f64d
2 changed files with 10 additions and 0 deletions

View File

@ -238,6 +238,7 @@ extern _X_EXPORT void xf86InterceptSigIll(void (*sigillhandler) (void));
extern _X_EXPORT Bool xf86EnableVTSwitch(Bool new);
extern _X_EXPORT void xf86ProcessActionEvent(ActionEvent action, void *arg);
extern _X_EXPORT void xf86PrintBacktrace(void);
extern _X_EXPORT Bool xf86VTOwner(void);
/* xf86Helper.c */

View File

@ -768,3 +768,12 @@ DDXRingBell(int volume, int pitch, int duration)
{
xf86OSRingBell(volume, pitch, duration);
}
Bool
xf86VTOwner(void)
{
/* at system startup xf86Screens[0] won't be set - but we will own the VT */
if (xf86NumScreens == 0)
return TRUE;
return xf86Screens[0]->vtSema;
}