summaryrefslogtreecommitdiff
path: root/xserver/hw
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2008-06-15 00:17:34 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2008-06-15 00:17:34 +0000
commit86fc487fbc0e5e6f7146a43099dc7ce1791c84f0 (patch)
tree86479ce8d7fc54c515b1aac90f960401587caef0 /xserver/hw
parentf629cb662c6469d23587f9dffc2352a8b6505b7b (diff)
Update to xserver 1.4.2. Tested by landry@, ckuethe@, jsing@ mbalmer@.
Diffstat (limited to 'xserver/hw')
-rw-r--r--xserver/hw/dmx/Makefile.am22
-rw-r--r--xserver/hw/dmx/Makefile.in1
-rw-r--r--xserver/hw/dmx/dmxinput.c17
-rw-r--r--xserver/hw/kdrive/ephyr/Makefile.am10
-rw-r--r--xserver/hw/kdrive/ephyr/Makefile.in1
-rw-r--r--xserver/hw/kdrive/ephyr/ephyr.c172
-rw-r--r--xserver/hw/kdrive/src/kdrive.c209
-rw-r--r--xserver/hw/xfree86/common/xf86AutoConfig.c9
-rw-r--r--xserver/hw/xfree86/common/xf86Priv.h24
-rw-r--r--xserver/hw/xfree86/common/xf86Xinput.c2
-rw-r--r--xserver/hw/xfree86/loader/os.c4
-rw-r--r--xserver/hw/xfree86/modes/xf86Cursors.c3
-rw-r--r--xserver/hw/xfree86/modes/xf86EdidModes.c6
-rw-r--r--xserver/hw/xfree86/modes/xf86Rotate.c2
-rw-r--r--xserver/hw/xfree86/os-support/bus/Pci.h2
-rw-r--r--xserver/hw/xfree86/os-support/bus/freebsdPci.c2
-rw-r--r--xserver/hw/xfree86/xaa/xaaGC.c11
-rw-r--r--xserver/hw/xprint/Makefile.am4
-rw-r--r--xserver/hw/xprint/Makefile.in4
-rw-r--r--xserver/hw/xprint/ddxInit.c23
20 files changed, 300 insertions, 228 deletions
diff --git a/xserver/hw/dmx/Makefile.am b/xserver/hw/dmx/Makefile.am
index 89136b904..15dc281cd 100644
--- a/xserver/hw/dmx/Makefile.am
+++ b/xserver/hw/dmx/Makefile.am
@@ -16,13 +16,18 @@ GLX_INCS = -I$(top_srcdir)/hw/xfree86/dixmods/extmod \
GLX_DEFS = @GL_CFLAGS@
endif
-# It's essential that fbcmap.c be compiled with this flag for DMX to work!!
-DMX_CFLAGS = -DXFree86Server=1
-
if BUILDDOCS
SUBDIRS += doc
endif
+AM_CFLAGS = \
+ -DHAVE_DMX_CONFIG_H \
+ $(DIX_CFLAGS) \
+ $(GLX_INCS) \
+ $(GLX_DEFS) \
+ $(DMX_CFLAGS) \
+ @DMXMODULES_CFLAGS@
+
Xdmx_SOURCES = dmx.c \
dmxcb.c \
dmxcb.h \
@@ -67,8 +72,8 @@ Xdmx_SOURCES = dmx.c \
dmxvisual.h \
dmxwindow.c \
dmxwindow.h \
- $(top_srcdir)/fb/fbcmap.c \
$(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/fb/fbcmap_mi.c \
$(GLX_SRCS)
@@ -82,16 +87,9 @@ Xdmx_LDADD = $(XORG_CORE_LIBS) \
$(GLX_LIBS) \
input/libdmxinput.a \
config/libdmxconfig.a \
+ @XSERVER_LIBS@ \
@DMXMODULES_LIBS@
-Xdmx_CFLAGS = \
- -DHAVE_DMX_CONFIG_H \
- $(DIX_CFLAGS) \
- $(GLX_INCS) \
- $(GLX_DEFS) \
- $(DMX_CFLAGS) \
- @DMXMODULES_CFLAGS@
-
# Man page
appmandir = $(APP_MAN_DIR)
diff --git a/xserver/hw/dmx/Makefile.in b/xserver/hw/dmx/Makefile.in
index 1e25767af..f747986d3 100644
--- a/xserver/hw/dmx/Makefile.in
+++ b/xserver/hw/dmx/Makefile.in
@@ -721,6 +721,7 @@ Xdmx_LDADD = $(XORG_CORE_LIBS) \
$(GLX_LIBS) \
input/libdmxinput.a \
config/libdmxconfig.a \
+ @XSERVER_LIBS@ \
@DMXMODULES_LIBS@
diff --git a/xserver/hw/dmx/dmxinput.c b/xserver/hw/dmx/dmxinput.c
index 7c376dee4..83f8a4a90 100644
--- a/xserver/hw/dmx/dmxinput.c
+++ b/xserver/hw/dmx/dmxinput.c
@@ -1,4 +1,3 @@
-/* $XFree86$ */
/*
* Copyright 2001,2002 Red Hat Inc., Durham, North Carolina.
*
@@ -49,11 +48,12 @@
#include "inputstr.h"
#include "input.h"
+#include "mi.h"
/** Returns TRUE if the key is a valid modifier. For PC-class
* keyboards, all keys can be used as modifiers, so return TRUE
* always. */
-Bool LegalModifier(unsigned int key, DevicePtr pDev)
+Bool LegalModifier(unsigned int key, DeviceIntPtr pDev)
{
return TRUE;
}
@@ -75,6 +75,8 @@ void InitInput(int argc, char **argv)
dmxLog(dmxWarning, "Use keyboard/mouse pair with the first -input\n");
dmxLog(dmxFatal, "At least one core keyboard/mouse pair required\n");
}
+
+ mieqInit();
}
/** Called from dix/dispatch.c in Dispatch() whenever input events
@@ -103,3 +105,14 @@ void dmxUpdateWindowInfo(DMXUpdateType type, WindowPtr pWindow)
if (!dmxInput->detached && dmxInput->updateWindowInfo)
dmxInput->updateWindowInfo(dmxInput, type, pWindow);
}
+
+int
+NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev)
+{
+ return BadRequest;
+}
+
+void
+DeleteInputDeviceRequest(DeviceIntPtr pDev)
+{
+}
diff --git a/xserver/hw/kdrive/ephyr/Makefile.am b/xserver/hw/kdrive/ephyr/Makefile.am
index 8f51bbe08..1738d0f95 100644
--- a/xserver/hw/kdrive/ephyr/Makefile.am
+++ b/xserver/hw/kdrive/ephyr/Makefile.am
@@ -28,9 +28,13 @@ Xephyr_LDADD = \
libxephyr-hostx.a \
../../../exa/libexa.la \
@KDRIVE_LIBS@ \
- @KDRIVE_LIBS@ \
+ @XSERVER_LIBS@ \
@XEPHYR_LIBS@
-Xephyr_DEPENDENCIES = \
+Xephyr_DEPENDENCIES = \
libxephyr.a \
- libxephyr-hostx.a
+ libxephyr-hostx.a \
+ @KDRIVE_LOCAL_LIBS@
+
+relink:
+ rm -f $(bin_PROGRAMS) && make $(bin_PROGRAMS)
diff --git a/xserver/hw/kdrive/ephyr/Makefile.in b/xserver/hw/kdrive/ephyr/Makefile.in
index 2bf3b471e..315f3322d 100644
--- a/xserver/hw/kdrive/ephyr/Makefile.in
+++ b/xserver/hw/kdrive/ephyr/Makefile.in
@@ -644,6 +644,7 @@ Xephyr_LDADD = \
libxephyr-hostx.a \
../../../exa/libexa.la \
@KDRIVE_LIBS@ \
+ @XSERVER_LIBS@ \
@XEPHYR_LIBS@
Xephyr_DEPENDENCIES = \
diff --git a/xserver/hw/kdrive/ephyr/ephyr.c b/xserver/hw/kdrive/ephyr/ephyr.c
index fbb16a465..86e8f1f72 100644
--- a/xserver/hw/kdrive/ephyr/ephyr.c
+++ b/xserver/hw/kdrive/ephyr/ephyr.c
@@ -36,10 +36,16 @@
#include "inputstr.h"
extern int KdTsPhyScreen;
-extern DeviceIntPtr pKdKeyboard;
+KdKeyboardInfo *ephyrKbd;
+KdPointerInfo *ephyrMouse;
+EphyrKeySyms ephyrKeySyms;
static int mouseState = 0;
+typedef struct _EphyrInputPrivate {
+ Bool enabled;
+} EphyrKbdPrivate, EphyrPointerPrivate;
+
Bool EphyrWantGrayScale = 0;
Bool
@@ -75,7 +81,8 @@ Bool
ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv)
{
int width = 640, height = 480;
-
+ unsigned long redMask, greenMask, blueMask;
+
if (hostx_want_screen_size(&width, &height)
|| !screen->width || !screen->height)
{
@@ -127,30 +134,24 @@ ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv)
{
screen->fb[0].depth = 15;
screen->fb[0].bitsPerPixel = 16;
-
- hostx_get_visual_masks (&screen->fb[0].redMask,
- &screen->fb[0].greenMask,
- &screen->fb[0].blueMask);
-
}
else if (screen->fb[0].depth <= 16)
{
screen->fb[0].depth = 16;
screen->fb[0].bitsPerPixel = 16;
-
- hostx_get_visual_masks (&screen->fb[0].redMask,
- &screen->fb[0].greenMask,
- &screen->fb[0].blueMask);
}
else
{
screen->fb[0].depth = 24;
screen->fb[0].bitsPerPixel = 32;
-
- hostx_get_visual_masks (&screen->fb[0].redMask,
- &screen->fb[0].greenMask,
- &screen->fb[0].blueMask);
}
+
+ hostx_get_visual_masks (&redMask, &greenMask, &blueMask);
+
+ screen->fb[0].redMask = (Pixel) redMask;
+ screen->fb[0].greenMask = (Pixel) greenMask;
+ screen->fb[0].blueMask = (Pixel) blueMask;
+
}
scrpriv->randr = screen->randr;
@@ -206,15 +207,14 @@ ephyrMapFramebuffer (KdScreenInfo *screen)
{
EphyrScrPriv *scrpriv = screen->driver;
EphyrPriv *priv = screen->card->driver;
- KdMouseMatrix m;
+ KdPointerMatrix m;
int buffer_height;
EPHYR_DBG(" screen->width: %d, screen->height: %d",
screen->width, screen->height);
- KdComputeMouseMatrix (&m, scrpriv->randr, screen->width, screen->height);
-
- KdSetMouseMatrix (&m);
+ KdComputePointerMatrix (&m, scrpriv->randr, screen->width, screen->height);
+ KdSetPointerMatrix (&m);
priv->bytes_per_line = ((screen->width * screen->fb[0].bitsPerPixel + 31) >> 5) << 2;
@@ -394,6 +394,7 @@ ephyrUnsetInternalDamage (ScreenPtr pScreen)
pPixmap = (*pScreen->GetScreenPixmap) (pScreen);
DamageUnregister (&pPixmap->drawable, scrpriv->pDamage);
+ DamageDestroy (scrpriv->pDamage);
RemoveBlockAndWakeupHandlers (ephyrInternalDamageBlockHandler,
ephyrInternalDamageWakeupHandler,
@@ -675,6 +676,8 @@ ephyrRestore (KdCardInfo *card)
void
ephyrScreenFini (KdScreenInfo *screen)
{
+ xfree(screen->driver);
+ screen->driver = NULL;
}
/*
@@ -719,8 +722,9 @@ ephyrUpdateModifierState(unsigned int state)
kptr = &keyc->down[key >> 3];
bit = 1 << (key & 7);
- if (*kptr & bit)
- KdEnqueueKeyboardEvent(key, TRUE); /* release */
+ if (*kptr & bit && ephyrKbd &&
+ ((EphyrKbdPrivate *)ephyrKbd->driverPrivate)->enabled)
+ KdEnqueueKeyboardEvent(ephyrKbd, key, TRUE); /* release */
if (--count == 0)
break;
@@ -732,7 +736,9 @@ ephyrUpdateModifierState(unsigned int state)
for (key = 0; key < MAP_LENGTH; key++)
if (keyc->modifierMap[key] & mask)
{
- KdEnqueueKeyboardEvent(key, FALSE); /* press */
+ if (keyc->modifierMap[key] & mask && ephyrKbd &&
+ ((EphyrKbdPrivate *)ephyrKbd->driverPrivate)->enabled)
+ KdEnqueueKeyboardEvent(ephyrKbd, key, FALSE); /* press */
break;
}
}
@@ -748,31 +754,47 @@ ephyrPoll(void)
switch (ev.type)
{
case EPHYR_EV_MOUSE_MOTION:
- KdEnqueueMouseEvent(kdMouseInfo, mouseState,
- ev.data.mouse_motion.x,
- ev.data.mouse_motion.y);
+ if (!ephyrMouse ||
+ !((EphyrPointerPrivate *)ephyrMouse->driverPrivate)->enabled)
+ continue;
+ KdEnqueuePointerEvent(ephyrMouse, mouseState,
+ ev.data.mouse_motion.x,
+ ev.data.mouse_motion.y,
+ 0);
break;
case EPHYR_EV_MOUSE_PRESS:
+ if (!ephyrMouse ||
+ !((EphyrPointerPrivate *)ephyrMouse->driverPrivate)->enabled)
+ continue;
ephyrUpdateModifierState(ev.key_state);
mouseState |= ev.data.mouse_down.button_num;
- KdEnqueueMouseEvent(kdMouseInfo, mouseState|KD_MOUSE_DELTA, 0, 0);
+ KdEnqueuePointerEvent(ephyrMouse, mouseState|KD_MOUSE_DELTA, 0, 0, 0);
break;
case EPHYR_EV_MOUSE_RELEASE:
+ if (!ephyrMouse ||
+ !((EphyrPointerPrivate *)ephyrMouse->driverPrivate)->enabled)
+ continue;
ephyrUpdateModifierState(ev.key_state);
mouseState &= ~ev.data.mouse_up.button_num;
- KdEnqueueMouseEvent(kdMouseInfo, mouseState|KD_MOUSE_DELTA, 0, 0);
+ KdEnqueuePointerEvent(ephyrMouse, mouseState|KD_MOUSE_DELTA, 0, 0, 0);
break;
case EPHYR_EV_KEY_PRESS:
+ if (!ephyrKbd ||
+ !((EphyrKbdPrivate *)ephyrKbd->driverPrivate)->enabled)
+ continue;
ephyrUpdateModifierState(ev.key_state);
- KdEnqueueKeyboardEvent (ev.data.key_down.scancode, FALSE);
+ KdEnqueueKeyboardEvent (ephyrKbd, ev.data.key_down.scancode, FALSE);
break;
case EPHYR_EV_KEY_RELEASE:
+ if (!ephyrKbd ||
+ !((EphyrKbdPrivate *)ephyrKbd->driverPrivate)->enabled)
+ continue;
ephyrUpdateModifierState(ev.key_state);
- KdEnqueueKeyboardEvent (ev.data.key_up.scancode, TRUE);
+ KdEnqueueKeyboardEvent (ephyrKbd, ev.data.key_up.scancode, TRUE);
break;
default:
@@ -833,59 +855,113 @@ ephyrPutColors (ScreenPtr pScreen, int fb, int n, xColorItem *pdefs)
/* Mouse calls */
-static Bool
-MouseInit (void)
+static Status
+MouseInit (KdPointerInfo *pi)
{
- return TRUE;
+ pi->driverPrivate = (EphyrPointerPrivate *)
+ xcalloc(sizeof(EphyrPointerPrivate), 1);
+ ((EphyrPointerPrivate *)pi->driverPrivate)->enabled = FALSE;
+ pi->nAxes = 3;
+ pi->nButtons = 32;
+ pi->name = KdSaveString("Xephyr virtual mouse");
+ ephyrMouse = pi;
+ return Success;
+}
+
+static Status
+MouseEnable (KdPointerInfo *pi)
+{
+ ((EphyrPointerPrivate *)pi->driverPrivate)->enabled = TRUE;
+ return Success;
}
static void
-MouseFini (void)
+MouseDisable (KdPointerInfo *pi)
{
- ;
+ ((EphyrPointerPrivate *)pi->driverPrivate)->enabled = FALSE;
+ return;
}
-KdMouseFuncs EphyrMouseFuncs = {
+static void
+MouseFini (KdPointerInfo *pi)
+{
+ ephyrMouse = NULL;
+ return;
+}
+
+KdPointerDriver EphyrMouseDriver = {
+ "ephyr",
MouseInit,
+ MouseEnable,
+ MouseDisable,
MouseFini,
+ NULL,
};
/* Keyboard */
-static void
-EphyrKeyboardLoad (void)
+static Status
+EphyrKeyboardInit (KdKeyboardInfo *ki)
{
- EPHYR_DBG("mark");
-
+ ki->driverPrivate = (EphyrKbdPrivate *)
+ xcalloc(sizeof(EphyrKbdPrivate), 1);
hostx_load_keymap();
+ if (!ephyrKeySyms.map) {
+ ErrorF("Couldn't load keymap from host\n");
+ return BadAlloc;
+ }
+ ki->keySyms.minKeyCode = ephyrKeySyms.minKeyCode;
+ ki->keySyms.maxKeyCode = ephyrKeySyms.maxKeyCode;
+ ki->minScanCode = ki->keySyms.minKeyCode;
+ ki->maxScanCode = ki->keySyms.maxKeyCode;
+ ki->keySyms.mapWidth = ephyrKeySyms.mapWidth;
+ xfree(ki->keySyms.map);
+ ki->keySyms.map = ephyrKeySyms.map;
+ ki->name = KdSaveString("Xephyr virtual keyboard");
+ ephyrKbd = ki;
+ return Success;
}
-static int
-EphyrKeyboardInit (void)
+static Status
+EphyrKeyboardEnable (KdKeyboardInfo *ki)
{
- return 0;
+ ((EphyrKbdPrivate *)ki->driverPrivate)->enabled = TRUE;
+
+ return Success;
}
static void
-EphyrKeyboardFini (void)
+EphyrKeyboardDisable (KdKeyboardInfo *ki)
{
+ ((EphyrKbdPrivate *)ki->driverPrivate)->enabled = FALSE;
+}
+
+static void
+EphyrKeyboardFini (KdKeyboardInfo *ki)
+{
+ /* not xfree: we call malloc from hostx.c. */
+ free(ki->keySyms.map);
+ ephyrKbd = NULL;
+ return;
}
static void
-EphyrKeyboardLeds (int leds)
+EphyrKeyboardLeds (KdKeyboardInfo *ki, int leds)
{
}
static void
-EphyrKeyboardBell (int volume, int frequency, int duration)
+EphyrKeyboardBell (KdKeyboardInfo *ki, int volume, int frequency, int duration)
{
}
-KdKeyboardFuncs EphyrKeyboardFuncs = {
- EphyrKeyboardLoad,
+KdKeyboardDriver EphyrKeyboardDriver = {
+ "ephyr",
EphyrKeyboardInit,
+ EphyrKeyboardEnable,
EphyrKeyboardLeds,
EphyrKeyboardBell,
+ EphyrKeyboardDisable,
EphyrKeyboardFini,
- 0,
+ NULL,
};
diff --git a/xserver/hw/kdrive/src/kdrive.c b/xserver/hw/kdrive/src/kdrive.c
index 52e56e90b..cd4ea7d32 100644
--- a/xserver/hw/kdrive/src/kdrive.c
+++ b/xserver/hw/kdrive/src/kdrive.c
@@ -1,6 +1,4 @@
/*
- * $RCSId: xc/programs/Xserver/hw/kdrive/kdrive.c,v 1.29 2002/10/31 18:29:50 keithp Exp $
- *
* Copyright © 1999 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -43,6 +41,12 @@
#include "dpmsproc.h"
#endif
+#ifdef HAVE_EXECINFO_H
+#include <execinfo.h>
+#endif
+
+#include <signal.h>
+
typedef struct _kdDepths {
CARD8 depth;
CARD8 bpp;
@@ -60,6 +64,8 @@ KdDepths kdDepths[] = {
#define NUM_KD_DEPTHS (sizeof (kdDepths) / sizeof (kdDepths[0]))
+#define KD_DEFAULT_BUTTONS 5
+
int kdScreenPrivateIndex;
unsigned long kdGeneration;
@@ -75,6 +81,10 @@ int kdVirtualTerminal = -1;
Bool kdSwitchPending;
char *kdSwitchCmd;
DDXPointRec kdOrigin;
+Bool kdHasPointer = FALSE;
+Bool kdHasKbd = FALSE;
+
+static Bool kdCaughtSignal = FALSE;
/*
* Carry arguments from InitOutput through driver initialization
@@ -87,7 +97,6 @@ extern WindowPtr *WindowTable;
void
KdSetRootClip (ScreenPtr pScreen, BOOL enable)
{
-#ifndef FB_OLD_SCREEN
WindowPtr pWin = WindowTable[pScreen->myNum];
WindowPtr pChild;
Bool WasViewable;
@@ -214,7 +223,6 @@ KdSetRootClip (ScreenPtr pScreen, BOOL enable)
}
if (pWin->realized)
WindowsRestructured ();
-#endif /* !FB_OLD_SCREEN */
}
void
@@ -271,7 +279,7 @@ KdSuspend (void)
for (screen = card->screenList; screen; screen = screen->next)
if (screen->mynum == card->selected && screen->pScreen)
KdDisableScreen (screen->pScreen);
- if (card->driver)
+ if (card->driver && card->cfuncs->restore)
(*card->cfuncs->restore) (card);
}
KdDisableInput ();
@@ -285,7 +293,8 @@ KdDisableScreens (void)
KdSuspend ();
if (kdEnabled)
{
- (*kdOsFuncs->Disable) ();
+ if (kdOsFuncs->Disable)
+ (*kdOsFuncs->Disable) ();
kdEnabled = FALSE;
}
}
@@ -343,7 +352,8 @@ KdEnableScreens (void)
if (!kdEnabled)
{
kdEnabled = TRUE;
- (*kdOsFuncs->Enable) ();
+ if (kdOsFuncs->Enable)
+ (*kdOsFuncs->Enable) ();
}
KdResume ();
}
@@ -363,11 +373,15 @@ AbortDDX(void)
KdDisableScreens ();
if (kdOsFuncs)
{
- if (kdEnabled)
+ if (kdEnabled && kdOsFuncs->Disable)
(*kdOsFuncs->Disable) ();
- (*kdOsFuncs->Fini) ();
+ if (kdOsFuncs->Fini)
+ (*kdOsFuncs->Fini) ();
KdDoSwitchCmd ("stop");
}
+
+ if (kdCaughtSignal)
+ abort();
}
void
@@ -379,7 +393,7 @@ ddxGiveUp ()
Bool kdDumbDriver;
Bool kdSoftCursor;
-static char *
+char *
KdParseFindNext (char *cur, char *delim, char *save, char *last)
{
while (*cur && !strchr (delim, *cur))
@@ -560,97 +574,6 @@ KdSaveString (char *str)
return n;
}
-/*
- * Parse mouse information. Syntax:
- *
- * <device>,<nbutton>,<protocol>{,<option>}...
- *
- * options: {nmo} pointer mapping (e.g. {321})
- * 2button emulate middle button
- * 3button dont emulate middle button
- */
-
-void
-KdParseMouse (char *arg)
-{
- char save[1024];
- char delim;
- KdMouseInfo *mi;
- int i;
-
- mi = KdMouseInfoAdd ();
- if (!mi)
- return;
- mi->name = 0;
- mi->prot = 0;
- mi->emulateMiddleButton = kdEmulateMiddleButton;
- mi->transformCoordinates = !kdRawPointerCoordinates;
- mi->nbutton = 3;
- for (i = 0; i < KD_MAX_BUTTON; i++)
- mi->map[i] = i + 1;
-
- if (!arg)
- return;
- if (strlen (arg) >= sizeof (save))
- return;
- arg = KdParseFindNext (arg, ",", save, &delim);
- if (!save[0])
- return;
- mi->name = KdSaveString (save);
- if (delim != ',')
- return;
-
- arg = KdParseFindNext (arg, ",", save, &delim);
- if (!save[0])
- return;
-
- if ('1' <= save[0] && save[0] <= '0' + KD_MAX_BUTTON && save[1] == '\0')
- {
- mi->nbutton = save[0] - '0';
- if (mi->nbutton > KD_MAX_BUTTON)
- {
- UseMsg ();
- return;
- }
- }
-
- if (!delim != ',')
- return;
-
- arg = KdParseFindNext (arg, ",", save, &delim);
-
- if (save[0])
- mi->prot = KdSaveString (save);
-
- while (delim == ',')
- {
- arg = KdParseFindNext (arg, ",", save, &delim);
- if (save[0] == '{')
- {
- char *s = save + 1;
- i = 0;
- while (*s && *s != '}')
- {
- if ('1' <= *s && *s <= '0' + mi->nbutton)
- mi->map[i] = *s - '0';
- else
- UseMsg ();
- s++;
- }
- }
- else if (!strcmp (save, "2button"))
- mi->emulateMiddleButton = TRUE;
- else if (!strcmp (save, "3button"))
- mi->emulateMiddleButton = FALSE;
- else if (!strcmp (save, "rawcoord"))
- mi->transformCoordinates = FALSE;
- else if (!strcmp (save, "transform"))
- mi->transformCoordinates = TRUE;
- else
- UseMsg ();
- }
-}
-
void
KdParseRgba (char *rgba)
{
@@ -675,6 +598,8 @@ KdUseMsg (void)
ErrorF("-card pcmcia Use PCMCIA card as additional screen\n");
ErrorF("-screen WIDTH[/WIDTHMM]xHEIGHT[/HEIGHTMM][@ROTATION][X][Y][xDEPTH/BPP{,DEPTH/BPP}[xFREQ]] Specify screen characteristics\n");
ErrorF("-rgba rgb/bgr/vrgb/vbgr/none Specify subpixel ordering for LCD panels\n");
+ ErrorF("-mouse driver [,n,,options] Specify the pointer driver and its options (n is the number of buttons)\n");
+ ErrorF("-keybd driver [,,options] Specify the keyboard driver and its options\n");
ErrorF("-zaphod Disable cursor screen switching\n");
ErrorF("-2button Emulate 3 button mouse\n");
ErrorF("-3button Disable 3 button mouse emulation\n");
@@ -683,7 +608,6 @@ KdUseMsg (void)
ErrorF("-softCursor Force software cursor\n");
ErrorF("-videoTest Start the server, pause momentarily and exit\n");
ErrorF("-origin X,Y Locates the next screen in the the virtual screen (Xinerama)\n");
- ErrorF("-mouse path[,n] Filename of mouse device, n is number of buttons\n");
ErrorF("-switchCmd Command to execute on vt switch\n");
ErrorF("-nozap Don't terminate server on Ctrl+Alt+Backspace\n");
ErrorF("vtxx Use virtual terminal xx instead of the next available\n");
@@ -736,6 +660,11 @@ KdProcessArgument (int argc, char **argv, int i)
kdDontZap = TRUE;
return 1;
}
+ if (!strcmp (argv[i], "-nozap"))
+ {
+ kdDontZap = TRUE;
+ return 1;
+ }
if (!strcmp (argv[i], "-3button"))
{
kdEmulateMiddleButton = FALSE;
@@ -785,14 +714,6 @@ KdProcessArgument (int argc, char **argv, int i)
UseMsg ();
return 2;
}
- if (!strcmp (argv[i], "-mouse"))
- {
- if ((i+1) < argc)
- KdParseMouse (argv[i+1]);
- else
- UseMsg ();
- return 2;
- }
if (!strcmp (argv[i], "-rgba"))
{
if ((i+1) < argc)
@@ -814,6 +735,22 @@ KdProcessArgument (int argc, char **argv, int i)
{
return 1;
}
+ if (!strcmp (argv[i], "-mouse") ||
+ !strcmp (argv[i], "-pointer")) {
+ if (i + 1 >= argc)
+ UseMsg();
+ KdAddConfigPointer(argv[i + 1]);
+ kdHasPointer = TRUE;
+ return 2;
+ }
+ if (!strcmp (argv[i], "-keybd")) {
+ if (i + 1 >= argc)
+ UseMsg();
+ KdAddConfigKeyboard(argv[i + 1]);
+ kdHasKbd = TRUE;
+ return 2;
+ }
+
#ifdef PSEUDO8
return p8ProcessArgument (argc, argv, i);
#else
@@ -835,7 +772,8 @@ KdOsInit (KdOsFuncs *pOsFuncs)
if (serverGeneration == 1)
{
KdDoSwitchCmd ("start");
- (*pOsFuncs->Init) ();
+ if (pOsFuncs->Init)
+ (*pOsFuncs->Init) ();
}
}
}
@@ -1130,14 +1068,6 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
pScreen->SaveScreen = KdSaveScreen;
pScreen->CreateWindow = KdCreateWindow;
-#ifdef FB_OLD_SCREEN
- pScreenPriv->BackingStoreFuncs.SaveAreas = fbSaveAreas;
- pScreenPriv->BackingStoreFuncs.RestoreAreas = fbSaveAreas;
- pScreenPriv->BackingStoreFuncs.SetClipmaskRgn = 0;
- pScreenPriv->BackingStoreFuncs.GetImagePixmap = 0;
- pScreenPriv->BackingStoreFuncs.GetSpansPixmap = 0;
-#endif
-
#if KD_MAX_FB > 1
if (screen->fb[1].depth)
{
@@ -1219,12 +1149,8 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
#if 0
pScreen->backingStoreSupport = Always;
-#ifdef FB_OLD_SCREEN
- miInitializeBackingStore (pScreen, &pScreenPriv->BackingStoreFuncs);
-#else
miInitializeBackingStore (pScreen);
#endif
-#endif
/*
@@ -1420,6 +1346,39 @@ KdDepthToFb (ScreenPtr pScreen, int depth)
#endif
+#ifdef HAVE_BACKTRACE
+/* shamelessly ripped from xf86Events.c */
+void
+KdBacktrace (int signum)
+{
+ void *array[32]; /* more than 32 and you have bigger problems */
+ size_t size, i;
+ char **strings;
+
+ signal(signum, SIG_IGN);
+
+ size = backtrace (array, 32);
+ fprintf (stderr, "\nBacktrace (%d deep):\n", size);
+ strings = backtrace_symbols (array, size);
+ for (i = 0; i < size; i++)
+ fprintf (stderr, "%d: %s\n", i, strings[i]);
+ free (strings);
+
+ kdCaughtSignal = TRUE;
+ if (signum == SIGSEGV)
+ FatalError("Segmentation fault caught\n");
+ else if (signum > 0)
+ FatalError("Signal %d caught\n", signum);
+}
+#else
+void
+KdBacktrace (int signum)
+{
+ kdCaughtSignal = TRUE;
+ FatalError("Segmentation fault caught\n");
+}
+#endif
+
void
KdInitOutput (ScreenInfo *pScreenInfo,
int argc,
@@ -1427,7 +1386,7 @@ KdInitOutput (ScreenInfo *pScreenInfo,
{
KdCardInfo *card;
KdScreenInfo *screen;
-
+
if (!kdCardInfo)
{
InitCard (0);
@@ -1464,6 +1423,8 @@ KdInitOutput (ScreenInfo *pScreenInfo,
for (card = kdCardInfo; card; card = card->next)
for (screen = card->screenList; screen; screen = screen->next)
KdAddScreen (pScreenInfo, screen, argc, argv);
+
+ signal(SIGSEGV, KdBacktrace);
}
#ifdef DPMSExtension
diff --git a/xserver/hw/xfree86/common/xf86AutoConfig.c b/xserver/hw/xfree86/common/xf86AutoConfig.c
index a2c9c5d0e..daf28d9d7 100644
--- a/xserver/hw/xfree86/common/xf86AutoConfig.c
+++ b/xserver/hw/xfree86/common/xf86AutoConfig.c
@@ -160,12 +160,17 @@ videoPtrToDriverName(pciVideoPtr info)
{
/*
* things not handled yet:
- * amd/cyrix/nsc
- * xgi
+ * cyrix/nsc. should be merged into geode anyway.
+ * xgi.
*/
switch (info->vendor)
{
+ case 0x1022:
+ if (info->chipType == 0x2081)
+ return "amd";
+ else
+ return NULL;
case 0x1142: return "apm";
case 0xedd8: return "ark";
case 0x1a03: return "ast";
diff --git a/xserver/hw/xfree86/common/xf86Priv.h b/xserver/hw/xfree86/common/xf86Priv.h
index e7c0a9f67..5a3cba38f 100644
--- a/xserver/hw/xfree86/common/xf86Priv.h
+++ b/xserver/hw/xfree86/common/xf86Priv.h
@@ -100,7 +100,6 @@ extern int xf86NumModuleInfos;
extern int xf86NumDrivers;
extern Bool xf86Resetting;
extern Bool xf86Initialising;
-extern Bool xf86ProbeFailed;
extern int xf86NumScreens;
extern pciVideoPtr *xf86PciVideoInfo;
extern xf86CurrentAccessRec xf86CurrentAccess;
@@ -120,7 +119,7 @@ extern RootWinPropPtr *xf86RegisteredPropertiesTable;
#define DEFAULT_LOG_VERBOSE 3
#endif
#ifndef DEFAULT_DPI
-#define DEFAULT_DPI 75
+#define DEFAULT_DPI 96
#endif
#define DEFAULT_UNRESOLVED TRUE
@@ -155,7 +154,6 @@ extern int pciTestMultiDeviceCard(int bus, int dev, int func, PCITAG** pTag);
/* xf86Config.c */
-Bool xf86PathIsAbsolute(const char *path);
Bool xf86PathIsSafe(const char *path);
/* xf86DefaultModes */
@@ -176,9 +174,6 @@ void xf86PostKbdEvent(unsigned key);
void xf86PostMseEvent(DeviceIntPtr device, int buttons, int dx, int dy);
void xf86Wakeup(pointer blockData, int err, pointer pReadmask);
void xf86SigHandler(int signo);
-#ifdef MEMDEBUG
-void xf86SigMemDebug(int signo);
-#endif
void xf86HandlePMEvents(int fd, pointer data);
extern int (*xf86PMGetEventFromOs)(int fd,pmEvent *events,int num);
extern pmWait (*xf86PMConfirmEventToOs)(int fd,pmEvent event);
@@ -193,20 +188,6 @@ Bool xf86LoadModules(char **list, pointer *optlist);
int xf86SetVerbosity(int verb);
int xf86SetLogVerbosity(int verb);
-/* xf86Io.c */
-
-void xf86KbdBell(int percent, DeviceIntPtr pKeyboard, pointer ctrl,
- int unused);
-void xf86KbdLeds(void);
-void xf86UpdateKbdLeds(void);
-void xf86KbdCtrl(DevicePtr pKeyboard, KeybdCtrl *ctrl);
-void xf86InitKBD(Bool init);
-int xf86KbdProc(DeviceIntPtr pKeyboard, int what);
-
-/* xf86Kbd.c */
-
-void xf86KbdGetMapping(KeySymsPtr pKeySyms, CARD8 *pModMap);
-
/* xf86Lock.c */
#ifdef USE_XF86_SERVERLOCK
@@ -217,6 +198,9 @@ void xf86UnlockServer(void);
void xf86InitXkb(void);
+/* xf86Xinput.c */
+extern xEvent *xf86Events;
+
#endif /* _NO_XF86_PROTOTYPES */
diff --git a/xserver/hw/xfree86/common/xf86Xinput.c b/xserver/hw/xfree86/common/xf86Xinput.c
index 9dd185f94..36a408e12 100644
--- a/xserver/hw/xfree86/common/xf86Xinput.c
+++ b/xserver/hw/xfree86/common/xf86Xinput.c
@@ -116,7 +116,7 @@ _X_EXPORT void
xf86ProcessCommonOptions(LocalDevicePtr local,
pointer list)
{
- if (xf86SetBoolOption(list, "AlwaysCore", 0) ||
+ if (!xf86SetBoolOption(list, "AlwaysCore", 1) ||
!xf86SetBoolOption(list, "SendCoreEvents", 1) ||
!xf86SetBoolOption(list, "CorePointer", 1) ||
!xf86SetBoolOption(list, "CoreKeyboard", 1)) {
diff --git a/xserver/hw/xfree86/loader/os.c b/xserver/hw/xfree86/loader/os.c
index 83fd24787..12cf3d859 100644
--- a/xserver/hw/xfree86/loader/os.c
+++ b/xserver/hw/xfree86/loader/os.c
@@ -42,6 +42,8 @@
#define OSNAME "linux"
#elif defined(__FreeBSD__)
#define OSNAME "freebsd"
+#elif defined(__DragonFly__)
+#define OSNAME "dragonfly"
#elif defined(__NetBSD__)
#define OSNAME "netbsd"
#elif defined(__OpenBSD__)
@@ -62,8 +64,6 @@
#define OSNAME "svr5"
#elif defined(SVR4)
#define OSNAME "svr4"
-#elif defined(__UNIXOS2__)
-#define OSNAME "os2"
#else
#define OSNAME "unknown"
#endif
diff --git a/xserver/hw/xfree86/modes/xf86Cursors.c b/xserver/hw/xfree86/modes/xf86Cursors.c
index b5101642b..a7616e0e5 100644
--- a/xserver/hw/xfree86/modes/xf86Cursors.c
+++ b/xserver/hw/xfree86/modes/xf86Cursors.c
@@ -137,7 +137,8 @@ cursor_bitpos (int flags, int x, Bool mask)
mask = !mask;
if (flags & HARDWARE_CURSOR_NIBBLE_SWAPPED)
x = (x & ~3) | (3 - (x & 3));
- if (flags & HARDWARE_CURSOR_BIT_ORDER_MSBFIRST)
+ if (((flags & HARDWARE_CURSOR_BIT_ORDER_MSBFIRST) == 0) ==
+ (X_BYTE_ORDER == X_BIG_ENDIAN))
x = (x & ~7) | (7 - (x & 7));
if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1)
x = (x << 1) + mask;
diff --git a/xserver/hw/xfree86/modes/xf86EdidModes.c b/xserver/hw/xfree86/modes/xf86EdidModes.c
index 8b5e69d9a..e2ae66567 100644
--- a/xserver/hw/xfree86/modes/xf86EdidModes.c
+++ b/xserver/hw/xfree86/modes/xf86EdidModes.c
@@ -239,6 +239,12 @@ DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing,
Mode->VSyncEnd = Mode->VSyncStart + timing->v_sync_width;
Mode->VTotal = timing->v_active + timing->v_blanking;
+ /* perform basic check on the detail timing */
+ if (Mode->HSyncEnd > Mode->HTotal || Mode->VSyncEnd > Mode->VTotal) {
+ xfree(Mode);
+ return NULL;
+ }
+
xf86SetModeDefaultName(Mode);
/* We ignore h/v_size and h/v_border for now. */
diff --git a/xserver/hw/xfree86/modes/xf86Rotate.c b/xserver/hw/xfree86/modes/xf86Rotate.c
index cbef1351d..f442d92dd 100644
--- a/xserver/hw/xfree86/modes/xf86Rotate.c
+++ b/xserver/hw/xfree86/modes/xf86Rotate.c
@@ -582,7 +582,7 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation)
int width, height, old_width, old_height;
void *shadowData;
PixmapPtr shadow;
- PictureTransformTranslate (&crtc_to_fb, &fb_to_crtc, crtc->x, crtc->y);
+ PictureTransformTranslate (&crtc_to_fb, &fb_to_crtc, F(crtc->x), F(crtc->y));
PictureTransformIsInverse ("offset", &crtc_to_fb, &fb_to_crtc);
/*
diff --git a/xserver/hw/xfree86/os-support/bus/Pci.h b/xserver/hw/xfree86/os-support/bus/Pci.h
index c9098b1b5..a6655bf57 100644
--- a/xserver/hw/xfree86/os-support/bus/Pci.h
+++ b/xserver/hw/xfree86/os-support/bus/Pci.h
@@ -235,7 +235,7 @@
# if defined(linux)
# define ARCH_PCI_INIT axpPciInit
# define INCLUDE_XF86_MAP_PCI_MEM
-# elif defined(__FreeBSD__) || defined(__OpenBSD__)
+# elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
# define ARCH_PCI_INIT freebsdPciInit
# define INCLUDE_XF86_MAP_PCI_MEM
# define INCLUDE_XF86_NO_DOMAIN
diff --git a/xserver/hw/xfree86/os-support/bus/freebsdPci.c b/xserver/hw/xfree86/os-support/bus/freebsdPci.c
index 97782f296..062f9b5a1 100644
--- a/xserver/hw/xfree86/os-support/bus/freebsdPci.c
+++ b/xserver/hw/xfree86/os-support/bus/freebsdPci.c
@@ -83,7 +83,7 @@ static pciBusInfo_t freebsdPci0 = {
/* bridge */ NULL
};
-#if !defined(__OpenBSD__) && !defined(__FreeBSD__)
+#if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__)
#if X_BYTE_ORDER == X_BIG_ENDIAN
#ifdef __sparc__
#ifndef ASI_PL
diff --git a/xserver/hw/xfree86/xaa/xaaGC.c b/xserver/hw/xfree86/xaa/xaaGC.c
index e22081103..b3dc83ada 100644
--- a/xserver/hw/xfree86/xaa/xaaGC.c
+++ b/xserver/hw/xfree86/xaa/xaaGC.c
@@ -38,7 +38,7 @@ Bool
XAACreateGC(GCPtr pGC)
{
ScreenPtr pScreen = pGC->pScreen;
- XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr);
+ XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGetGCIndex()].ptr);
Bool ret;
XAA_SCREEN_PROLOGUE(pScreen,CreateGC);
@@ -80,10 +80,11 @@ XAAValidateGC(
}
if(pGC->depth != 32) {
- if(pGC->bgPixel == -1) /* -1 is reserved for transparency */
- pGC->bgPixel = 0x7fffffff;
- if(pGC->fgPixel == -1) /* -1 is reserved for transparency */
- pGC->fgPixel = 0x7fffffff;
+ /* 0xffffffff is reserved for transparency */
+ if(pGC->bgPixel == 0xffffffff)
+ pGC->bgPixel = 0x7fffffff;
+ if(pGC->fgPixel == 0xffffffff)
+ pGC->fgPixel = 0x7fffffff;
}
if((pDraw->type == DRAWABLE_PIXMAP) && !IS_OFFSCREEN_PIXMAP(pDraw)){
diff --git a/xserver/hw/xprint/Makefile.am b/xserver/hw/xprint/Makefile.am
index f2d41467f..b9a7de070 100644
--- a/xserver/hw/xprint/Makefile.am
+++ b/xserver/hw/xprint/Makefile.am
@@ -12,7 +12,7 @@ Xprt_LDFLAGS = -L$(top_srcdir)
Xprt_LDADD = @XPRINT_LIBS@ ps/libps.la raster/libraster.la \
pcl/libpcl.la pcl-mono/libpcl.la $(top_builddir)/fb/libfb.la \
$(top_builddir)/render/librender.la $(top_builddir)/mi/libmi.la \
- $(top_builddir)/Xext/libXext.la @FREETYPE_LIBS@
+ $(top_builddir)/Xext/libXext.la @FREETYPE_LIBS@ @XSERVER_LIBS@
miinitext-wrapper.c:
echo "#include \"$(top_srcdir)/mi/miinitext.c\"" >> $@
@@ -41,3 +41,5 @@ Xprt_SOURCES = \
$(top_srcdir)/fb/fbcmap_mi.c
EXTRA_DIST = ValTree.c
+
+CLEANFILES = miinitext-wrapper.c dpmsstubs-wrapper.c
diff --git a/xserver/hw/xprint/Makefile.in b/xserver/hw/xprint/Makefile.in
index b9d933009..163d36a01 100644
--- a/xserver/hw/xprint/Makefile.in
+++ b/xserver/hw/xprint/Makefile.in
@@ -631,7 +631,7 @@ Xprt_LDFLAGS = -L$(top_srcdir)
Xprt_LDADD = @XPRINT_LIBS@ ps/libps.la raster/libraster.la \
pcl/libpcl.la pcl-mono/libpcl.la $(top_builddir)/fb/libfb.la \
$(top_builddir)/render/librender.la $(top_builddir)/mi/libmi.la \
- $(top_builddir)/Xext/libXext.la @FREETYPE_LIBS@
+ $(top_builddir)/Xext/libXext.la @FREETYPE_LIBS@ @XSERVER_LIBS@
Xprt_SOURCES = \
attributes.c \
@@ -654,6 +654,7 @@ Xprt_SOURCES = \
$(top_srcdir)/fb/fbcmap_mi.c
EXTRA_DIST = ValTree.c
+CLEANFILES = miinitext-wrapper.c dpmsstubs-wrapper.c
all: all-recursive
.SUFFIXES:
@@ -1121,6 +1122,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
diff --git a/xserver/hw/xprint/ddxInit.c b/xserver/hw/xprint/ddxInit.c
index 6cd3cfd3c..1e7652e60 100644
--- a/xserver/hw/xprint/ddxInit.c
+++ b/xserver/hw/xprint/ddxInit.c
@@ -89,6 +89,12 @@ InitOutput(
}
+void
+DDXRingBell(int volume, int pitch, int duration)
+{
+ /* dummy func; link fails without */
+}
+
static void
BellProc(
int volume,
@@ -156,9 +162,9 @@ PointerProc(
{
map[0] = 0;
InitPointerDeviceStruct(pPtr, map, NUM_BUTTONS,
- miPointerGetMotionEvents,
+ GetMotionHistory,
(PtrCtrlProcPtr)_XpVoidNoop,
- miPointerGetMotionBufferSize());
+ GetMotionHistorySize(), 2);
break;
}
case DEVICE_ON:
@@ -189,7 +195,7 @@ InitInput(
Bool
LegalModifier(
unsigned int key,
- DevicePtr dev)
+ DeviceIntPtr dev)
{
return TRUE;
}
@@ -304,6 +310,17 @@ ChangeDeviceControl (
return BadMatch;
}
+int
+NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev)
+{
+ return BadValue;
+}
+
+void
+DeleteInputDeviceRequest(DeviceIntPtr dev)
+{
+}
+
void
OpenInputDevice (
DeviceIntPtr dev,