[PATCH xserver 1/3] kdrive: static and dead code cleanup
Adam Jackson
ajax at redhat.com
Fri Mar 24 19:58:53 UTC 2017
Signed-off-by: Adam Jackson <ajax at redhat.com>
---
hw/kdrive/src/Makefile.am | 1 -
hw/kdrive/src/kcmap.c | 2 +-
hw/kdrive/src/kdrive.c | 116 ++------------
hw/kdrive/src/kdrive.h | 127 ----------------
hw/kdrive/src/kinput.c | 253 ++++---------------------------
hw/kdrive/src/kmode.c | 378 ----------------------------------------------
hw/kdrive/src/kxv.c | 232 ----------------------------
hw/kdrive/src/kxv.h | 21 ---
8 files changed, 50 insertions(+), 1080 deletions(-)
delete mode 100644 hw/kdrive/src/kmode.c
diff --git a/hw/kdrive/src/Makefile.am b/hw/kdrive/src/Makefile.am
index b7f94b0..0833150 100644
--- a/hw/kdrive/src/Makefile.am
+++ b/hw/kdrive/src/Makefile.am
@@ -19,7 +19,6 @@ libkdrive_la_SOURCES = \
kdrive.h \
kinfo.c \
kinput.c \
- kmode.c \
kshadow.c \
$(KDRIVE_XV_SOURCES) \
$(top_srcdir)/mi/miinitext.c
diff --git a/hw/kdrive/src/kcmap.c b/hw/kdrive/src/kcmap.c
index 4fe4545..455e877 100644
--- a/hw/kdrive/src/kcmap.c
+++ b/hw/kdrive/src/kcmap.c
@@ -29,7 +29,7 @@
* Put the entire colormap into the DAC
*/
-void
+static void
KdSetColormap(ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index b2b4996..e746f3a 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -71,20 +71,15 @@ KdDepths kdDepths[] = {
#define KD_DEFAULT_BUTTONS 5
DevPrivateKeyRec kdScreenPrivateKeyRec;
-unsigned long kdGeneration;
+static unsigned long kdGeneration;
-Bool kdVideoTest;
-unsigned long kdVideoTestTime;
Bool kdEmulateMiddleButton;
Bool kdRawPointerCoordinates;
Bool kdDisableZaphod;
-Bool kdAllowZap;
-Bool kdEnabled;
-int kdSubpixelOrder;
-int kdVirtualTerminal = -1;
-Bool kdSwitchPending;
-char *kdSwitchCmd;
-DDXPointRec kdOrigin;
+static Bool kdEnabled;
+static int kdSubpixelOrder;
+static char *kdSwitchCmd;
+static DDXPointRec kdOrigin;
Bool kdHasPointer = FALSE;
Bool kdHasKbd = FALSE;
const char *kdGlobalXkbRules = NULL;
@@ -144,7 +139,7 @@ KdDoSwitchCmd(const char *reason)
}
}
-void
+static void
KdSuspend(void)
{
KdCardInfo *card;
@@ -163,7 +158,7 @@ KdSuspend(void)
}
}
-void
+static void
KdDisableScreens(void)
{
KdSuspend();
@@ -200,46 +195,6 @@ KdEnableScreen(ScreenPtr pScreen)
}
void
-KdResume(void)
-{
- KdCardInfo *card;
- KdScreenInfo *screen;
-
- if (kdEnabled) {
- KdDoSwitchCmd("resume");
- for (card = kdCardInfo; card; card = card->next) {
- if (card->cfuncs->preserve)
- (*card->cfuncs->preserve) (card);
- for (screen = card->screenList; screen; screen = screen->next)
- if (screen->mynum == card->selected && screen->pScreen)
- KdEnableScreen(screen->pScreen);
- }
- KdEnableInput();
- KdReleaseAllKeys();
- }
-}
-
-void
-KdEnableScreens(void)
-{
- if (!kdEnabled) {
- kdEnabled = TRUE;
- if (kdOsFuncs->Enable)
- (*kdOsFuncs->Enable) ();
- }
- KdResume();
-}
-
-void
-KdProcessSwitch(void)
-{
- if (kdEnabled)
- KdDisableScreens();
- else
- KdEnableScreens();
-}
-
-void
AbortDDX(enum ExitCode error)
{
KdDisableScreens();
@@ -261,8 +216,8 @@ ddxGiveUp(enum ExitCode error)
AbortDDX(error);
}
-Bool kdDumbDriver;
-Bool kdSoftCursor;
+static Bool kdDumbDriver;
+static Bool kdSoftCursor;
const char *
KdParseFindNext(const char *cur, const char *delim, char *save, char *last)
@@ -418,18 +373,7 @@ KdParseScreen(KdScreenInfo * screen, const char *arg)
}
}
-/*
- * Mouse argument syntax:
- *
- * device,protocol,options...
- *
- * Options are any of:
- * 1-5 n button mouse
- * 2button emulate middle button
- * {NMO} Reorder buttons
- */
-
-void
+static void
KdParseRgba(char *rgba)
{
if (!strcmp(rgba, "rgb"))
@@ -474,7 +418,6 @@ KdUseMsg(void)
ErrorF
("-origin X,Y Locates the next screen in the the virtual screen (Xinerama)\n");
ErrorF("-switchCmd Command to execute on vt switch\n");
- ErrorF("-zap Terminate server on Ctrl+Alt+Backspace\n");
ErrorF
("vtxx Use virtual terminal xx instead of the next available\n");
}
@@ -507,10 +450,6 @@ KdProcessArgument(int argc, char **argv, int i)
kdDisableZaphod = TRUE;
return 1;
}
- if (!strcmp(argv[i], "-zap")) {
- kdAllowZap = TRUE;
- return 1;
- }
if (!strcmp(argv[i], "-3button")) {
kdEmulateMiddleButton = FALSE;
return 1;
@@ -531,10 +470,6 @@ KdProcessArgument(int argc, char **argv, int i)
kdSoftCursor = TRUE;
return 1;
}
- if (!strcmp(argv[i], "-videoTest")) {
- kdVideoTest = TRUE;
- return 1;
- }
if (!strcmp(argv[i], "-origin")) {
if ((i + 1) < argc) {
char *x = argv[i + 1];
@@ -567,10 +502,6 @@ KdProcessArgument(int argc, char **argv, int i)
UseMsg();
return 2;
}
- if (!strncmp(argv[i], "vt", 2) &&
- sscanf(argv[i], "vt%2d", &kdVirtualTerminal) == 1) {
- return 1;
- }
if (!strcmp(argv[i], "-xkb-rules")) {
if (i + 1 >= argc) {
UseMsg();
@@ -647,7 +578,7 @@ KdOsInit(KdOsFuncs * pOsFuncs)
}
}
-Bool
+static Bool
KdAllocatePrivates(ScreenPtr pScreen)
{
KdPrivScreenPtr pScreenPriv;
@@ -665,7 +596,7 @@ KdAllocatePrivates(ScreenPtr pScreen)
return TRUE;
}
-Bool
+static Bool
KdCreateScreenResources(ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
@@ -684,7 +615,7 @@ KdCreateScreenResources(ScreenPtr pScreen)
return ret;
}
-Bool
+static Bool
KdCloseScreen(ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
@@ -751,7 +682,7 @@ KdCloseScreen(ScreenPtr pScreen)
return ret;
}
-Bool
+static Bool
KdSaveScreen(ScreenPtr pScreen, int on)
{
KdScreenPriv(pScreen);
@@ -858,7 +789,7 @@ KdSetSubpixelOrder(ScreenPtr pScreen, Rotation randr)
/* Pass through AddScreen, which doesn't take any closure */
static KdScreenInfo *kdCurrentScreen;
-Bool
+static Bool
KdScreenInit(ScreenPtr pScreen, int argc, char **argv)
{
KdScreenInfo *screen = kdCurrentScreen;
@@ -968,7 +899,6 @@ KdScreenInit(ScreenPtr pScreen, int argc, char **argv)
/*
* Wrap CloseScreen, the order now is:
* KdCloseScreen
- * miBSCloseScreen
* fbCloseScreen
*/
pScreenPriv->CloseScreen = pScreen->CloseScreen;
@@ -1016,7 +946,7 @@ KdScreenInit(ScreenPtr pScreen, int argc, char **argv)
return TRUE;
}
-void
+static void
KdInitScreen(ScreenInfo * pScreenInfo,
KdScreenInfo * screen, int argc, char **argv)
{
@@ -1118,20 +1048,6 @@ KdAddScreen(ScreenInfo * pScreenInfo,
AddScreen(KdScreenInit, argc, argv);
}
-#if 0 /* This function is not used currently */
-
-int
-KdDepthToFb(ScreenPtr pScreen, int depth)
-{
- KdScreenPriv(pScreen);
-
- for (fb = 0; fb <= KD_MAX_FB && pScreenPriv->screen->fb.frameBuffer; fb++)
- if (pScreenPriv->screen->fb.depth == depth)
- return fb;
-}
-
-#endif
-
static int
KdSignalWrapper(int signum)
{
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index 3c7f2cd..99e7203 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -222,8 +222,6 @@ struct _KdPointerInfo {
struct _KdPointerInfo *next;
};
-extern int KdCurScreen;
-
void KdAddPointerDriver(KdPointerDriver * driver);
void KdRemovePointerDriver(KdPointerDriver * driver);
KdPointerInfo *KdNewPointer(void);
@@ -300,32 +298,6 @@ typedef struct _KdOsFuncs {
void (*Bell) (int, int, int);
} KdOsFuncs;
-typedef enum _KdSyncPolarity {
- KdSyncNegative, KdSyncPositive
-} KdSyncPolarity;
-
-typedef struct _KdMonitorTiming {
- /* label */
- int horizontal;
- int vertical;
- int rate;
- /* pixel clock */
- int clock; /* in KHz */
- /* horizontal timing */
- int hfp; /* front porch */
- int hbp; /* back porch */
- int hblank; /* blanking */
- KdSyncPolarity hpol; /* polarity */
- /* vertical timing */
- int vfp; /* front porch */
- int vbp; /* back porch */
- int vblank; /* blanking */
- KdSyncPolarity vpol; /* polarity */
-} KdMonitorTiming;
-
-extern const KdMonitorTiming kdMonitorTimings[];
-extern const int kdNumMonitorTimings;
-
typedef struct _KdPointerMatrix {
int matrix[2][3];
} KdPointerMatrix;
@@ -334,14 +306,8 @@ extern DevPrivateKeyRec kdScreenPrivateKeyRec;
#define kdScreenPrivateKey (&kdScreenPrivateKeyRec)
-extern unsigned long kdGeneration;
-extern Bool kdEnabled;
-extern Bool kdSwitchPending;
extern Bool kdEmulateMiddleButton;
extern Bool kdDisableZaphod;
-extern Bool kdAllowZap;
-extern int kdVirtualTerminal;
-extern char *kdSwitchCmd;
extern KdOsFuncs *kdOsFuncs;
#define KdGetScreenPriv(pScreen) ((KdPrivScreenPtr) \
@@ -352,9 +318,6 @@ extern KdOsFuncs *kdOsFuncs;
/* kcmap.c */
void
- KdSetColormap(ScreenPtr pScreen);
-
-void
KdEnableColormap(ScreenPtr pScreen);
void
@@ -378,9 +341,6 @@ extern miPointerScreenFuncRec kdPointerScreenFuncs;
void
KdDisableScreen(ScreenPtr pScreen);
-void
- KdDisableScreens(void);
-
Bool
KdEnableScreen(ScreenPtr pScreen);
@@ -388,12 +348,6 @@ void
KdEnableScreens(void);
void
- KdSuspend(void);
-
-void
- KdResume(void);
-
-void
KdProcessSwitch(void);
Rotation KdAddRotation(Rotation a, Rotation b);
@@ -403,17 +357,10 @@ Rotation KdSubRotation(Rotation a, Rotation b);
void
KdParseScreen(KdScreenInfo * screen, const char *arg);
-KdPointerInfo *KdParsePointer(const char *arg);
-
-KdKeyboardInfo *KdParseKeyboard(const char *arg);
-
const char *
KdParseFindNext(const char *cur, const char *delim, char *save, char *last);
void
- KdParseRgba(char *rgba);
-
-void
KdUseMsg(void);
int
@@ -425,26 +372,6 @@ void
void
KdOsAddInputDrivers(void);
-Bool
- KdAllocatePrivates(ScreenPtr pScreen);
-
-Bool
- KdCreateScreenResources(ScreenPtr pScreen);
-
-Bool
- KdCloseScreen(ScreenPtr pScreen);
-
-Bool
- KdSaveScreen(ScreenPtr pScreen, int on);
-
-Bool
- KdScreenInit(ScreenPtr pScreen, int argc, char **argv);
-
-void
-
-KdInitScreen(ScreenInfo * pScreenInfo,
- KdScreenInfo * screen, int argc, char **argv);
-
void
KdInitCard(ScreenInfo * pScreenInfo, KdCardInfo * card, int argc, char **argv);
@@ -476,17 +403,7 @@ void
void
KdCloseInput(void);
-Bool
- KdRegisterFd(int fd, void (*read) (int fd, void *closure), void *closure);
-
void
- KdUnregisterFds(void *closure, Bool do_close);
-
-void
- KdUnregisterFd(void *closure, int fd, Bool do_close);
-
-void
-
KdEnqueueKeyboardEvent(KdKeyboardInfo * ki, unsigned char scan_code,
unsigned char is_up);
@@ -500,33 +417,17 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo * ki, unsigned char scan_code,
#define KD_MOUSE_DELTA 0x80000000
void
-
KdEnqueuePointerEvent(KdPointerInfo * pi, unsigned long flags, int rx, int ry,
int rz);
void
-
-_KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z,
- int b, int absrel, Bool force);
-
-void
- KdReleaseAllKeys(void);
-
-void
- KdSetLed(KdKeyboardInfo * ki, int led, Bool on);
-
-void
KdSetPointerMatrix(KdPointerMatrix *pointer);
void
-
KdComputePointerMatrix(KdPointerMatrix *pointer, Rotation randr, int width,
int height);
void
- KdScreenToPointerCoords(int *x, int *y);
-
-void
KdBlockHandler(ScreenPtr pScreen, void *timeout);
void
@@ -538,34 +439,6 @@ void
void
KdEnableInput(void);
-void
- KdRingBell(KdKeyboardInfo * ki, int volume, int pitch, int duration);
-
-/* kmode.c */
-const KdMonitorTiming *KdFindMode(KdScreenInfo * screen,
- Bool (*supported) (KdScreenInfo *,
- const KdMonitorTiming *));
-
-Bool
-
-KdTuneMode(KdScreenInfo * screen,
- Bool (*usable) (KdScreenInfo *),
- Bool (*supported) (KdScreenInfo *, const KdMonitorTiming *));
-
-#ifdef RANDR
-Bool
-
-KdRandRGetInfo(ScreenPtr pScreen,
- int randr,
- Bool (*supported) (ScreenPtr pScreen, const KdMonitorTiming *));
-
-const KdMonitorTiming *KdRandRGetTiming(ScreenPtr pScreen,
- Bool (*supported) (ScreenPtr pScreen,
- const KdMonitorTiming
- *), int rate,
- RRScreenSizePtr pSize);
-#endif
-
/* kshadow.c */
Bool
KdShadowFbAlloc(KdScreenInfo * screen, Bool rotate);
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 39d8af7..57ec59c 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -80,21 +80,6 @@ static KdPointerMatrix kdPointerMatrix = {
{0, 1, 0}}
};
-void KdResetInputMachine(void);
-
-#define KD_MAX_INPUT_FDS 8
-
-typedef struct _kdInputFd {
- int fd;
- void (*read) (int fd, void *closure);
- int (*enable) (int fd, void *closure);
- void (*disable) (int fd, void *closure);
- void *closure;
-} KdInputFd;
-
-static KdInputFd kdInputFds[KD_MAX_INPUT_FDS];
-static int kdNumInputFds;
-
extern Bool kdRawPointerCoordinates;
extern const char *kdGlobalXkbRules;
@@ -109,7 +94,7 @@ extern const char *kdGlobalXkbOptions;
#define NOBLOCK FNDELAY
#endif
-void
+static void
KdResetInputMachine(void)
{
KdPointerInfo *pi;
@@ -120,89 +105,11 @@ KdResetInputMachine(void)
}
}
-static void
-KdNonBlockFd(int fd)
-{
- int flags;
-
- flags = fcntl(fd, F_GETFL);
- flags |= FASYNC | NOBLOCK;
- fcntl(fd, F_SETFL, flags);
-}
-
-static void
-KdNotifyFd(int fd, int ready, void *data)
-{
- int i = (int) (intptr_t) data;
- (*kdInputFds[i].read)(fd, kdInputFds[i].closure);
-}
-
-static void
-KdAddFd(int fd, int i)
-{
- KdNonBlockFd(fd);
- InputThreadRegisterDev(fd, KdNotifyFd, (void *) (intptr_t) i);
-}
-
-static void
-KdRemoveFd(int fd)
-{
- int flags;
-
- InputThreadUnregisterDev(fd);
- flags = fcntl(fd, F_GETFL);
- flags &= ~(FASYNC | NOBLOCK);
- fcntl(fd, F_SETFL, flags);
-}
-
-Bool
-KdRegisterFd(int fd, void (*read) (int fd, void *closure), void *closure)
-{
- if (kdNumInputFds == KD_MAX_INPUT_FDS)
- return FALSE;
- kdInputFds[kdNumInputFds].fd = fd;
- kdInputFds[kdNumInputFds].read = read;
- kdInputFds[kdNumInputFds].enable = 0;
- kdInputFds[kdNumInputFds].disable = 0;
- kdInputFds[kdNumInputFds].closure = closure;
- if (kdInputEnabled)
- KdAddFd(fd, kdNumInputFds);
- kdNumInputFds++;
- return TRUE;
-}
-
-void
-KdUnregisterFd(void *closure, int fd, Bool do_close)
-{
- int i, j;
-
- for (i = 0; i < kdNumInputFds; i++) {
- if (kdInputFds[i].closure == closure &&
- (fd == -1 || kdInputFds[i].fd == fd)) {
- if (kdInputEnabled)
- KdRemoveFd(kdInputFds[i].fd);
- if (do_close)
- close(kdInputFds[i].fd);
- for (j = i; j < (kdNumInputFds - 1); j++)
- kdInputFds[j] = kdInputFds[j + 1];
- kdNumInputFds--;
- break;
- }
- }
-}
-
-void
-KdUnregisterFds(void *closure, Bool do_close)
-{
- KdUnregisterFd(closure, -1, do_close);
-}
-
void
KdDisableInput(void)
{
KdKeyboardInfo *ki;
KdPointerInfo *pi;
- int found = 0, i = 0;
input_lock();
@@ -216,49 +123,6 @@ KdDisableInput(void)
(*pi->driver->Disable) (pi);
}
- if (kdNumInputFds) {
- ErrorF("[KdDisableInput] Buggy drivers: still %d input fds left!",
- kdNumInputFds);
- i = 0;
- while (i < kdNumInputFds) {
- found = 0;
- for (ki = kdKeyboards; ki; ki = ki->next) {
- if (ki == kdInputFds[i].closure) {
- ErrorF(" fd %d belongs to keybd driver %s\n",
- kdInputFds[i].fd,
- ki->driver && ki->driver->name ?
- ki->driver->name : "(unnamed!)");
- found = 1;
- break;
- }
- }
-
- if (found) {
- i++;
- continue;
- }
-
- for (pi = kdPointers; pi; pi = pi->next) {
- if (pi == kdInputFds[i].closure) {
- ErrorF(" fd %d belongs to pointer driver %s\n",
- kdInputFds[i].fd,
- pi->driver && pi->driver->name ?
- pi->driver->name : "(unnamed!)");
- break;
- }
- }
-
- if (found) {
- i++;
- continue;
- }
-
- ErrorF(" fd %d not claimed by any active device!\n",
- kdInputFds[i].fd);
- KdUnregisterFd(kdInputFds[i].closure, kdInputFds[i].fd, TRUE);
- }
- }
-
kdInputEnabled = FALSE;
}
@@ -497,6 +361,16 @@ LegalModifier(unsigned int key, DeviceIntPtr pDev)
}
static void
+KdRingBell(KdKeyboardInfo * ki, int volume, int pitch, int duration)
+{
+ if (!ki || !ki->driver || !ki->driver->Bell)
+ return;
+
+ if (kdInputEnabled)
+ (*ki->driver->Bell) (ki, volume, pitch, duration);
+}
+
+static void
KdBell(int volume, DeviceIntPtr pDev, void *arg, int something)
{
KeybdCtrl *ctrl = arg;
@@ -529,16 +403,6 @@ DDXRingBell(int volume, int pitch, int duration)
}
}
-void
-KdRingBell(KdKeyboardInfo * ki, int volume, int pitch, int duration)
-{
- if (!ki || !ki->driver || !ki->driver->Bell)
- return;
-
- if (kdInputEnabled)
- (*ki->driver->Bell) (ki, volume, pitch, duration);
-}
-
static void
KdSetLeds(KdKeyboardInfo * ki, int leds)
{
@@ -551,7 +415,7 @@ KdSetLeds(KdKeyboardInfo * ki, int leds)
}
}
-void
+static void
KdSetLed(KdKeyboardInfo * ki, int led, Bool on)
{
if (!ki || !ki->dixdev || !ki->dixdev->kbdfeed)
@@ -615,20 +479,6 @@ KdComputePointerMatrix(KdPointerMatrix * m, Rotation randr, int width,
}
}
-void
-KdScreenToPointerCoords(int *x, int *y)
-{
- int (*m)[3] = kdPointerMatrix.matrix;
- int div = m[0][1] * m[1][0] - m[1][1] * m[0][0];
- int sx = *x;
- int sy = *y;
-
- *x = (m[0][1] * sy - m[0][1] * m[1][2] + m[1][1] * m[0][2] -
- m[1][1] * sx) / div;
- *y = (m[1][0] * sx + m[0][0] * m[1][2] - m[1][0] * m[0][2] -
- m[0][0] * sy) / div;
-}
-
static void
KdKbdCtrl(DeviceIntPtr pDevice, KeybdCtrl * ctrl)
{
@@ -1089,7 +939,7 @@ KdParseKbdOptions(KdKeyboardInfo * ki)
}
}
-KdKeyboardInfo *
+static KdKeyboardInfo *
KdParseKeyboard(const char *arg)
{
char save[1024];
@@ -1197,7 +1047,7 @@ KdParsePointerOptions(KdPointerInfo * pi)
}
}
-KdPointerInfo *
+static KdPointerInfo *
KdParsePointer(const char *arg)
{
char save[1024];
@@ -1673,6 +1523,9 @@ KdClassifyInput(KdPointerInfo * pi, int type, int x, int y, int z, int b)
return keyboard;
}
+static void
+_KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z,
+ int b, int absrel, Bool force);
/* We return true if we're stealing the event. */
static Bool
KdRunMouseMachine(KdPointerInfo * pi, KdInputClass c, int type, int x, int y,
@@ -1747,46 +1600,29 @@ KdHandlePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z, int b,
}
static void
+_KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z,
+ int b, int absrel, Bool force)
+{
+ int valuators[3] = { x, y, z };
+ ValuatorMask mask;
+
+ /* TRUE from KdHandlePointerEvent, means 'we swallowed the event'. */
+ if (!force && KdHandlePointerEvent(pi, type, x, y, z, b, absrel))
+ return;
+
+ valuator_mask_set_range(&mask, 0, 3, valuators);
+
+ QueuePointerEvents(pi->dixdev, type, b, absrel, &mask);
+}
+
+static void
KdReceiveTimeout(KdPointerInfo * pi)
{
KdRunMouseMachine(pi, timeout, 0, 0, 0, 0, 0, 0);
}
-/*
- * kdCheckTermination
- *
- * This function checks for the key sequence that terminates the server. When
- * detected, it sets the dispatchException flag and returns. The key sequence
- * is:
- * Control-Alt
- * It's assumed that the server will be waken up by the caller when this
- * function returns.
- */
-
extern int nClients;
-void
-KdReleaseAllKeys(void)
-{
-#if 0
- int key;
- KdKeyboardInfo *ki;
-
- input_lock();
-
- for (ki = kdKeyboards; ki; ki = ki->next) {
- for (key = ki->keySyms.minKeyCode; key < ki->keySyms.maxKeyCode; key++) {
- if (key_is_down(ki->dixdev, key, KEY_POSTED | KEY_PROCESSED)) {
- KdHandleKeyboardEvent(ki, KeyRelease, key);
- QueueGetKeyboardEvents(ki->dixdev, KeyRelease, key, NULL);
- }
- }
- }
-
- input_unlock();
-#endif
-}
-
static void
KdCheckLock(void)
{
@@ -1921,22 +1757,6 @@ KdEnqueuePointerEvent(KdPointerInfo * pi, unsigned long flags, int rx, int ry,
}
void
-_KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z,
- int b, int absrel, Bool force)
-{
- int valuators[3] = { x, y, z };
- ValuatorMask mask;
-
- /* TRUE from KdHandlePointerEvent, means 'we swallowed the event'. */
- if (!force && KdHandlePointerEvent(pi, type, x, y, z, b, absrel))
- return;
-
- valuator_mask_set_range(&mask, 0, 3, valuators);
-
- QueuePointerEvents(pi->dixdev, type, b, absrel, &mask);
-}
-
-void
KdBlockHandler(ScreenPtr pScreen, void *timeo)
{
KdPointerInfo *pi;
@@ -1977,8 +1797,6 @@ KdWakeupHandler(ScreenPtr pScreen, int result)
}
}
}
- if (kdSwitchPending)
- KdProcessSwitch();
}
#define KdScreenOrigin(pScreen) (&(KdGetScreenPriv(pScreen)->screen->origin))
@@ -2065,13 +1883,10 @@ KdCrossScreen(ScreenPtr pScreen, Bool entering)
{
}
-int KdCurScreen; /* current event screen */
-
static void
KdWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
input_lock();
- KdCurScreen = pScreen->myNum;
miPointerWarpCursor(pDev, pScreen, x, y);
input_unlock();
}
@@ -2086,8 +1901,6 @@ void
ProcessInputEvents(void)
{
mieqProcessInputEvents();
- if (kdSwitchPending)
- KdProcessSwitch();
KdCheckLock();
}
diff --git a/hw/kdrive/src/kmode.c b/hw/kdrive/src/kmode.c
deleted file mode 100644
index fed4ac5..0000000
--- a/hw/kdrive/src/kmode.c
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- * Copyright 1999 SuSE, Inc.
- *
- * 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 SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * 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.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-#include "kdrive.h"
-
-const KdMonitorTiming kdMonitorTimings[] = {
- /* H V Hz KHz */
- /* FP BP BLANK POLARITY */
-
- /* IPAQ modeline:
- *
- * Modeline "320x240" 5.7222 320 337 340 352 240 241 244 254"
- */
- {320, 240, 64, 16256,
- 17, 12, 32, KdSyncNegative,
- 1, 11, 14, KdSyncNegative,
- },
-
- /* Other VESA modes */
- {640, 350, 85, 31500, /* VESA */
- 32, 96, 192, KdSyncPositive, /* 26.413 */
- 32, 60, 95, KdSyncNegative, /* 59.354 */
- },
- {640, 400, 60, 31500, /* VESA */
- 32, 96, 192, KdSyncNegative, /* 26.413 */
- 1, 41, 45, KdSyncPositive, /* 59.354 */
- },
- {720, 400, 85, 35500, /* VESA */
- 36, 108, 216, KdSyncNegative, /* 37.927 */
- 1, 42, 46, KdSyncPositive, /* 85.039 */
- },
-
- /* Modeline "720x576" 29.000 720 736 800 880 576 577 580 625 */
- {
- 720, 576, 52, 32954, /* PAL Video */
- 16, 80, 160, KdSyncPositive, /* 32.954 */
- 1, 45, 49, KdSyncPositive, /* 52.727 */
- },
-
- /* 640x480 modes */
- {640, 480, 85, 36000, /* VESA */
- 56, 80, 192, KdSyncNegative, /* 43.269 */
- 1, 25, 29, KdSyncNegative, /* 85.008 */
- },
- {640, 480, 75, 31500, /* VESA */
- 16, 120, 200, KdSyncNegative, /* 37.500 */
- 1, 16, 20, KdSyncNegative, /* 75.000 */
- },
- {640, 480, 72, 31500, /* VESA */
- 16, 120, 176, KdSyncNegative, /* 37.861 */
- 1, 20, 24, KdSyncNegative, /* 72.809 */
- },
- {640, 480, 60, 25175, /* VESA */
- 16, 48, 160, KdSyncNegative, /* 31.469 */
- 10, 33, 45, KdSyncNegative, /* 59.940 */
- },
-
- /* 800x600 modes */
- {800, 600, 85, 56250, /* VESA */
- 32, 152, 248, KdSyncPositive, /* 53.674 */
- 1, 27, 31, KdSyncPositive, /* 85.061 */
- },
- {800, 600, 75, 49500, /* VESA */
- 16, 160, 256, KdSyncPositive, /* 46.875 */
- 1, 21, 25, KdSyncPositive, /* 75.000 */
- },
- /* DEFAULT */
-#define MONITOR_TIMING_DEFAULT 9
- {800, 600, 72, 50000, /* VESA */
- 56, 64, 240, KdSyncPositive, /* 48.077 */
- 37, 23, 66, KdSyncPositive, /* 72.188 */
- },
- {800, 600, 60, 40000, /* VESA */
- 40, 88, 256, KdSyncPositive, /* 37.879 */
- 1, 23, 28, KdSyncPositive, /* 60.317 */
- },
- {800, 600, 56, 36000, /* VESA */
- 24, 128, 224, KdSyncPositive, /* 35.156 */
- 1, 22, 25, KdSyncPositive, /* 56.250 */
- },
-
- /* 1024x768 modes */
- {1024, 768, 85, 94500, /* VESA */
- 48, 208, 352, KdSyncPositive, /* 68.677 */
- 1, 36, 40, KdSyncPositive, /* 84.997 */
- },
- {1024, 768, 75, 78750, /* VESA */
- 16, 176, 288, KdSyncPositive, /* 60.023 */
- 1, 28, 32, KdSyncPositive, /* 75.029 */
- },
- {1024, 768, 70, 75000, /* VESA */
- 24, 144, 304, KdSyncNegative, /* 56.476 */
- 3, 29, 38, KdSyncNegative, /* 70.069 */
- },
- {1024, 768, 60, 65000, /* VESA */
- 24, 160, 320, KdSyncNegative, /* 48.363 */
- 3, 29, 38, KdSyncNegative, /* 60.004 */
- },
-
- /* 1152x864 mode */
- {1152, 864, 75, 108000, /* VESA */
- 64, 256, 448, KdSyncPositive, /* 67.500 */
- 1, 32, 36, KdSyncPositive, /* 75.000 */
- },
-
- /* 1152x900 modes */
- {1152, 900, 85, 122500, /* ADDED */
- 48, 208, 384, KdSyncPositive, /* 79.753 */
- 1, 32, 38, KdSyncPositive, /* 85.024 */
- },
- {1152, 900, 75, 108250, /* ADDED */
- 32, 208, 384, KdSyncPositive, /* 70.475 */
- 1, 32, 38, KdSyncPositive, /* 75.133 */
- },
- {1152, 900, 70, 100250, /* ADDED */
- 32, 208, 384, KdSyncPositive, /* 65.267 */
- 2, 32, 38, KdSyncPositive, /* 69.581 */
- },
- {1152, 900, 66, 95000, /* ADDED */
- 32, 208, 384, KdSyncPositive, /* 61.849 */
- 1, 32, 38, KdSyncPositive, /* 65.937 */
- },
-
- /* 1280x854 modes */
- {1280, 854, 103, 12500, /* ADDED */
- 56, 16, 128, KdSyncPositive, /* 102.554 */
- 1, 216, 12, KdSyncPositive,
- },
-
- /* 1280x960 modes */
- {1280, 960, 85, 148500, /* VESA */
- 64, 224, 448, KdSyncPositive, /* 85.938 */
- 1, 47, 51, KdSyncPositive, /* 85.002 */
- },
- {1280, 960, 60, 108000, /* VESA */
- 96, 312, 520, KdSyncPositive, /* 60.000 */
- 1, 36, 40, KdSyncPositive, /* 60.000 */
- },
-
- /* 1280x1024 modes */
- {1280, 1024, 85, 157500, /* VESA */
- 64, 224, 448, KdSyncPositive, /* 91.146 */
- 1, 44, 48, KdSyncPositive, /* 85.024 */
- },
- {1280, 1024, 75, 135000, /* VESA */
- 16, 248, 408, KdSyncPositive, /* 79.976 */
- 1, 38, 42, KdSyncPositive, /* 75.025 */
- },
- {1280, 1024, 60, 108000, /* VESA */
- 48, 248, 408, KdSyncPositive, /* 63.981 */
- 1, 38, 42, KdSyncPositive, /* 60.020 */
- },
-
- /* 1600x1200 modes */
- {1600, 1200, 85, 229500, /* VESA */
- 64, 304, 560, KdSyncPositive, /* 106.250 */
- 1, 46, 50, KdSyncPositive, /* 85.000 */
- },
- {1600, 1200, 75, 202500, /* VESA */
- 64, 304, 560, KdSyncPositive, /* 93.750 */
- 1, 46, 50, KdSyncPositive, /* 75.000 */
- },
- {1600, 1200, 70, 189000, /* VESA */
- 64, 304, 560, KdSyncPositive, /* 87.500 */
- 1, 46, 50, KdSyncPositive, /* 70.000 */
- },
- {1600, 1200, 65, 175500, /* VESA */
- 64, 304, 560, KdSyncPositive, /* 81.250 */
- 1, 46, 50, KdSyncPositive, /* 65.000 */
- },
- {1600, 1200, 60, 162000, /* VESA */
- 64, 304, 560, KdSyncPositive, /* 75.000 */
- 1, 46, 50, KdSyncPositive, /* 60.000 */
- },
-
- /* 1792x1344 modes */
- {1792, 1344, 85, 301500, /* ADDED */
- 96, 352, 672, KdSyncNegative, /* 122.362 */
- 1, 92, 96, KdSyncPositive, /* 84.974 */
- },
- {1792, 1344, 75, 261000, /* VESA */
- 96, 352, 664, KdSyncNegative, /* 106.270 */
- 1, 69, 73, KdSyncPositive, /* 74.997 */
- },
- {1792, 1344, 60, 204750, /* VESA */
- 128, 328, 656, KdSyncNegative, /* 83.640 */
- 1, 46, 50, KdSyncPositive, /* 60.000 */
- },
-
-#if 0
- {1800, 1012, 75},
- {1906, 1072, 68},
-#endif
-
- /* 1856x1392 modes */
- {1856, 1392, 85, 330500, /* ADDED */
- 160, 352, 736, KdSyncNegative, /* 127.508 */
- 1, 104, 108, KdSyncPositive, /* 85.001 */
- },
- {1856, 1392, 75, 288000, /* VESA */
- 128, 352, 704, KdSyncNegative, /* 112.500 */
- 1, 104, 108, KdSyncPositive, /* 75.000 */
- },
- {1856, 1392, 60, 218250, /* VESA */
- 96, 352, 672, KdSyncNegative, /* 86.333 */
- 1, 43, 47, KdSyncPositive, /* 59.995 */
- },
-
- /* 1920x1440 modes */
- {1920, 1440, 85, 341750, /* ADDED */
- 160, 352, 760, KdSyncNegative, /* 127.512 */
- 1, 56, 60, KdSyncPositive, /* 85.012 */
- },
- {1920, 1440, 75, 297000, /* VESA */
- 144, 352, 720, KdSyncNegative, /* 112.500 */
- 1, 56, 60, KdSyncPositive, /* 75.000 */
- },
- {1920, 1440, 60, 234000, /* VESA */
- 128, 244, 680, KdSyncNegative, /* 90.000 */
- 1, 56, 60, KdSyncPositive, /* 60.000 */
- },
-};
-
-#define NUM_MONITOR_TIMINGS (sizeof kdMonitorTimings/sizeof kdMonitorTimings[0])
-
-const int kdNumMonitorTimings = NUM_MONITOR_TIMINGS;
-
-const KdMonitorTiming *
-KdFindMode(KdScreenInfo * screen,
- Bool (*supported) (KdScreenInfo *, const KdMonitorTiming *))
-{
- int i;
- const KdMonitorTiming *t;
-
- for (i = 0, t = kdMonitorTimings; i < NUM_MONITOR_TIMINGS; i++, t++) {
- if ((*supported) (screen, t) &&
- t->horizontal == screen->width &&
- t->vertical == screen->height &&
- (!screen->rate || t->rate <= screen->rate)) {
- return t;
- }
- }
- ErrorF("Warning: mode not found, using default\n");
- return &kdMonitorTimings[MONITOR_TIMING_DEFAULT];
-}
-
-static const KdMonitorTiming *
-kdFindPrevSize(const KdMonitorTiming * old)
-{
- const KdMonitorTiming *new, *prev;
-
- if (old == kdMonitorTimings)
- return 0;
- new = old;
- /*
- * Search for the previous size
- */
- while (new != kdMonitorTimings) {
- new--;
- if (new->horizontal != old->horizontal &&
- new->vertical != old->vertical) {
- break;
- }
- }
- /*
- * Match the refresh rate (<=)
- */
- while (new != kdMonitorTimings) {
- prev = new - 1;
- if (prev->horizontal == new->horizontal &&
- prev->vertical == new->vertical && prev->rate > old->rate) {
- break;
- }
- new--;
- }
- return new;
-}
-
-Bool
-KdTuneMode(KdScreenInfo * screen,
- Bool (*usable) (KdScreenInfo *),
- Bool (*supported) (KdScreenInfo *, const KdMonitorTiming *))
-{
- const KdMonitorTiming *t;
-
- while (!(*usable) (screen)) {
- /*
- * Fix requested depth and geometry until it works
- */
- if (screen->fb.depth > 16)
- screen->fb.depth = 16;
- else if (screen->fb.depth > 8)
- screen->fb.depth = 8;
- else {
- t = kdFindPrevSize(KdFindMode(screen, supported));
- if (!t)
- return FALSE;
- screen->width = t->horizontal;
- screen->height = t->vertical;
- screen->rate = t->rate;
- }
- }
- return TRUE;
-}
-
-#ifdef RANDR
-Bool
-KdRandRGetInfo(ScreenPtr pScreen,
- int randr,
- Bool (*supported) (ScreenPtr pScreen, const KdMonitorTiming *))
-{
- KdScreenPriv(pScreen);
- KdScreenInfo *screen = pScreenPriv->screen;
- int i;
- const KdMonitorTiming *t;
-
- for (i = 0, t = kdMonitorTimings; i < NUM_MONITOR_TIMINGS; i++, t++) {
- if ((*supported) (pScreen, t)) {
- RRScreenSizePtr pSize;
-
- pSize = RRRegisterSize(pScreen,
- t->horizontal,
- t->vertical,
- screen->width_mm, screen->height_mm);
- if (!pSize)
- return FALSE;
- if (!RRRegisterRate(pScreen, pSize, t->rate))
- return FALSE;
- if (t->horizontal == screen->width &&
- t->vertical == screen->height && t->rate == screen->rate)
- RRSetCurrentConfig(pScreen, randr, t->rate, pSize);
- }
- }
-
- return TRUE;
-}
-
-const KdMonitorTiming *
-KdRandRGetTiming(ScreenPtr pScreen,
- Bool (*supported) (ScreenPtr pScreen,
- const KdMonitorTiming *),
- int rate, RRScreenSizePtr pSize)
-{
- int i;
- const KdMonitorTiming *t;
-
- for (i = 0, t = kdMonitorTimings; i < NUM_MONITOR_TIMINGS; i++, t++) {
- if (t->horizontal == pSize->width &&
- t->vertical == pSize->height &&
- t->rate == rate && (*supported) (pScreen, t))
- return t;
- }
- return 0;
-}
-#endif
diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c
index 035c5e9..711f4d8 100644
--- a/hw/kdrive/src/kxv.c
+++ b/hw/kdrive/src/kxv.c
@@ -110,18 +110,6 @@ static unsigned long PortResource = 0;
#define GET_KDXV_WINDOW(pWin) ((KdXVWindowPtr) \
dixLookupPrivate(&(pWin)->devPrivates, KdXVWindowKey))
-KdVideoAdaptorPtr
-KdXVAllocateVideoAdaptorRec(KdScreenInfo * screen)
-{
- return calloc(1, sizeof(KdVideoAdaptorRec));
-}
-
-void
-KdXVFreeVideoAdaptorRec(KdVideoAdaptorPtr ptr)
-{
- free(ptr);
-}
-
Bool
KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr adaptors, int num)
{
@@ -720,27 +708,6 @@ KdXVReputImage(XvPortRecPrivatePtr portPriv)
}
static int
-KdXVReputAllVideo(WindowPtr pWin, void *data)
-{
- KdXVWindowPtr WinPriv;
-
- if (pWin->drawable.type != DRAWABLE_WINDOW)
- return WT_DONTWALKCHILDREN;
-
- WinPriv = GET_KDXV_WINDOW(pWin);
-
- while (WinPriv) {
- if (WinPriv->PortRec->type == XvInputMask)
- KdXVReputVideo(WinPriv->PortRec);
- else
- KdXVRegetVideo(WinPriv->PortRec);
- WinPriv = WinPriv->next;
- }
-
- return WT_WALKCHILDREN;
-}
-
-static int
KdXVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
{
KdXVWindowPtr winPriv, PrivRoot;
@@ -970,61 +937,6 @@ KdXVCloseScreen(ScreenPtr pScreen)
return pScreen->CloseScreen(pScreen);
}
-static Bool
-KdXVRunning(ScreenPtr pScreen)
-{
- return (KdXVGeneration == serverGeneration && GET_XV_SCREEN(pScreen) != 0);
-}
-
-Bool
-KdXVEnable(ScreenPtr pScreen)
-{
- if (!KdXVRunning(pScreen))
- return TRUE;
-
- WalkTree(pScreen, KdXVReputAllVideo, 0);
-
- return TRUE;
-}
-
-void
-KdXVDisable(ScreenPtr pScreen)
-{
- XvScreenPtr pxvs;
- XvAdaptorPtr pAdaptor;
- XvPortPtr pPort;
- XvPortRecPrivatePtr pPriv;
- int i, j;
-
- if (!KdXVRunning(pScreen))
- return;
-
- pxvs = GET_XV_SCREEN(pScreen);
-
- for (i = 0; i < pxvs->nAdaptors; i++) {
- pAdaptor = &pxvs->pAdaptors[i];
- for (j = 0; j < pAdaptor->nPorts; j++) {
- pPort = &pAdaptor->pPorts[j];
- pPriv = (XvPortRecPrivatePtr) pPort->devPriv.ptr;
- if (pPriv->isOn > XV_OFF) {
-
- (*pPriv->AdaptorRec->StopVideo) (pPriv->screen,
- pPriv->DevPriv.ptr, TRUE);
- pPriv->isOn = XV_OFF;
-
- if (pPriv->pCompositeClip && pPriv->FreeCompositeClip)
- RegionDestroy(pPriv->pCompositeClip);
-
- pPriv->pCompositeClip = NULL;
-
- if (!pPriv->type && pPriv->pDraw) { /* still */
- KdXVRemovePortFromWindow((WindowPtr) pPriv->pDraw, pPriv);
- }
- }
- }
- }
-}
-
/**** XvAdaptorRec fields ****/
static int
@@ -1459,147 +1371,3 @@ KdXVQueryImageAttributes(XvPortPtr pPort,
height, pitches,
offsets);
}
-
-/**************** Common video manipulation functions *******************/
-
-void
-KdXVCopyPackedData(KdScreenInfo * screen, CARD8 *src, CARD8 *dst, int randr,
- int srcPitch, int dstPitch, int srcW, int srcH, int top,
- int left, int h, int w)
-{
- int srcDown = srcPitch, srcRight = 2, srcNext;
- int p;
-
- switch (randr & RR_Rotate_All) {
- case RR_Rotate_0:
- srcDown = srcPitch;
- srcRight = 2;
- break;
- case RR_Rotate_90:
- src += (srcH - 1) * 2;
- srcDown = -2;
- srcRight = srcPitch;
- break;
- case RR_Rotate_180:
- src += srcPitch * (srcH - 1) + (srcW - 1) * 2;
- srcDown = -srcPitch;
- srcRight = -2;
- break;
- case RR_Rotate_270:
- src += srcPitch * (srcW - 1);
- srcDown = 2;
- srcRight = -srcPitch;
- break;
- }
-
- src = src + top * srcDown + left * srcRight;
-
- w >>= 1;
- /* srcRight >>= 1; */
- srcNext = srcRight >> 1;
- while (h--) {
- CARD16 *s = (CARD16 *) src;
- CARD32 *d = (CARD32 *) dst;
-
- p = w;
- while (p--) {
- *d++ = s[0] | (s[srcNext] << 16);
- s += srcRight;
- }
- src += srcPitch;
- dst += dstPitch;
- }
-}
-
-void
-KdXVCopyPlanarData(KdScreenInfo * screen, CARD8 *src, CARD8 *dst, int randr,
- int srcPitch, int srcPitch2, int dstPitch, int srcW,
- int srcH, int height, int top, int left, int h, int w,
- int id)
-{
- int i, j;
- CARD8 *src1, *src2, *src3, *dst1;
- int srcDown = srcPitch, srcDown2 = srcPitch2;
- int srcRight = 2, srcRight2 = 1, srcNext = 1;
-
- /* compute source data pointers */
- src1 = src;
- src2 = src1 + height * srcPitch;
- src3 = src2 + (height >> 1) * srcPitch2;
- switch (randr & RR_Rotate_All) {
- case RR_Rotate_0:
- srcDown = srcPitch;
- srcDown2 = srcPitch2;
- srcRight = 2;
- srcRight2 = 1;
- srcNext = 1;
- break;
- case RR_Rotate_90:
- src1 = src1 + srcH - 1;
- src2 = src2 + (srcH >> 1) - 1;
- src3 = src3 + (srcH >> 1) - 1;
- srcDown = -1;
- srcDown2 = -1;
- srcRight = srcPitch * 2;
- srcRight2 = srcPitch2;
- srcNext = srcPitch;
- break;
- case RR_Rotate_180:
- src1 = src1 + srcPitch * (srcH - 1) + (srcW - 1);
- src2 = src2 + srcPitch2 * ((srcH >> 1) - 1) + ((srcW >> 1) - 1);
- src3 = src3 + srcPitch2 * ((srcH >> 1) - 1) + ((srcW >> 1) - 1);
- srcDown = -srcPitch;
- srcDown2 = -srcPitch2;
- srcRight = -2;
- srcRight2 = -1;
- srcNext = -1;
- break;
- case RR_Rotate_270:
- src1 = src1 + srcPitch * (srcW - 1);
- src2 = src2 + srcPitch2 * ((srcW >> 1) - 1);
- src3 = src3 + srcPitch2 * ((srcW >> 1) - 1);
- srcDown = 1;
- srcDown2 = 1;
- srcRight = -srcPitch * 2;
- srcRight2 = -srcPitch2;
- srcNext = -srcPitch;
- break;
- }
-
- /* adjust for origin */
- src1 += top * srcDown + left * srcNext;
- src2 += (top >> 1) * srcDown2 + (left >> 1) * srcRight2;
- src3 += (top >> 1) * srcDown2 + (left >> 1) * srcRight2;
-
- if (id == FOURCC_I420) {
- CARD8 *srct = src2;
-
- src2 = src3;
- src3 = srct;
- }
-
- dst1 = dst;
-
- w >>= 1;
- for (j = 0; j < h; j++) {
- CARD32 *dst32 = (CARD32 *) dst1;
- CARD8 *s1l = src1;
- CARD8 *s1r = src1 + srcNext;
- CARD8 *s2 = src2;
- CARD8 *s3 = src3;
-
- for (i = 0; i < w; i++) {
- *dst32++ = *s1l | (*s1r << 16) | (*s3 << 8) | (*s2 << 24);
- s1l += srcRight;
- s1r += srcRight;
- s2 += srcRight2;
- s3 += srcRight2;
- }
- src1 += srcDown;
- dst1 += dstPitch;
- if (j & 1) {
- src2 += srcDown2;
- src3 += srcDown2;
- }
- }
-}
diff --git a/hw/kdrive/src/kxv.h b/hw/kdrive/src/kxv.h
index b997299..a264dca 100644
--- a/hw/kdrive/src/kxv.h
+++ b/hw/kdrive/src/kxv.h
@@ -148,27 +148,6 @@ typedef struct {
Bool
KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr Adaptors, int num);
-void
-
-KdXVCopyPackedData(KdScreenInfo * screen, CARD8 *src, CARD8 *dst, int randr,
- int srcPitch, int dstPitch, int srcW, int srcH, int top,
- int left, int h, int w);
-
-void
-
-KdXVCopyPlanarData(KdScreenInfo * screen, CARD8 *src, CARD8 *dst, int randr,
- int srcPitch, int srcPitch2, int dstPitch, int srcW,
- int srcH, int height, int top, int left, int h, int w,
- int id);
-
-KdVideoAdaptorPtr KdXVAllocateVideoAdaptorRec(KdScreenInfo * screen);
-
-void KdXVFreeVideoAdaptorRec(KdVideoAdaptorPtr ptr);
-
-/* Must be called from KdCardInfo functions, can be called without Xv enabled */
-Bool KdXVEnable(ScreenPtr);
-void KdXVDisable(ScreenPtr);
-
/*** These are DDX layer privates ***/
typedef struct {
--
2.9.3
More information about the xorg-devel
mailing list