summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortsi <tsi>2002-01-21 23:05:40 +0000
committertsi <tsi>2002-01-21 23:05:40 +0000
commit438bfb9ebc2d09b12552ff8ef35476f972e3dad8 (patch)
treed350a72de3dc2e2fab9eba49452b7d4cda5d6648
parent0f44b4c3727cafdc490d366f886818b9c49e241a (diff)
Resync with 4.2.0Domain-branch
-rw-r--r--lib/font/bitmap/Imakefile14
-rw-r--r--programs/Xserver/hw/kdrive/kinput.c717
-rw-r--r--programs/Xserver/hw/xfree86/CHANGELOG6
-rw-r--r--programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c4
-rw-r--r--programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c15
5 files changed, 443 insertions, 313 deletions
diff --git a/lib/font/bitmap/Imakefile b/lib/font/bitmap/Imakefile
index 3055cf037..73896ca0d 100644
--- a/lib/font/bitmap/Imakefile
+++ b/lib/font/bitmap/Imakefile
@@ -1,5 +1,9 @@
-XCOMM $XConsortium: Imakefile /main/9 1996/11/03 19:31:58 kaleb $
-XCOMM $XFree86: xc/lib/font/bitmap/Imakefile,v 1.6 1999/01/11 09:39:26 dawes Exp $
+XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:46:34 cpqbld Exp $
+
+
+
+
+XCOMM $XFree86: xc/lib/font/bitmap/Imakefile,v 1.12 2001/08/27 17:40:58 dawes Exp $
#if BuildServer && DoLoadableServer
#define IHaveSubdirs
@@ -8,9 +12,9 @@ XCOMM $XFree86: xc/lib/font/bitmap/Imakefile,v 1.6 1999/01/11 09:39:26 dawes Exp
SUBDIRS = module
#endif
-#ifndef KDriveXServer
BDFSRCS=bdfread.c bdfutils.c
BDFOBJS=bdfread.o bdfutils.o
+#ifndef KDriveXServer
BDFDEFS=-DBDFFORMAT
SNFSRCS=snfread.c
@@ -41,6 +45,7 @@ PCFDEFS=-DPCFFORMAT
bitmapfunc.o $(PCFOBJS) $(SNFOBJS) \
fontink.o
+#if BuildFontLib
#define DoNormalLib NormalLibFont
#define DoSharedLib SharedLibFont
#define DoDebugLib DebugLibFont
@@ -49,8 +54,11 @@ PCFDEFS=-DPCFFORMAT
LibraryObjectRule()
SpecialCLibObjectRule(bitmapfunc,$(ICONFIGFILES),$(GZIP_DEFS))
+SpecialCLibObjectRule(bitscale,$(ICONFIGFILES),$(GZIP_DEFS))
+
SubdirLibraryRule($(OBJS))
NormalLintTarget($(SRCS))
+#endif
#if BuildServer && DoLoadableServer
MakeSubdirs($(SUBDIRS))
diff --git a/programs/Xserver/hw/kdrive/kinput.c b/programs/Xserver/hw/kdrive/kinput.c
index bc93f634e..2549df996 100644
--- a/programs/Xserver/hw/kdrive/kinput.c
+++ b/programs/Xserver/hw/kdrive/kinput.c
@@ -21,7 +21,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/kdrive/kinput.c,v 1.9 2000/10/06 22:05:53 keithp Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/kdrive/kinput.c,v 1.22 2001/10/12 06:33:07 keithp Exp $ */
#include "kdrive.h"
#include "inputstr.h"
@@ -37,8 +37,6 @@ static DeviceIntPtr pKdKeyboard, pKdPointer;
static KdMouseFuncs *kdMouseFuncs;
static KdKeyboardFuncs *kdKeyboardFuncs;
-static int kdMouseFd = -1;
-static int kdKeyboardFd = -1;
static unsigned long kdEmulationTimeout;
static Bool kdTimeoutPending;
static int kdBellPitch;
@@ -48,15 +46,15 @@ static Bool kdInputEnabled;
static Bool kdOffScreen;
static unsigned long kdOffScreenTime;
static KdMouseMatrix kdMouseMatrix = {
- 1, 0, 0,
- 0, 1, 0
+ { { 1, 0, 0 },
+ { 0, 1, 0 } }
};
#ifdef TOUCHSCREEN
-static KdTsFuncs *kdTsFuncs;
-static int kdTsFd = -1;
+static KdMouseFuncs *kdTsFuncs;
#endif
+int kdMouseButtonCount;
int kdMinScanCode;
int kdMaxScanCode;
int kdMinKeyCode;
@@ -70,25 +68,34 @@ KeySymsRec kdKeySyms;
void
KdResetInputMachine (void);
-#define KD_MOUSEBUTTON_COUNT 3
-
#define KD_KEY_COUNT 248
CARD8 kdKeyState[KD_KEY_COUNT/8];
#define IsKeyDown(key) ((kdKeyState[(key) >> 3] >> ((key) & 7)) & 1)
+#define KD_MAX_INPUT_FDS 8
+
+typedef struct _kdInputFd {
+ int type;
+ int fd;
+ void (*read) (int fd, void *closure);
+ void (*enable) (int fd, void *closure);
+ void (*disable) (int fd, void *closure);
+ void *closure;
+} KdInputFd;
+
+KdInputFd kdInputFds[KD_MAX_INPUT_FDS];
+int kdNumInputFds;
+int kdInputTypeSequence;
+
void
KdSigio (int sig)
{
-#ifdef TOUCHSCREEN
- if (kdTsFd >= 0)
- (*kdTsFuncs->Read) (kdTsFd);
-#endif
- if (kdMouseFd >= 0)
- (*kdMouseFuncs->Read) (kdMouseFd);
- if (kdKeyboardFd >= 0)
- (*kdKeyboardFuncs->Read) (kdKeyboardFd);
+ int i;
+
+ for (i = 0; i < kdNumInputFds; i++)
+ (*kdInputFds[i].read) (kdInputFds[i].fd, kdInputFds[i].closure);
}
void
@@ -111,7 +118,7 @@ KdUnblockSigio (void)
sigprocmask (SIG_UNBLOCK, &set, 0);
}
-#define VERIFY_SIGIO
+#undef VERIFY_SIGIO
#ifdef VERIFY_SIGIO
void
@@ -127,7 +134,7 @@ KdAssertSigioBlocked (char *where)
#else
-#define KdVerifySigioBlocked(s)
+#define KdAssertSigioBlocked(s)
#endif
@@ -183,17 +190,78 @@ KdRemoveFd (int fd)
}
}
+int
+KdAllocInputType (void)
+{
+ return ++kdInputTypeSequence;
+}
+
+Bool
+KdRegisterFd (int type, int fd, void (*read) (int fd, void *closure), void *closure)
+{
+ if (kdNumInputFds == KD_MAX_INPUT_FDS)
+ return FALSE;
+ kdInputFds[kdNumInputFds].type = type;
+ kdInputFds[kdNumInputFds].fd = fd;
+ kdInputFds[kdNumInputFds].read = read;
+ kdInputFds[kdNumInputFds].enable = 0;
+ kdInputFds[kdNumInputFds].disable = 0;
+ kdInputFds[kdNumInputFds].closure = closure;
+ ++kdNumInputFds;
+ if (kdInputEnabled)
+ KdAddFd (fd);
+ return TRUE;
+}
+
+void
+KdRegisterFdEnableDisable (int fd,
+ void (*enable) (int fd, void *closure),
+ void (*disable) (int fd, void *closure))
+{
+ int i;
+
+ for (i = 0; i < kdNumInputFds; i++)
+ if (kdInputFds[i].fd == fd)
+ {
+ kdInputFds[i].enable = enable;
+ kdInputFds[i].disable = disable;
+ break;
+ }
+}
+
+void
+KdUnregisterFds (int type, Bool do_close)
+{
+ int i;
+
+ for (i = 0; i < kdNumInputFds;)
+ {
+ if (kdInputFds[i].type == type)
+ {
+ if (kdInputEnabled)
+ KdRemoveFd (kdInputFds[i].fd);
+ if (do_close)
+ close (kdInputFds[i].fd);
+ --kdNumInputFds;
+ for (; i < kdNumInputFds; i++)
+ kdInputFds[i] = kdInputFds[i+1];
+ }
+ else
+ i++;
+ }
+}
+
void
KdDisableInput (void)
{
-#ifdef TOUCHSCREEN
- if (kdTsFd >= 0)
- KdRemoveFd (kdTsFd);
-#endif
- if (kdMouseFd >= 0)
- KdRemoveFd (kdMouseFd);
- if (kdKeyboardFd >= 0)
- KdRemoveFd (kdKeyboardFd);
+ int i;
+
+ for (i = 0; i < kdNumInputFds; i++)
+ {
+ KdRemoveFd (kdInputFds[i].fd);
+ if (kdInputFds[i].disable)
+ (*kdInputFds[i].disable) (kdInputFds[i].fd, kdInputFds[i].closure);
+ }
kdInputEnabled = FALSE;
}
@@ -201,16 +269,16 @@ void
KdEnableInput (void)
{
xEvent xE;
+ int i;
kdInputEnabled = TRUE;
-#ifdef TOUCHSCREEN
- if (kdTsFd >= 0)
- KdAddFd (kdTsFd);
-#endif
- if (kdMouseFd >= 0)
- KdAddFd (kdMouseFd);
- if (kdKeyboardFd >= 0)
- KdAddFd (kdKeyboardFd);
+ for (i = 0; i < kdNumInputFds; i++)
+ {
+ KdAddFd (kdInputFds[i].fd);
+ if (kdInputFds[i].enable)
+ (*kdInputFds[i].enable) (kdInputFds[i].fd, kdInputFds[i].closure);
+ }
+
/* reset screen saver */
xE.u.keyButtonPointer.time = GetTimeInMillis ();
NoticeEventTime (&xE);
@@ -219,9 +287,10 @@ KdEnableInput (void)
static int
KdMouseProc(DeviceIntPtr pDevice, int onoff)
{
- BYTE map[4];
+ BYTE map[KD_MAX_BUTTON];
DevicePtr pDev = (DevicePtr)pDevice;
int i;
+ KdMouseInfo *mi;
if (!pDev)
return BadImplementation;
@@ -229,9 +298,9 @@ KdMouseProc(DeviceIntPtr pDevice, int onoff)
switch (onoff)
{
case DEVICE_INIT:
- for (i = 1; i <= KD_MOUSEBUTTON_COUNT; i++)
+ for (i = 1; i <= kdMouseButtonCount; i++)
map[i] = i;
- InitPointerDeviceStruct(pDev, map, KD_MOUSEBUTTON_COUNT,
+ InitPointerDeviceStruct(pDev, map, kdMouseButtonCount,
miPointerGetMotionEvents,
(PtrCtrlProcPtr)NoopDDA,
miPointerGetMotionBufferSize());
@@ -241,18 +310,10 @@ KdMouseProc(DeviceIntPtr pDevice, int onoff)
pDev->on = TRUE;
pKdPointer = pDevice;
if (kdMouseFuncs)
- {
- kdMouseFd = (*kdMouseFuncs->Init) ();
- if (kdMouseFd >= 0 && kdInputEnabled)
- KdAddFd (kdMouseFd);
- }
+ (*kdMouseFuncs->Init) ();
#ifdef TOUCHSCREEN
if (kdTsFuncs)
- {
- kdTsFd = (*kdTsFuncs->Init) ();
- if (kdTsFd >= 0 && kdInputEnabled)
- KdAddFd (kdTsFd);
- }
+ (*kdTsFuncs->Init) ();
#endif
break;
case DEVICE_OFF:
@@ -261,21 +322,11 @@ KdMouseProc(DeviceIntPtr pDevice, int onoff)
{
pDev->on = FALSE;
pKdPointer = 0;
- if (kdMouseFd >= 0)
- {
- if (kdInputEnabled)
- KdRemoveFd (kdMouseFd);
- (*kdMouseFuncs->Fini) (kdMouseFd);
- kdMouseFd = -1;
- }
+ if (kdMouseFuncs)
+ (*kdMouseFuncs->Fini) ();
#ifdef TOUCHSCREEN
- if (kdTsFd >= 0)
- {
- if (kdInputEnabled)
- KdRemoveFd (kdTsFd);
- (*kdTsFuncs->Fini) (kdTsFd);
- kdTsFd = -1;
- }
+ if (kdTsFuncs >= 0)
+ (*kdTsFuncs->Fini) ();
#endif
}
break;
@@ -354,11 +405,7 @@ KdKeybdProc(DeviceIntPtr pDevice, int onoff)
pDev->on = TRUE;
pKdKeyboard = pDevice;
if (kdKeyboardFuncs)
- {
- kdKeyboardFd = (*kdKeyboardFuncs->Init) ();
- if (kdKeyboardFd >= 0 && kdInputEnabled)
- KdAddFd (kdKeyboardFd);
- }
+ (*kdKeyboardFuncs->Init) ();
break;
case DEVICE_OFF:
case DEVICE_CLOSE:
@@ -366,13 +413,8 @@ KdKeybdProc(DeviceIntPtr pDevice, int onoff)
if (pDev->on)
{
pDev->on = FALSE;
- if (kdKeyboardFd >= 0)
- {
- if (kdInputEnabled)
- KdRemoveFd (kdKeyboardFd);
- (*kdKeyboardFuncs->Fini) (kdKeyboardFd);
- kdKeyboardFd = -1;
- }
+ if (kdKeyboardFuncs)
+ (*kdKeyboardFuncs->Fini) ();
}
break;
}
@@ -403,29 +445,29 @@ KdInitAutoRepeats (void)
}
const KdKeySymModsRec kdKeySymMods[] = {
- XK_Control_L, ControlMask,
- XK_Control_R, ControlMask,
- XK_Shift_L, ShiftMask,
- XK_Shift_R, ShiftMask,
- XK_Caps_Lock, LockMask,
- XK_Shift_Lock, LockMask,
- XK_Alt_L, Mod1Mask,
- XK_Alt_R, Mod1Mask,
- XK_Meta_L, Mod1Mask,
- XK_Meta_R, Mod1Mask,
- XK_Num_Lock, Mod2Mask,
- XK_Super_L, Mod3Mask,
- XK_Super_R, Mod3Mask,
- XK_Hyper_L, Mod3Mask,
- XK_Hyper_R, Mod3Mask,
- XK_Mode_switch, Mod4Mask,
+ { XK_Control_L, ControlMask },
+ { XK_Control_R, ControlMask },
+ { XK_Shift_L, ShiftMask },
+ { XK_Shift_R, ShiftMask },
+ { XK_Caps_Lock, LockMask },
+ { XK_Shift_Lock, LockMask },
+ { XK_Alt_L, Mod1Mask },
+ { XK_Alt_R, Mod1Mask },
+ { XK_Meta_L, Mod1Mask },
+ { XK_Meta_R, Mod1Mask },
+ { XK_Num_Lock, Mod2Mask },
+ { XK_Super_L, Mod3Mask },
+ { XK_Super_R, Mod3Mask },
+ { XK_Hyper_L, Mod3Mask },
+ { XK_Hyper_R, Mod3Mask },
+ { XK_Mode_switch, Mod4Mask },
#ifdef TOUCHSCREEN
- /* iPAQ specific hacks */
- XF86XK_Start, ControlMask,
- XK_Menu, ShiftMask,
- XF86XK_Calendar, LockMask,
- XK_telephone, Mod1Mask,
- XF86XK_AudioRecord, Mod2Mask,
+ /* PDA specific hacks */
+ { XF86XK_Start, ControlMask },
+ { XK_Menu, ShiftMask },
+ { XK_telephone, Mod1Mask },
+ { XF86XK_AudioRecord, Mod2Mask },
+ { XF86XK_Calendar, Mod3Mask }
#endif
};
@@ -461,7 +503,17 @@ KdInitInput(KdMouseFuncs *pMouseFuncs,
KdKeyboardFuncs *pKeyboardFuncs)
{
DeviceIntPtr pKeyboard, pPointer;
+ KdMouseInfo *mi;
+ if (!kdMouseInfo)
+ KdParseMouse (0);
+ kdMouseButtonCount = 0;
+ for (mi = kdMouseInfo; mi; mi = mi->next)
+ {
+ if (mi->nbutton > kdMouseButtonCount)
+ kdMouseButtonCount = mi->nbutton;
+ }
+
kdMouseFuncs = pMouseFuncs;
kdKeyboardFuncs = pKeyboardFuncs;
memset (kdKeyState, '\0', sizeof (kdKeyState));
@@ -497,7 +549,7 @@ KdInitInput(KdMouseFuncs *pMouseFuncs,
#ifdef TOUCHSCREEN
void
-KdInitTouchScreen(KdTsFuncs *pTsFuncs)
+KdInitTouchScreen(KdMouseFuncs *pTsFuncs)
{
kdTsFuncs = pTsFuncs;
}
@@ -513,6 +565,8 @@ KdInitTouchScreen(KdTsFuncs *pTsFuncs)
* Button 2 release ^2
* Button 3 press v3
* Button 3 release ^3
+ * Button other press vo
+ * Button other release ^o
* Mouse motion <>
* Keyboard event k
* timeout ...
@@ -538,6 +592,8 @@ KdInitTouchScreen(KdTsFuncs *pTsFuncs)
* ^2 -> (deliever) start
* v3 -> (hold) (settimeout) button_3_pend
* ^3 -> (deliver) start
+ * vo -> (deliver) start
+ * ^o -> (deliver) start
* <> -> (deliver) start
* k -> (deliver) start
*
@@ -547,6 +603,8 @@ KdInitTouchScreen(KdTsFuncs *pTsFuncs)
* ^2 -> (release) (deliver) button_1_down
* v3 -> (cleartimeout) (generate v2) synthetic_2_down_13
* ^3 -> (release) (deliver) button_1_down
+ * vo -> (release) (deliver) button_1_down
+ * ^o -> (release) (deliver) button_1_down
* <-> -> (release) (deliver) button_1_down
* <> -> (deliver) button_1_pend
* k -> (release) (deliver) button_1_down
@@ -558,6 +616,8 @@ KdInitTouchScreen(KdTsFuncs *pTsFuncs)
* ^2 -> (deliver) button_1_down
* v3 -> (deliver) button_1_down
* ^3 -> (deliver) button_1_down
+ * vo -> (deliver) button_1_down
+ * ^o -> (deliver) button_1_down
* <> -> (deliver) button_1_down
* k -> (deliver) button_1_down
*
@@ -567,6 +627,8 @@ KdInitTouchScreen(KdTsFuncs *pTsFuncs)
* ^2 -> (deliver) start
* v3 -> (deliver) button_2_down
* ^3 -> (deliver) button_2_down
+ * vo -> (deliver) button_2_down
+ * ^o -> (deliver) button_2_down
* <> -> (deliver) button_2_down
* k -> (deliver) button_2_down
*
@@ -576,6 +638,8 @@ KdInitTouchScreen(KdTsFuncs *pTsFuncs)
* v2 -> (release) (deliver) button_3_down
* ^2 -> (release) (deliver) button_3_down
* ^3 -> (release) (deliver) start
+ * vo -> (release) (deliver) button_3_down
+ * ^o -> (release) (deliver) button_3_down
* <-> -> (release) (deliver) button_3_down
* <> -> (deliver) button_3_pend
* k -> (release) (deliver) button_3_down
@@ -587,6 +651,8 @@ KdInitTouchScreen(KdTsFuncs *pTsFuncs)
* v2 -> (deliver) button_3_down
* ^2 -> (deliver) button_3_down
* ^3 -> (deliver) start
+ * vo -> (deliver) button_3_down
+ * ^o -> (deliver) button_3_down
* <> -> (deliver) button_3_down
* k -> (deliver) button_3_down
*
@@ -595,6 +661,8 @@ KdInitTouchScreen(KdTsFuncs *pTsFuncs)
* v2 -> synthetic_2_down_13
* ^2 -> synthetic_2_down_13
* ^3 -> (generate ^2) synthetic_2_down_1
+ * vo -> (deliver) synthetic_2_down_13
+ * ^o -> (deliver) synthetic_2_down_13
* <> -> (deliver) synthetic_2_down_13
* k -> (deliver) synthetic_2_down_13
*
@@ -604,6 +672,8 @@ KdInitTouchScreen(KdTsFuncs *pTsFuncs)
* v2 -> synthetic_2_down_3
* ^2 -> synthetic_2_down_3
* ^3 -> start
+ * vo -> (deliver) synthetic_2_down_3
+ * ^o -> (deliver) synthetic_2_down_3
* <> -> (deliver) synthetic_2_down_3
* k -> (deliver) synthetic_2_down_3
*
@@ -613,27 +683,17 @@ KdInitTouchScreen(KdTsFuncs *pTsFuncs)
* ^2 -> synthetic_2_down_1
* v3 -> (deliver) synthetic_2_down_1
* ^3 -> (deliver) synthetic_2_down_1
+ * vo -> (deliver) synthetic_2_down_1
+ * ^o -> (deliver) synthetic_2_down_1
* <> -> (deliver) synthetic_2_down_1
* k -> (deliver) synthetic_2_down_1
*/
-typedef enum _inputState {
- start,
- button_1_pend,
- button_1_down,
- button_2_down,
- button_3_pend,
- button_3_down,
- synth_2_down_13,
- synth_2_down_3,
- synth_2_down_1,
- num_input_states
-} KdInputState;
-
typedef enum _inputClass {
down_1, up_1,
down_2, up_2,
down_3, up_3,
+ down_o, up_o,
motion, outside_box,
keyboard, timeout,
num_input_class
@@ -654,7 +714,7 @@ typedef enum _inputAction {
typedef struct _inputTransition {
KdInputAction actions[MAX_ACTIONS];
- KdInputState nextState;
+ KdMouseState nextState;
} KdInputTransition;
KdInputTransition kdInputMachine[num_input_states][num_input_class] = {
@@ -666,9 +726,11 @@ KdInputTransition kdInputMachine[num_input_states][num_input_class] = {
{ { deliver, noop }, start }, /* ^2 */
{ { hold, setto }, button_3_pend }, /* v3 */
{ { deliver, noop }, start }, /* ^3 */
+ { { deliver, noop }, start }, /* vo */
+ { { deliver, noop }, start }, /* ^o */
{ { deliver, noop }, start }, /* <> */
{ { deliver, noop }, start }, /* <-> */
- { { deliver, noop }, start }, /* k */
+ { { noop, noop }, start }, /* k */
{ { noop, noop }, start }, /* ... */
},
/* button_1_pend */
@@ -679,9 +741,11 @@ KdInputTransition kdInputMachine[num_input_states][num_input_class] = {
{ { release, deliver }, button_1_down }, /* ^2 */
{ { clearto, gen_down_2 }, synth_2_down_13 }, /* v3 */
{ { release, deliver }, button_1_down }, /* ^3 */
+ { { release, deliver }, button_1_down }, /* vo */
+ { { release, deliver }, button_1_down }, /* ^o */
{ { deliver, noop }, button_1_pend }, /* <> */
{ { release, deliver }, button_1_down }, /* <-> */
- { { release, deliver }, button_1_down }, /* k */
+ { { noop, noop }, button_1_down }, /* k */
{ { release, noop }, button_1_down }, /* ... */
},
/* button_1_down */
@@ -692,9 +756,11 @@ KdInputTransition kdInputMachine[num_input_states][num_input_class] = {
{ { deliver, noop }, button_1_down }, /* ^2 */
{ { deliver, noop }, button_1_down }, /* v3 */
{ { deliver, noop }, button_1_down }, /* ^3 */
+ { { deliver, noop }, button_1_down }, /* vo */
+ { { deliver, noop }, button_1_down }, /* ^o */
{ { deliver, noop }, button_1_down }, /* <> */
{ { deliver, noop }, button_1_down }, /* <-> */
- { { deliver, noop }, button_1_down }, /* k */
+ { { noop, noop }, button_1_down }, /* k */
{ { noop, noop }, button_1_down }, /* ... */
},
/* button_2_down */
@@ -705,9 +771,11 @@ KdInputTransition kdInputMachine[num_input_states][num_input_class] = {
{ { deliver, noop }, start }, /* ^2 */
{ { deliver, noop }, button_2_down }, /* v3 */
{ { deliver, noop }, button_2_down }, /* ^3 */
+ { { deliver, noop }, button_2_down }, /* vo */
+ { { deliver, noop }, button_2_down }, /* ^o */
{ { deliver, noop }, button_2_down }, /* <> */
{ { deliver, noop }, button_2_down }, /* <-> */
- { { deliver, noop }, button_2_down }, /* k */
+ { { noop, noop }, button_2_down }, /* k */
{ { noop, noop }, button_2_down }, /* ... */
},
/* button_3_pend */
@@ -718,9 +786,11 @@ KdInputTransition kdInputMachine[num_input_states][num_input_class] = {
{ { release, deliver }, button_3_down }, /* ^2 */
{ { release, deliver }, button_3_down }, /* v3 */
{ { release, deliver }, start }, /* ^3 */
+ { { release, deliver }, button_3_down }, /* vo */
+ { { release, deliver }, button_3_down }, /* ^o */
{ { deliver, noop }, button_3_pend }, /* <> */
{ { release, deliver }, button_3_down }, /* <-> */
- { { release, deliver }, button_3_down }, /* k */
+ { { release, noop }, button_3_down }, /* k */
{ { release, noop }, button_3_down }, /* ... */
},
/* button_3_down */
@@ -731,9 +801,11 @@ KdInputTransition kdInputMachine[num_input_states][num_input_class] = {
{ { deliver, noop }, button_3_down }, /* ^2 */
{ { noop, noop }, button_3_down }, /* v3 */
{ { deliver, noop }, start }, /* ^3 */
+ { { deliver, noop }, button_3_down }, /* vo */
+ { { deliver, noop }, button_3_down }, /* ^o */
{ { deliver, noop }, button_3_down }, /* <> */
{ { deliver, noop }, button_3_down }, /* <-> */
- { { deliver, noop }, button_3_down }, /* k */
+ { { noop, noop }, button_3_down }, /* k */
{ { noop, noop }, button_3_down }, /* ... */
},
/* synthetic_2_down_13 */
@@ -744,9 +816,11 @@ KdInputTransition kdInputMachine[num_input_states][num_input_class] = {
{ { noop, noop }, synth_2_down_13 }, /* ^2 */
{ { noop, noop }, synth_2_down_13 }, /* v3 */
{ { gen_up_2, noop }, synth_2_down_1 }, /* ^3 */
+ { { deliver, noop }, synth_2_down_13 }, /* vo */
+ { { deliver, noop }, synth_2_down_13 }, /* ^o */
{ { deliver, noop }, synth_2_down_13 }, /* <> */
{ { deliver, noop }, synth_2_down_13 }, /* <-> */
- { { deliver, noop }, synth_2_down_13 }, /* k */
+ { { noop, noop }, synth_2_down_13 }, /* k */
{ { noop, noop }, synth_2_down_13 }, /* ... */
},
/* synthetic_2_down_3 */
@@ -757,9 +831,11 @@ KdInputTransition kdInputMachine[num_input_states][num_input_class] = {
{ { deliver, noop }, synth_2_down_3 }, /* ^2 */
{ { noop, noop }, synth_2_down_3 }, /* v3 */
{ { noop, noop }, start }, /* ^3 */
+ { { deliver, noop }, synth_2_down_3 }, /* vo */
+ { { deliver, noop }, synth_2_down_3 }, /* ^o */
{ { deliver, noop }, synth_2_down_3 }, /* <> */
{ { deliver, noop }, synth_2_down_3 }, /* <-> */
- { { deliver, noop }, synth_2_down_3 }, /* k */
+ { { noop, noop }, synth_2_down_3 }, /* k */
{ { noop, noop }, synth_2_down_3 }, /* ... */
},
/* synthetic_2_down_1 */
@@ -770,41 +846,40 @@ KdInputTransition kdInputMachine[num_input_states][num_input_class] = {
{ { deliver, noop }, synth_2_down_1 }, /* ^2 */
{ { deliver, noop }, synth_2_down_1 }, /* v3 */
{ { deliver, noop }, synth_2_down_1 }, /* ^3 */
+ { { deliver, noop }, synth_2_down_1 }, /* vo */
+ { { deliver, noop }, synth_2_down_1 }, /* ^o */
{ { deliver, noop }, synth_2_down_1 }, /* <> */
{ { deliver, noop }, synth_2_down_1 }, /* <-> */
- { { deliver, noop }, synth_2_down_1 }, /* k */
+ { { noop, noop }, synth_2_down_1 }, /* k */
{ { noop, noop }, synth_2_down_1 }, /* ... */
},
};
-Bool kdEventHeld;
-xEvent kdHeldEvent;
-int kdEmulationDx, kdEmulationDy;
-
#define EMULATION_WINDOW 10
#define EMULATION_TIMEOUT 100
#define EventX(e) ((e)->u.keyButtonPointer.rootX)
#define EventY(e) ((e)->u.keyButtonPointer.rootY)
-KdInsideEmulationWindow (xEvent *ev)
+int
+KdInsideEmulationWindow (KdMouseInfo *mi, xEvent *ev)
{
if (ev->u.keyButtonPointer.pad1)
{
- kdEmulationDx += EventX(ev);
- kdEmulationDy += EventY(ev);
+ mi->emulationDx += EventX(ev);
+ mi->emulationDy += EventY(ev);
}
else
{
- kdEmulationDx = EventX(&kdHeldEvent) - EventX(ev);
- kdEmulationDy = EventY(&kdHeldEvent) - EventY(ev);
+ mi->emulationDx = EventX(&mi->heldEvent) - EventX(ev);
+ mi->emulationDy = EventY(&mi->heldEvent) - EventY(ev);
}
- return (abs (kdEmulationDx) < EMULATION_WINDOW &&
- abs (kdEmulationDy) < EMULATION_WINDOW);
+ return (abs (mi->emulationDx) < EMULATION_WINDOW &&
+ abs (mi->emulationDy) < EMULATION_WINDOW);
}
KdInputClass
-KdClassifyInput (xEvent *ev)
+KdClassifyInput (KdMouseInfo *mi, xEvent *ev)
{
switch (ev->u.u.type) {
case ButtonPress:
@@ -812,6 +887,7 @@ KdClassifyInput (xEvent *ev)
case 1: return down_1;
case 2: return down_2;
case 3: return down_3;
+ default: return down_o;
}
break;
case ButtonRelease:
@@ -819,16 +895,18 @@ KdClassifyInput (xEvent *ev)
case 1: return up_1;
case 2: return up_2;
case 3: return up_3;
+ default: return up_o;
}
break;
case MotionNotify:
- if (kdEventHeld && !KdInsideEmulationWindow(ev))
+ if (mi->eventHeld && !KdInsideEmulationWindow(mi, ev))
return outside_box;
else
return motion;
default:
return keyboard;
}
+ return keyboard;
}
#ifndef NDEBUG
@@ -892,44 +970,42 @@ KdQueueEvent (xEvent *ev)
}
}
-KdInputState kdInputState;
-
static void
-KdRunInputMachine (KdInputClass c, xEvent *ev)
+KdRunMouseMachine (KdMouseInfo *mi, KdInputClass c, xEvent *ev)
{
KdInputTransition *t;
int a;
- t = &kdInputMachine[kdInputState][c];
+ t = &kdInputMachine[mi->mouseState][c];
for (a = 0; a < MAX_ACTIONS; a++)
{
switch (t->actions[a]) {
case noop:
break;
case hold:
- kdEventHeld = TRUE;
- kdEmulationDx = 0;
- kdEmulationDy = 0;
- kdHeldEvent = *ev;
+ mi->eventHeld = TRUE;
+ mi->emulationDx = 0;
+ mi->emulationDy = 0;
+ mi->heldEvent = *ev;
break;
case setto:
- kdEmulationTimeout = GetTimeInMillis () + EMULATION_TIMEOUT;
- kdTimeoutPending = TRUE;
+ mi->emulationTimeout = GetTimeInMillis () + EMULATION_TIMEOUT;
+ mi->timeoutPending = TRUE;
break;
case deliver:
KdQueueEvent (ev);
break;
case release:
- kdEventHeld = FALSE;
- kdTimeoutPending = FALSE;
- KdQueueEvent (&kdHeldEvent);
+ mi->eventHeld = FALSE;
+ mi->timeoutPending = FALSE;
+ KdQueueEvent (&mi->heldEvent);
break;
case clearto:
- kdTimeoutPending = FALSE;
+ mi->timeoutPending = FALSE;
break;
case gen_down_2:
ev->u.u.detail = 2;
- kdEventHeld = FALSE;
+ mi->eventHeld = FALSE;
KdQueueEvent (ev);
break;
case gen_up_2:
@@ -938,29 +1014,34 @@ KdRunInputMachine (KdInputClass c, xEvent *ev)
break;
}
}
- kdInputState = t->nextState;
+ mi->mouseState = t->nextState;
}
void
KdResetInputMachine (void)
{
- kdInputState = start;
- kdEventHeld = FALSE;
+ KdMouseInfo *mi;
+
+ for (mi = kdMouseInfo; mi; mi = mi->next)
+ {
+ mi->mouseState = start;
+ mi->eventHeld = FALSE;
+ }
}
void
-KdHandleEvent (xEvent *ev)
+KdHandleMouseEvent (KdMouseInfo *mi, xEvent *ev)
{
- if (kdEmulateMiddleButton)
- KdRunInputMachine (KdClassifyInput (ev), ev);
+ if (mi->emulateMiddleButton)
+ KdRunMouseMachine (mi, KdClassifyInput (mi, ev), ev);
else
KdQueueEvent (ev);
}
void
-KdReceiveTimeout (void)
+KdReceiveTimeout (KdMouseInfo *mi)
{
- KdRunInputMachine (timeout, 0);
+ KdRunMouseMachine (mi, timeout, 0);
}
#define KILL_SEQUENCE ((1L << KK_CONTROL)|(1L << KK_ALT)|(1L << KK_F8)|(1L << KK_F10))
@@ -990,7 +1071,7 @@ extern int nClients;
void
KdCheckSpecialKeys(xEvent *xE)
{
- KeySym sym;
+ KeySym sym = KEYCOL1(xE->u.u.detail);
if (!pKdKeyboard) return;
@@ -999,7 +1080,25 @@ KdCheckSpecialKeys(xEvent *xE)
*/
if (xE->u.u.type == KeyRelease) return;
-
+
+#ifdef XIPAQ
+ /*
+ * Check for buttons 1, 2 and 3 on the iPAQ
+ */
+ if (sym == XK_Pointer_Button1 && kdMouseInfo) {
+ KdEnqueueMouseEvent(kdMouseInfo, KD_MOUSE_DELTA | KD_BUTTON_1, 0, 0);
+ return;
+ }
+ if (sym == XK_Pointer_Button2 && kdMouseInfo) {
+ KdEnqueueMouseEvent(kdMouseInfo, KD_MOUSE_DELTA | KD_BUTTON_2, 0, 0);
+ return;
+ }
+ if (sym == XK_Pointer_Button3 && kdMouseInfo) {
+ KdEnqueueMouseEvent(kdMouseInfo, KD_MOUSE_DELTA | KD_BUTTON_3, 0, 0);
+ return;
+ }
+#endif
+
/*
* Check for control/alt pressed
*/
@@ -1007,7 +1106,6 @@ KdCheckSpecialKeys(xEvent *xE)
(ControlMask|Mod1Mask))
return;
- sym = KEYCOL1(xE->u.u.detail);
/*
* Let OS function see keysym first
@@ -1046,9 +1144,10 @@ KdCheckSpecialKeys(xEvent *xE)
void
KdHandleKeyboardEvent (xEvent *ev)
{
- int key = ev->u.u.detail;
- int byte;
- CARD8 bit;
+ int key = ev->u.u.detail;
+ int byte;
+ CARD8 bit;
+ KdMouseInfo *mi;
byte = key >> 3;
bit = 1 << (key & 7);
@@ -1060,7 +1159,9 @@ KdHandleKeyboardEvent (xEvent *ev)
kdKeyState[byte] &= ~bit;
break;
}
- KdHandleEvent (ev);
+ for (mi = kdMouseInfo; mi; mi = mi->next)
+ KdRunMouseMachine (mi, keyboard, 0);
+ KdQueueEvent (ev);
}
void
@@ -1069,16 +1170,16 @@ KdReleaseAllKeys (void)
xEvent xE;
int key;
+ KdBlockSigio ();
for (key = 0; key < KD_KEY_COUNT; key++)
if (IsKeyDown(key))
{
xE.u.keyButtonPointer.time = GetTimeInMillis();
xE.u.u.type = KeyRelease;
xE.u.u.detail = key;
- KdBlockSigio ();
KdHandleKeyboardEvent (&xE);
- KdUnblockSigio ();
}
+ KdUnblockSigio ();
}
void
@@ -1155,31 +1256,34 @@ KdEnqueueKeyboardEvent(unsigned char scan_code,
{
return;
}
+ /*
+ * X delivers press/release even for autorepeat
+ */
+ xE.u.u.type = KeyRelease;
+ KdHandleKeyboardEvent (&xE);
+ xE.u.u.type = KeyPress;
}
-#if 0
- if (xE.u.u.type == KeyRelease && !IsKeyDown (key_code))
+ /*
+ * Check released keys which are already up
+ */
+ else if (!IsKeyDown (key_code) && xE.u.u.type == KeyRelease)
{
- xE.u.u.type = KeyPress;
- KdHandleKeyboardEvent (&xE);
- xE.u.u.type = KeyRelease;
+ return;
}
-#endif
KdCheckSpecialKeys (&xE);
KdHandleKeyboardEvent (&xE);
}
}
-#define SetButton(b,v, s) \
+#define SetButton(mi, b, v, s) \
{\
- xE.u.u.detail = b; \
+ xE.u.u.detail = mi->map[b]; \
xE.u.u.type = v; \
- KdHandleEvent (&xE); \
+ KdHandleMouseEvent (mi, &xE); \
}
-#define Press(b) SetButton(b+1,ButtonPress,"Down")
-#define Release(b) SetButton(b+1,ButtonRelease,"Up")
-
-static unsigned char kdButtonState = 0;
+#define Press(mi, b) SetButton(mi, b, ButtonPress, "Down")
+#define Release(mi, b) SetButton(mi, b, ButtonRelease, "Up")
/*
* kdEnqueueMouseEvent
@@ -1201,13 +1305,15 @@ KdMouseAccelerate (DeviceIntPtr device, int delta)
}
void
-KdEnqueueMouseEvent(unsigned long flags, int rx, int ry)
+KdEnqueueMouseEvent(KdMouseInfo *mi, unsigned long flags, int rx, int ry)
{
- CARD32 ms;
- xEvent xE;
- unsigned char buttons;
- int x, y;
- int (*matrix)[3] = kdMouseMatrix.matrix;
+ CARD32 ms;
+ xEvent xE;
+ unsigned char buttons;
+ int x, y;
+ int (*matrix)[3] = kdMouseMatrix.matrix;
+ unsigned long button;
+ int n;
if (!pKdPointer)
return;
@@ -1234,48 +1340,29 @@ KdEnqueueMouseEvent(unsigned long flags, int rx, int ry)
xE.u.u.type = MotionNotify;
xE.u.u.detail = 0;
- KdHandleEvent (&xE);
+ KdHandleMouseEvent (mi, &xE);
buttons = flags;
- if ((kdButtonState & KD_BUTTON_1) ^ (buttons & KD_BUTTON_1))
- {
- if (buttons & KD_BUTTON_1)
- {
- Press(0);
- }
- else
- {
- Release(0);
- }
- }
- if ((kdButtonState & KD_BUTTON_2) ^ (buttons & KD_BUTTON_2))
- {
- if (buttons & KD_BUTTON_2)
- {
- Press(1);
- }
- else
- {
- Release(1);
- }
- }
- if ((kdButtonState & KD_BUTTON_3) ^ (buttons & KD_BUTTON_3))
+ for (button = KD_BUTTON_1, n = 0; button <= KD_BUTTON_5; button <<= 1, n++)
{
- if (buttons & KD_BUTTON_3)
- {
- Press(2);
- }
- else
+ if ((mi->buttonState & button) ^ (buttons & button))
{
- Release(2);
+ if (buttons & button)
+ {
+ Press(mi, n);
+ }
+ else
+ {
+ Release(mi, n);
+ }
}
}
- kdButtonState = buttons;
+ mi->buttonState = buttons;
}
void
-KdEnqueueMotionEvent (int x, int y)
+KdEnqueueMotionEvent (KdMouseInfo *mi, int x, int y)
{
xEvent xE;
CARD32 ms;
@@ -1287,7 +1374,7 @@ KdEnqueueMotionEvent (int x, int y)
xE.u.keyButtonPointer.rootX = x;
xE.u.keyButtonPointer.rootY = y;
- KdHandleEvent (&xE);
+ KdHandleMouseEvent (mi, &xE);
}
void
@@ -1296,29 +1383,19 @@ KdBlockHandler (int screen,
pointer timeout,
pointer readmask)
{
- struct timeval **pTimeout = timeout;
+ KdMouseInfo *mi;
- if (kdTimeoutPending)
+ for (mi = kdMouseInfo; mi; mi = mi->next)
{
- static struct timeval tv;
- int ms;
-
- ms = kdEmulationTimeout - GetTimeInMillis ();
- if (ms < 0)
- ms = 0;
- tv.tv_sec = ms / 1000;
- tv.tv_usec = (ms % 1000) * 1000;
- if (*pTimeout)
+ if (mi->timeoutPending)
{
- if ((*pTimeout)->tv_sec > tv.tv_sec ||
- ((*pTimeout)->tv_sec == tv.tv_sec &&
- (*pTimeout)->tv_usec > tv.tv_usec))
- {
- *pTimeout = &tv;
- }
+ int ms;
+
+ ms = mi->emulationTimeout - GetTimeInMillis ();
+ if (ms < 0)
+ ms = 0;
+ AdjustWaitForDelay (timeout, ms);
}
- else
- *pTimeout = &tv;
}
}
@@ -1328,109 +1405,149 @@ KdWakeupHandler (int screen,
unsigned long lresult,
pointer readmask)
{
- int result = (int) lresult;
- fd_set *pReadmask = (fd_set *) readmask;
+ int result = (int) lresult;
+ fd_set *pReadmask = (fd_set *) readmask;
+ int i;
+ KdMouseInfo *mi;
if (kdInputEnabled && result > 0)
{
- if (kdMouseFd >= 0 && FD_ISSET (kdMouseFd, pReadmask))
- {
- KdBlockSigio ();
- (*kdMouseFuncs->Read) (kdMouseFd);
- KdUnblockSigio ();
- }
-#ifdef TOUCHSCREEN
- if (kdTsFd >= 0 && FD_ISSET (kdTsFd, pReadmask))
- {
- KdBlockSigio ();
- (*kdTsFuncs->Read) (kdTsFd);
- KdUnblockSigio ();
- }
-#endif
- if (kdKeyboardFd >= 0 && FD_ISSET (kdKeyboardFd, pReadmask))
- {
- KdBlockSigio ();
- (*kdKeyboardFuncs->Read) (kdKeyboardFd);
- KdUnblockSigio ();
- }
+ for (i = 0; i < kdNumInputFds; i++)
+ if (FD_ISSET (kdInputFds[i].fd, pReadmask))
+ {
+ KdBlockSigio ();
+ (*kdInputFds[i].read) (kdInputFds[i].fd, kdInputFds[i].closure);
+ KdUnblockSigio ();
+ }
}
- if (kdTimeoutPending)
+ for (mi = kdMouseInfo; mi; mi = mi->next)
{
- if ((long) (GetTimeInMillis () - kdEmulationTimeout) >= 0)
+ if (mi->timeoutPending)
{
- kdTimeoutPending = FALSE;
- KdBlockSigio ();
- KdReceiveTimeout ();
- KdUnblockSigio ();
+ if ((long) (GetTimeInMillis () - mi->emulationTimeout) >= 0)
+ {
+ mi->timeoutPending = FALSE;
+ KdBlockSigio ();
+ KdReceiveTimeout (mi);
+ KdUnblockSigio ();
+ }
}
}
if (kdSwitchPending)
KdProcessSwitch ();
}
+#define KdScreenOrigin(pScreen) (&(KdGetScreenPriv(pScreen)->screen->origin))
+
static Bool
KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
{
ScreenPtr pScreen = *ppScreen;
+ ScreenPtr pNewScreen;
int n;
+ int dx, dy;
+ int best_x, best_y;
+ int n_best_x, n_best_y;
CARD32 ms;
if (kdDisableZaphod || screenInfo.numScreens <= 1)
return FALSE;
- if (*x < 0 || *y < 0)
- {
- ms = GetTimeInMillis ();
- if (kdOffScreen && (int) (ms - kdOffScreenTime) < 1000)
- return FALSE;
- kdOffScreen = TRUE;
- kdOffScreenTime = ms;
+
+ if (0 <= *x && *x < pScreen->width && 0 <= *y && *y < pScreen->height)
+ return FALSE;
- n = pScreen->myNum - 1;
- if (n < 0)
- n = screenInfo.numScreens - 1;
- pScreen = screenInfo.screens[n];
+ ms = GetTimeInMillis ();
+ if (kdOffScreen && (int) (ms - kdOffScreenTime) < 1000)
+ return FALSE;
+ kdOffScreen = TRUE;
+ kdOffScreenTime = ms;
+ n_best_x = -1;
+ best_x = 32767;
+ n_best_y = -1;
+ best_y = 32767;
+ for (n = 0; n < screenInfo.numScreens; n++)
+ {
+ pNewScreen = screenInfo.screens[n];
+ if (pNewScreen == pScreen)
+ continue;
+ dx = KdScreenOrigin(pNewScreen)->x - KdScreenOrigin(pScreen)->x;
+ dy = KdScreenOrigin(pNewScreen)->y - KdScreenOrigin(pScreen)->y;
if (*x < 0)
- *x += pScreen->width;
+ {
+ if (dx <= 0 && -dx < best_x)
+ {
+ best_x = -dx;
+ n_best_x = n;
+ }
+ }
+ else if (*x >= pScreen->width)
+ {
+ if (dx >= 0 && dx < best_x)
+ {
+ best_x = dx;
+ n_best_x = n;
+ }
+ }
if (*y < 0)
- *y += pScreen->height;
- *ppScreen = pScreen;
- return TRUE;
- }
- else if (*x >= pScreen->width || *y >= pScreen->height)
- {
- ms = GetTimeInMillis ();
- if (kdOffScreen && (int) (ms - kdOffScreenTime) < 1000)
- return FALSE;
- kdOffScreen = TRUE;
- kdOffScreenTime = ms;
-
- n = pScreen->myNum + 1;
- if (n >= screenInfo.numScreens)
- n = 0;
- if (*x >= pScreen->width)
- *x -= pScreen->width;
- if (*y >= pScreen->height)
- *y -= pScreen->height;
- pScreen = screenInfo.screens[n];
- *ppScreen = pScreen;
- return TRUE;
+ {
+ if (dy <= 0 && -dy < best_y)
+ {
+ best_y = -dy;
+ n_best_y = n;
+ }
+ }
+ else if (*y >= pScreen->height)
+ {
+ if (dy >= 0 && dy < best_y)
+ {
+ best_y = dy;
+ n_best_y = n;
+ }
+ }
}
- return FALSE;
+ if (best_y < best_x)
+ n_best_x = n_best_y;
+ if (n_best_x == -1)
+ return FALSE;
+ pNewScreen = screenInfo.screens[n_best_x];
+
+ if (*x < 0)
+ *x += pNewScreen->width;
+ if (*y < 0)
+ *y += pNewScreen->height;
+
+ if (*x >= pScreen->width)
+ *x -= pScreen->width;
+ if (*y >= pScreen->height)
+ *y -= pScreen->height;
+
+ *ppScreen = pNewScreen;
+ return TRUE;
}
static void
KdCrossScreen(ScreenPtr pScreen, Bool entering)
{
+#ifndef XIPAQ
if (entering)
KdEnableScreen (pScreen);
else
KdDisableScreen (pScreen);
+#endif
}
+#ifdef TOUCHSCREEN
+/* HACK! */
+extern int TsScreen;
+#endif
+
static void
KdWarpCursor (ScreenPtr pScreen, int x, int y)
{
KdBlockSigio ();
+#ifdef TOUCHSCREEN
+ TsScreen = pScreen->myNum;
+#endif
miPointerWarpCursor (pScreen, x, y);
KdUnblockSigio ();
}
@@ -1445,7 +1562,7 @@ miPointerScreenFuncRec kdPointerScreenFuncs =
void
ProcessInputEvents ()
{
- (void)mieqProcessInputEvents();
+ mieqProcessInputEvents();
miPointerUpdate();
if (kdSwitchPending)
KdProcessSwitch ();
diff --git a/programs/Xserver/hw/xfree86/CHANGELOG b/programs/Xserver/hw/xfree86/CHANGELOG
index e0e6a8551..fa5aff2d6 100644
--- a/programs/Xserver/hw/xfree86/CHANGELOG
+++ b/programs/Xserver/hw/xfree86/CHANGELOG
@@ -2,6 +2,10 @@ XFree86 4.215.195.201 (Upon next dawn of time)
xxx. See http://www.xfree86.org/devel/archives/devel/2001-Nov/0130.shtml
(Marc La France).
+XFree86 4.2.0 (18 January 2002)
+ 690. Workaround for hardware bug that prevents older ATI 3D Rage adapters from
+ being assigned to XF86Config device sections (Marc La France).
+
XFree86 4.1.99.7 (16 January 2002)
689. Fix bug introduced in snapshot 4.1.99.5 causing XDarwin's PseudoramiX
extension to always be disabled (Torrey T. Lyons).
@@ -14555,4 +14559,4 @@ XFree86 3.0a (28 April 1994)
XFree86 3.0 (26 April 1994)
-$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.2066.2.9 2002/01/16 21:50:20 tsi Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.2066.2.10 2002/01/18 22:14:32 tsi Exp $
diff --git a/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c b/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c
index a7be22b9a..ef356da4c 100644
--- a/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c
+++ b/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c,v 1.53.2.2 2002/01/02 19:58:20 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c,v 1.53.2.3 2002/01/18 22:14:53 tsi Exp $ */
/*
* Copyright 1999 through 2002 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
@@ -1626,7 +1626,7 @@ ATIPreInit
HDisplay = pATIHW->crt[0] + 5 - pATI->LCDHBlankWidth;
VDisplay = (((pATIHW->crt[7] << 4) & 0x0200U) |
((pATIHW->crt[7] << 8) & 0x0100U) |
- pATIHW->crt[6]) + 2 - pATI->LCDVBlankWidth;
+ pATIHW->crt[6]) + 3 - pATI->LCDVBlankWidth;
pATI->LCDHSyncStart =
((pATIHW->crt[4] - pATIHW->crt[2]) & 0xFFU) + 1;
diff --git a/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c b/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c
index bbd654371..3d82f4f91 100644
--- a/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c
+++ b/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c,v 1.51 2002/01/16 16:22:27 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c,v 1.50.2.1 2002/01/18 22:14:54 tsi Exp $ */
/*
* Copyright 1997 through 2002 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
@@ -2108,9 +2108,11 @@ NoVGAWonder:;
* value in the case of Mach64 adapters whose ChipID is
* unrecognised.
*/
+ pVideo = pATI->PCIInfo;
if (pGDev->chipID >= 0)
{
- if (pATI->ChipType != pGDev->chipID)
+ if ((pATI->ChipType != pGDev->chipID) &&
+ (!pVideo || (pGDev->chipID != pVideo->chipType)))
{
if ((pATI->Adapter != ATI_ADAPTER_MACH64) ||
(pATI->Chip != ATI_CHIP_Mach64))
@@ -2122,16 +2124,15 @@ NoVGAWonder:;
continue;
}
if ((pGDev->chipRev >= 0) &&
- (pATI->ChipRev != pGDev->chipRev))
+ (pATI->ChipRev != pGDev->chipRev) &&
+ (!pVideo || (pGDev->chipRev != pVideo->chipRev) ||
+ (pGDev->chipID != pVideo->chipType)))
{
- if (pATI->Adapter != ATI_ADAPTER_MACH64)
+ if (pATI->Chip < ATI_CHIP_264CT)
continue;
if (pATI->Chip != ATI_CHIP_Mach64)
{
- if (pATI->ChipRev == pATI->ChipRevision)
- continue;
-
/*
* There are two foundry codes for UMC. Some
* adapters will advertise one in CONFIG_CHIP_ID