summaryrefslogtreecommitdiff
path: root/hw/kdrive
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-03-24 15:58:54 -0400
committerAdam Jackson <ajax@redhat.com>2017-05-03 16:00:54 -0400
commitc42311a9d7d2e5a67bdb7f4fa32032b4feba59b1 (patch)
tree3447c054e519f286b9edccf392d260572d959e72 /hw/kdrive
parentc0375dced38674ed98562529530d89ff02c48100 (diff)
kdrive: Remove KdOsFuncs
Only the Init slot was used, and Xephyr can just as easily do that initialization directly. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'hw/kdrive')
-rw-r--r--hw/kdrive/ephyr/Makefile.am1
-rw-r--r--hw/kdrive/ephyr/ephyr.h2
-rw-r--r--hw/kdrive/ephyr/ephyrinit.c5
-rw-r--r--hw/kdrive/ephyr/os.c48
-rw-r--r--hw/kdrive/src/kdrive.c50
-rw-r--r--hw/kdrive/src/kdrive.h14
-rw-r--r--hw/kdrive/src/kinput.c16
7 files changed, 10 insertions, 126 deletions
diff --git a/hw/kdrive/ephyr/Makefile.am b/hw/kdrive/ephyr/Makefile.am
index f4bd060f8..d12559b39 100644
--- a/hw/kdrive/ephyr/Makefile.am
+++ b/hw/kdrive/ephyr/Makefile.am
@@ -54,7 +54,6 @@ Xephyr_SOURCES = \
ephyr.h \
ephyrlog.h \
ephyr_draw.c \
- os.c \
ephyrinit.c \
ephyrcursor.c \
hostx.c \
diff --git a/hw/kdrive/ephyr/ephyr.h b/hw/kdrive/ephyr/ephyr.h
index b48a21ce2..d44dbc17e 100644
--- a/hw/kdrive/ephyr/ephyr.h
+++ b/hw/kdrive/ephyr/ephyr.h
@@ -192,8 +192,6 @@ extern KdPointerDriver EphyrMouseDriver;
extern KdKeyboardDriver EphyrKeyboardDriver;
-extern KdOsFuncs EphyrOsFuncs;
-
extern Bool ephyrCursorInit(ScreenPtr pScreen);
extern int ephyrBufferHeight(KdScreenInfo * screen);
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 383fa9f7c..4870f16f2 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -374,7 +374,10 @@ OsVendorInit(void)
if (hostx_want_host_cursor())
ephyrFuncs.initCursor = &ephyrCursorInit;
- KdOsInit(&EphyrOsFuncs);
+ if (!KdCardInfoLast()) {
+ processScreenArg("640x480", NULL);
+ }
+ hostx_init();
}
KdCardFuncs ephyrFuncs = {
diff --git a/hw/kdrive/ephyr/os.c b/hw/kdrive/ephyr/os.c
deleted file mode 100644
index 12bbc5497..000000000
--- a/hw/kdrive/ephyr/os.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Xephyr - A kdrive X server thats runs in a host X window.
- * Authored by Matthew Allum <mallum@o-hand.com>
- *
- * Copyright © 2004 Nokia
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Nokia not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Nokia makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * NOKIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-#include "ephyr.h"
-
-extern void processScreenArg(const char *screen_size, char *parent_id);
-
-static int
-EphyrInit(void)
-{
- /*
- * make sure at least one screen
- * has been added to the system.
- */
- if (!KdCardInfoLast()) {
- processScreenArg("640x480", NULL);
- }
- return hostx_init();
-}
-
-KdOsFuncs EphyrOsFuncs = {
- .Init = EphyrInit,
-};
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index a68a57072..8283b8e7d 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -90,13 +90,6 @@ const char *kdGlobalXkbOptions = NULL;
static Bool kdCaughtSignal = FALSE;
-/*
- * Carry arguments from InitOutput through driver initialization
- * to KdScreenInit
- */
-
-KdOsFuncs *kdOsFuncs;
-
void
KdDisableScreen(ScreenPtr pScreen)
{
@@ -162,11 +155,7 @@ static void
KdDisableScreens(void)
{
KdSuspend();
- if (kdEnabled) {
- if (kdOsFuncs->Disable)
- (*kdOsFuncs->Disable) ();
- kdEnabled = FALSE;
- }
+ kdEnabled = FALSE;
}
Bool
@@ -198,13 +187,6 @@ void
AbortDDX(enum ExitCode error)
{
KdDisableScreens();
- if (kdOsFuncs) {
- if (kdEnabled && kdOsFuncs->Disable)
- (*kdOsFuncs->Disable) ();
- if (kdOsFuncs->Fini)
- (*kdOsFuncs->Fini) ();
- KdDoSwitchCmd("stop");
- }
if (kdCaughtSignal)
OsAbort();
@@ -560,24 +542,6 @@ KdProcessArgument(int argc, char **argv, int i)
return 0;
}
-/*
- * These are getting tossed in here until I can think of where
- * they really belong
- */
-
-void
-KdOsInit(KdOsFuncs * pOsFuncs)
-{
- kdOsFuncs = pOsFuncs;
- if (pOsFuncs) {
- if (serverGeneration == 1) {
- KdDoSwitchCmd("start");
- if (pOsFuncs->Init)
- (*pOsFuncs->Init) ();
- }
- }
-}
-
static Bool
KdAllocatePrivates(ScreenPtr pScreen)
{
@@ -668,11 +632,7 @@ KdCloseScreen(ScreenPtr pScreen)
* Clean up OS when last card is closed
*/
if (card == kdCardInfo) {
- if (kdEnabled) {
- kdEnabled = FALSE;
- if (kdOsFuncs->Disable)
- (*kdOsFuncs->Disable) ();
- }
+ kdEnabled = FALSE;
}
}
@@ -923,11 +883,7 @@ KdScreenInit(ScreenPtr pScreen, int argc, char **argv)
/*
* Enable the hardware
*/
- if (!kdEnabled) {
- kdEnabled = TRUE;
- if (kdOsFuncs->Enable)
- (*kdOsFuncs->Enable) ();
- }
+ kdEnabled = TRUE;
if (screen->mynum == card->selected) {
if (card->cfuncs->preserve)
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index 99e720396..ad7d1c77d 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -288,16 +288,6 @@ int KdAddConfigKeyboard(char *pointer);
int KdAddKeyboard(KdKeyboardInfo * ki);
void KdRemoveKeyboard(KdKeyboardInfo * ki);
-typedef struct _KdOsFuncs {
- int (*Init) (void);
- void (*Enable) (void);
- Bool (*SpecialKey) (KeySym);
- void (*Disable) (void);
- void (*Fini) (void);
- void (*pollEvents) (void);
- void (*Bell) (int, int, int);
-} KdOsFuncs;
-
typedef struct _KdPointerMatrix {
int matrix[2][3];
} KdPointerMatrix;
@@ -308,7 +298,6 @@ extern DevPrivateKeyRec kdScreenPrivateKeyRec;
extern Bool kdEmulateMiddleButton;
extern Bool kdDisableZaphod;
-extern KdOsFuncs *kdOsFuncs;
#define KdGetScreenPriv(pScreen) ((KdPrivScreenPtr) \
dixLookupPrivate(&(pScreen)->devPrivates, kdScreenPrivateKey))
@@ -367,9 +356,6 @@ int
KdProcessArgument(int argc, char **argv, int i);
void
- KdOsInit(KdOsFuncs * pOsFuncs);
-
-void
KdOsAddInputDrivers(void);
void
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 57ec59cfc..8ab8c24c8 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -392,14 +392,9 @@ DDXRingBell(int volume, int pitch, int duration)
{
KdKeyboardInfo *ki = NULL;
- if (kdOsFuncs->Bell) {
- (*kdOsFuncs->Bell) (volume, pitch, duration);
- }
- else {
- for (ki = kdKeyboards; ki; ki = ki->next) {
- if (ki->dixdev->coreEvents)
- KdRingBell(ki, volume, pitch, duration);
- }
+ for (ki = kdKeyboards; ki; ki = ki->next) {
+ if (ki->dixdev->coreEvents)
+ KdRingBell(ki, volume, pitch, duration);
}
}
@@ -1773,11 +1768,6 @@ KdBlockHandler(ScreenPtr pScreen, void *timeo)
myTimeout = ms;
}
}
- /* if we need to poll for events, do that */
- if (kdOsFuncs->pollEvents) {
- (*kdOsFuncs->pollEvents) ();
- myTimeout = 20;
- }
if (myTimeout > 0)
AdjustWaitForDelay(timeo, myTimeout);
}