[PATCH 1/3] xfree86: add VT owner interface
Dave Airlie
airlied at gmail.com
Tue Apr 9 23:38:49 PDT 2013
This is just a simple interface to avoid accessing x86Screens[0]
directly.
Signed-off-by: Dave Airlie <airlied at gmail.com>
---
hw/xfree86/common/xf86.h | 1 +
hw/xfree86/common/xf86Events.c | 9 +++++++++
2 files changed, 10 insertions(+)
diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 1a20026..eada01c 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -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 */
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 0552233..980f38d 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -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;
+}
--
1.8.2
More information about the xorg-devel
mailing list