summaryrefslogtreecommitdiff
path: root/hw/xfree86/common
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2007-03-28 08:08:04 -0700
committerIan Romanick <idr@us.ibm.com>2007-03-28 08:08:04 -0700
commit2c6d47108880584f1221ff86c6c8947627f9f607 (patch)
tree64a042f58df056433c430fb0c99735d9e8c0904d /hw/xfree86/common
parentc4fe1bcce1c1e4822e688959b331b47a051d6e0a (diff)
parent85220446359a75ea2c359b418b4051c04eea739c (diff)
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework
Conflicts: hw/xfree86/Makefile.am hw/xfree86/dri/dri.c
Diffstat (limited to 'hw/xfree86/common')
-rw-r--r--hw/xfree86/common/xf86Bus.c31
-rw-r--r--hw/xfree86/common/xf86Bus.h3
-rw-r--r--hw/xfree86/common/xf86Config.c30
-rw-r--r--hw/xfree86/common/xf86Config.h1
-rw-r--r--hw/xfree86/common/xf86Configure.c2
-rw-r--r--hw/xfree86/common/xf86DGA.c180
-rw-r--r--hw/xfree86/common/xf86Events.c4
-rw-r--r--hw/xfree86/common/xf86Globals.c1
-rw-r--r--hw/xfree86/common/xf86Helper.c13
-rw-r--r--hw/xfree86/common/xf86Init.c1
-rw-r--r--hw/xfree86/common/xf86Mode.c10
-rw-r--r--hw/xfree86/common/xf86Priv.h2
-rw-r--r--hw/xfree86/common/xf86XKB.c2
-rw-r--r--hw/xfree86/common/xf86Xinput.c46
-rw-r--r--hw/xfree86/common/xf86Xinput.h8
-rw-r--r--hw/xfree86/common/xf86fbman.c2
-rw-r--r--hw/xfree86/common/xf86xv.c2
17 files changed, 228 insertions, 110 deletions
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 86ad0182d..686e1eeac 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -1796,6 +1796,15 @@ convertRange2Host(int entityIndex, resRange *pRange)
}
}
+static void
+xf86ConvertListToHost(int entityIndex, resPtr list)
+{
+ while (list) {
+ convertRange2Host(entityIndex, &list->val);
+ list = list->next;
+ }
+}
+
/*
* xf86RegisterResources() -- attempts to register listed resources.
* If list is NULL it tries to obtain resources implicitly. Function
@@ -2835,18 +2844,7 @@ xf86IsSubsetOf(resRange range, resPtr list)
return ret;
}
-Bool
-xf86IsListSubsetOf(resPtr list, resPtr BaseList)
-{
- while (list) {
- if (! xf86IsSubsetOf(list->val,BaseList))
- return FALSE;
- list = list->next;
- }
- return TRUE;
-}
-
-resPtr
+static resPtr
findIntersect(resRange Range, resPtr list)
{
resRange range;
@@ -3070,15 +3068,6 @@ xf86NoSharedResources(int screenIndex,resType res)
return TRUE;
}
-void
-xf86ConvertListToHost(int entityIndex, resPtr list)
-{
- while (list) {
- convertRange2Host(entityIndex, &list->val);
- list = list->next;
- }
-}
-
_X_EXPORT void
xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg)
{
diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h
index f1fc627b9..5ea5cc8e1 100644
--- a/hw/xfree86/common/xf86Bus.h
+++ b/hw/xfree86/common/xf86Bus.h
@@ -140,12 +140,9 @@ int xf86AllocateEntity(void);
BusType StringToBusType(const char* busID, const char **retID);
memType ChkConflict(resRange *rgp, resPtr res, xf86State state);
Bool xf86IsSubsetOf(resRange range, resPtr list);
-Bool xf86IsListSubsetOf(resPtr list, resPtr BaseList);
resPtr xf86ExtractTypeFromList(resPtr list, unsigned long type);
-resPtr findIntersect(resRange Range, resPtr list);
resPtr xf86FindIntersect(resRange Range, resPtr list);
void RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment,
Bool useEstimated);
-void xf86ConvertListToHost(int entityIndex, resPtr list);
#endif /* _XF86_BUS_H */
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 676392c04..986244557 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -76,7 +76,7 @@ extern DeviceAssocRec mouse_assoc;
#ifdef XKB
#undef XKB_IN_SERVER
#define XKB_IN_SERVER
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
#ifdef RENDER
@@ -539,25 +539,6 @@ xf86DriverlistFromCompile(void)
return driverlist;
}
-
-char **
-xf86InputDriverlistFromCompile(void)
-{
- static char **driverlist = NULL;
- static Bool generated = FALSE;
-
- /* This string is modified in-place */
- static char drivernames[] = IDRIVERS;
-
- if (!generated) {
- generated = TRUE;
- driverlist = GenerateDriverlist("input", drivernames);
- }
-
- return driverlist;
-}
-
-
/*
* xf86ConfigError --
* Print a READABLE ErrorMessage!!! All information that is
@@ -2506,17 +2487,8 @@ xf86HandleConfigFile(Bool autoconfig)
return CONFIG_OK;
}
-
-/* These make the equivalent parser functions visible to the common layer. */
-Bool
-xf86PathIsAbsolute(const char *path)
-{
- return (xf86pathIsAbsolute(path) != 0);
-}
-
Bool
xf86PathIsSafe(const char *path)
{
return (xf86pathIsSafe(path) != 0);
}
-
diff --git a/hw/xfree86/common/xf86Config.h b/hw/xfree86/common/xf86Config.h
index 0786ec6fe..3787ba21e 100644
--- a/hw/xfree86/common/xf86Config.h
+++ b/hw/xfree86/common/xf86Config.h
@@ -53,7 +53,6 @@ char ** xf86ModulelistFromConfig(pointer **);
char ** xf86DriverlistFromConfig(void);
char ** xf86DriverlistFromCompile(void);
char ** xf86InputDriverlistFromConfig(void);
-char ** xf86InputDriverlistFromCompile(void);
Bool xf86BuiltinInputDriver(const char *);
ConfigStatus xf86HandleConfigFile(Bool);
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 741e46b5b..0b7297511 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -69,7 +69,7 @@ static int nDevToConfig = 0, CurrentDriver;
_X_EXPORT xf86MonPtr ConfiguredMonitor;
Bool xf86DoConfigurePass1 = TRUE;
-Bool foundMouse = FALSE;
+static Bool foundMouse = FALSE;
#if defined(__UNIXOS2__)
#define DFLT_MOUSE_DEV "mouse$"
diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
index 204457fb1..43db1ee1a 100644
--- a/hw/xfree86/common/xf86DGA.c
+++ b/hw/xfree86/common/xf86DGA.c
@@ -43,7 +43,7 @@
#include "servermd.h"
#include "micmap.h"
#ifdef XKB
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
#include "xf86Xinput.h"
@@ -51,11 +51,14 @@
static unsigned long DGAGeneration = 0;
static int DGAScreenIndex = -1;
+static int mieq_installed = 0;
static Bool DGACloseScreen(int i, ScreenPtr pScreen);
static void DGADestroyColormap(ColormapPtr pmap);
static void DGAInstallColormap(ColormapPtr pmap);
static void DGAUninstallColormap(ColormapPtr pmap);
+static void DGAHandleEvent(int screen_num, xEvent *event,
+ DeviceIntPtr device, int nevents);
static void
DGACopyModeInfo(
@@ -96,7 +99,6 @@ typedef struct {
Bool grabKeyboard;
} DGAScreenRec, *DGAScreenPtr;
-
_X_EXPORT Bool
DGAInit(
ScreenPtr pScreen,
@@ -146,7 +148,6 @@ DGAInit(
modes[i].flags &= ~DGA_PIXMAP_AVAILABLE;
#endif
-
pScreen->devPrivates[DGAScreenIndex].ptr = (pointer)pScreenPriv;
pScreenPriv->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = DGACloseScreen;
@@ -157,11 +158,6 @@ DGAInit(
pScreenPriv->UninstallColormap = pScreen->UninstallColormap;
pScreen->UninstallColormap = DGAUninstallColormap;
- /*
- * This is now set in InitOutput().
- *
- pScrn->SetDGAMode = xf86SetDGAMode;
- */
return TRUE;
}
@@ -247,12 +243,22 @@ FreeMarkedVisuals(ScreenPtr pScreen)
}
}
-
static Bool
DGACloseScreen(int i, ScreenPtr pScreen)
{
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+ if (XDGAEventBase) {
+ OsBlockSignals();
+ ProcessInputEvents();
+ mieqSetHandler(*XDGAEventBase + MotionNotify, NULL);
+ mieqSetHandler(*XDGAEventBase + ButtonPress, NULL);
+ mieqSetHandler(*XDGAEventBase + ButtonRelease, NULL);
+ mieqSetHandler(*XDGAEventBase + KeyPress, NULL);
+ mieqSetHandler(*XDGAEventBase + KeyRelease, NULL);
+ OsReleaseSignals();
+ }
+
FreeMarkedVisuals(pScreen);
pScreen->CloseScreen = pScreenPriv->CloseScreen;
@@ -462,6 +468,15 @@ DGASetInputMode(int index, Bool keyboard, Bool mouse)
{
pScreenPriv->grabMouse = mouse;
pScreenPriv->grabKeyboard = keyboard;
+
+ if (!mieq_installed) {
+ mieqSetHandler(*XDGAEventBase + MotionNotify, DGAHandleEvent);
+ mieqSetHandler(*XDGAEventBase + ButtonPress, DGAHandleEvent);
+ mieqSetHandler(*XDGAEventBase + ButtonRelease, DGAHandleEvent);
+ mieqSetHandler(*XDGAEventBase + KeyPress, DGAHandleEvent);
+ mieqSetHandler(*XDGAEventBase + KeyRelease, DGAHandleEvent);
+ mieq_installed = 1;
+ }
}
}
@@ -903,21 +918,93 @@ DGAVTSwitch(void)
return TRUE;
}
+Bool
+DGAStealKeyEvent(int index, int key_code, int is_down)
+{
+ DGAScreenPtr pScreenPriv;
+ dgaEvent de;
+
+ if(DGAScreenIndex < 0) /* no DGA */
+ return FALSE;
+
+ pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
-/* We have the power to steal or modify events that are about to get queued */
+ if(!pScreenPriv || !pScreenPriv->grabKeyboard) /* no direct mode */
+ return FALSE;
+
+ de.u.u.type = *XDGAEventBase + (is_down ? KeyPress : KeyRelease);
+ de.u.u.detail = key_code;
+ de.u.event.time = GetTimeInMillis();
+ mieqEnqueue (inputInfo.keyboard, (xEvent *) &de);
+
+ return TRUE;
+}
+
+static int DGAMouseX, DGAMouseY;
Bool
-DGAStealKeyEvent(int index, xEvent *e)
+DGAStealMotionEvent(int index, int dx, int dy)
{
-}
+ DGAScreenPtr pScreenPriv;
+ dgaEvent de;
-static int DGAMouseX, DGAMouseY;
+ if(DGAScreenIndex < 0) /* no DGA */
+ return FALSE;
+
+ pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ if(!pScreenPriv || !pScreenPriv->grabMouse) /* no direct mode */
+ return FALSE;
+
+ DGAMouseX += dx;
+ if (DGAMouseX < 0)
+ DGAMouseX = 0;
+ else if (DGAMouseX > screenInfo.screens[index]->width)
+ DGAMouseX = screenInfo.screens[index]->width;
+ DGAMouseY += dy;
+ if (DGAMouseY < 0)
+ DGAMouseY = 0;
+ else if (DGAMouseY > screenInfo.screens[index]->height)
+ DGAMouseY = screenInfo.screens[index]->height;
+ de.u.u.type = *XDGAEventBase + MotionNotify;
+ de.u.u.detail = 0;
+ de.u.event.time = GetTimeInMillis();
+ de.u.event.dx = dx;
+ de.u.event.dy = dy;
+ de.u.event.pad1 = DGAMouseX;
+ de.u.event.pad2 = DGAMouseY;
+ mieqEnqueue (inputInfo.pointer, (xEvent *) &de);
+ return TRUE;
+}
Bool
-DGAStealMouseEvent(int index, xEvent *e, int dx, int dy)
+DGAStealButtonEvent(int index, int button, int is_down)
{
+ DGAScreenPtr pScreenPriv;
+ dgaEvent de;
+
+ if (DGAScreenIndex < 0)
+ return FALSE;
+
+ pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ if (!pScreenPriv || !pScreenPriv->grabMouse)
+ return FALSE;
+
+ de.u.u.type = *XDGAEventBase + (is_down ? ButtonPress : ButtonRelease);
+ de.u.u.detail = button;
+ de.u.event.time = GetTimeInMillis();
+ de.u.event.dx = 0;
+ de.u.event.dy = 0;
+ de.u.event.pad1 = DGAMouseX;
+ de.u.event.pad2 = DGAMouseY;
+ mieqEnqueue (inputInfo.pointer, (xEvent *) &de);
+
+ return TRUE;
}
+/* We have the power to steal or modify events that are about to get queued */
+
Bool
DGAIsDgaEvent (xEvent *e)
{
@@ -1124,39 +1211,6 @@ DGAProcessPointerEvent (ScreenPtr pScreen, dgaEvent *de, DeviceIntPtr mouse)
}
}
-Bool
-DGADeliverEvent (ScreenPtr pScreen, xEvent *e)
-{
- dgaEvent *de = (dgaEvent *) e;
- DGAScreenPtr pScreenPriv;
- int coreEquiv;
-
- /* no DGA */
- if (DGAScreenIndex < 0 || XDGAEventBase == 0)
- return FALSE;
- pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
-
- /* DGA not initialized on this screen */
- if (!pScreenPriv)
- return FALSE;
-
- coreEquiv = de->u.u.type - *XDGAEventBase;
- /* Not a DGA event */
- if (coreEquiv < KeyPress || coreEquiv > MotionNotify)
- return FALSE;
-
- switch (coreEquiv) {
- case KeyPress:
- case KeyRelease:
- DGAProcessKeyboardEvent (pScreen, de, inputInfo.keyboard);
- break;
- default:
- DGAProcessPointerEvent (pScreen, de, inputInfo.pointer);
- break;
- }
- return TRUE;
-}
-
_X_EXPORT Bool
DGAOpenFramebuffer(
int index,
@@ -1215,3 +1269,35 @@ DGAGetOldDGAMode(int index)
return 0;
}
+static void
+DGAHandleEvent(int screen_num, xEvent *event, DeviceIntPtr device, int nevents)
+{
+ dgaEvent *de = (dgaEvent *) event;
+ ScreenPtr pScreen = screenInfo.screens[screen_num];
+ DGAScreenPtr pScreenPriv;
+ int coreEquiv;
+
+ /* no DGA */
+ if (DGAScreenIndex < 0 || XDGAEventBase == 0)
+ return;
+ pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+
+ /* DGA not initialized on this screen */
+ if (!pScreenPriv)
+ return;
+
+ coreEquiv = de->u.u.type - *XDGAEventBase;
+ /* Not a DGA event; shouldn't happen, but you never know. */
+ if (coreEquiv < KeyPress || coreEquiv > MotionNotify)
+ return;
+
+ switch (coreEquiv) {
+ case KeyPress:
+ case KeyRelease:
+ DGAProcessKeyboardEvent (pScreen, de, inputInfo.keyboard);
+ break;
+ default:
+ DGAProcessPointerEvent (pScreen, de, inputInfo.pointer);
+ break;
+ }
+}
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 05e62f184..3610c17c0 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -126,9 +126,9 @@ extern Bool noXkbExtension;
*/
#ifdef USE_VT_SYSREQ
-Bool VTSysreqToggle = FALSE;
+static Bool VTSysreqToggle = FALSE;
#endif /* !USE_VT_SYSREQ */
-Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for
+_X_EXPORT Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for
*BSD and for avoiding VT
switches when using the DRI
automatic full screen mode.*/
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index d81b5cc91..7dc45b75d 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -146,7 +146,6 @@ _X_EXPORT confDRIRec xf86ConfigDRI = {0, };
XF86ConfigPtr xf86configptr = NULL;
Bool xf86Resetting = FALSE;
Bool xf86Initialising = FALSE;
-Bool xf86ProbeFailed = FALSE;
Bool xf86DoProbe = FALSE;
Bool xf86DoConfigure = FALSE;
DriverPtr *xf86DriverList = NULL;
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 27a90c9a7..5353a5758 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -2986,3 +2986,16 @@ xf86IsUnblank(int mode)
return TRUE;
}
}
+
+_X_EXPORT void
+xf86MotionHistoryAllocate(LocalDevicePtr local)
+{
+ AllocateMotionHistory(local->dev);
+}
+
+_X_EXPORT int
+xf86GetMotionEvents(DeviceIntPtr pDev, xTimecoord *buff, unsigned long start,
+ unsigned long stop, ScreenPtr pScreen)
+{
+ return GetMotionHistory(pDev, buff, start, stop, pScreen);
+}
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index f824f6867..17cc06bb4 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -36,6 +36,7 @@
#endif
#include <stdlib.h>
+#include <errno.h>
#undef HAS_UTSNAME
#if !defined(WIN32) && !defined(__UNIXOS2__)
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index d5085b542..fc905dfac 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -368,6 +368,7 @@ xf86HandleBuiltinMode(ScrnInfoPtr scrp,
return MODE_OK;
}
+#if 0
/** Calculates the horizontal sync rate of a mode */
_X_EXPORT double
xf86ModeHSync(DisplayModePtr mode)
@@ -411,6 +412,7 @@ xf86SetModeDefaultName(DisplayModePtr mode)
mode->name = XNFprintf("%dx%d", mode->HDisplay, mode->VDisplay);
}
+#endif
/*
* xf86LookupMode
@@ -680,6 +682,7 @@ xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
}
+#if 0
/*
* xf86SetModeCrtc
*
@@ -733,7 +736,9 @@ xf86SetModeCrtc(DisplayModePtr p, int adjustFlags)
p->CrtcHAdjusted = FALSE;
p->CrtcVAdjusted = FALSE;
}
+#endif
+#if 0
/**
* Allocates and returns a copy of pMode, including pointers within pMode.
*/
@@ -814,6 +819,7 @@ xf86ModesEqual(DisplayModePtr pMode1, DisplayModePtr pMode2)
return FALSE;
}
}
+#endif
/*
* xf86CheckModeForMonitor
@@ -2040,6 +2046,7 @@ add(char **p, char *new)
strcat(*p, new);
}
+#if 0
_X_EXPORT void
xf86PrintModeline(int scrnIndex,DisplayModePtr mode)
{
@@ -2075,6 +2082,7 @@ xf86PrintModeline(int scrnIndex,DisplayModePtr mode)
mode->VTotal, flags);
xfree(flags);
}
+#endif
_X_EXPORT void
xf86PrintModes(ScrnInfoPtr scrp)
@@ -2145,6 +2153,7 @@ xf86PrintModes(ScrnInfoPtr scrp)
} while (p != NULL && p != scrp->modes);
}
+#if 0
/**
* Adds the new mode into the mode list, and returns the new list
*
@@ -2168,3 +2177,4 @@ xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new)
return modes;
}
+#endif
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index 60fd31ab8..274f7e754 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -102,7 +102,6 @@ extern int xf86NumModuleInfos;
extern int xf86NumDrivers;
extern Bool xf86Resetting;
extern Bool xf86Initialising;
-extern Bool xf86ProbeFailed;
extern int xf86NumScreens;
extern xf86CurrentAccessRec xf86CurrentAccess;
extern const char *xf86VisualNames[];
@@ -153,7 +152,6 @@ extern void xf86PostScreenInit(void);
/* xf86Config.c */
-Bool xf86PathIsAbsolute(const char *path);
Bool xf86PathIsSafe(const char *path);
/* xf86DefaultModes */
diff --git a/hw/xfree86/common/xf86XKB.c b/hw/xfree86/common/xf86XKB.c
index 399eb02d9..b805885bd 100644
--- a/hw/xfree86/common/xf86XKB.c
+++ b/hw/xfree86/common/xf86XKB.c
@@ -73,7 +73,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define XF86_OS_PRIVS
#include "xf86_OSlib.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
void
xf86InitXkb(void)
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 16e330d43..17ffed899 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -90,6 +90,10 @@
#include "mi.h"
+#ifdef XFreeXDGA
+#include "dgaproc.h"
+#endif
+
xEvent *xf86Events = NULL;
static Bool
@@ -128,6 +132,9 @@ xf86ProcessCommonOptions(LocalDevicePtr local,
} else {
xf86Msg(X_CONFIG, "%s: doesn't report drag events\n", local->name);
}
+
+ /* Backwards compatibility. */
+ local->history_size = GetMotionHistorySize();
}
/***********************************************************************
@@ -395,10 +402,12 @@ xf86PostMotionEvent(DeviceIntPtr device,
{
va_list var;
int i = 0, nevents = 0;
+ int dx, dy;
Bool drag = xf86SendDragEvents(device);
int *valuators = NULL;
int flags = 0;
xEvent *xE = NULL;
+ int index;
if (is_absolute)
flags = POINTER_ABSOLUTE;
@@ -412,6 +421,24 @@ xf86PostMotionEvent(DeviceIntPtr device,
valuators[i] = va_arg(var, int);
va_end(var);
+#if XFreeXDGA
+ if (first_valuator == 0 && num_valuators >= 2) {
+ if (miPointerGetScreen(inputInfo.pointer)) {
+ index = miPointerGetScreen(inputInfo.pointer)->myNum;
+ if (is_absolute) {
+ dx = valuators[0] - device->valuator->lastx;
+ dy = valuators[1] - device->valuator->lasty;
+ }
+ else {
+ dx = valuators[0];
+ dy = valuators[1];
+ }
+ if (DGAStealMotionEvent(index, dx, dy))
+ goto out;
+ }
+ }
+#endif
+
if (!xf86Events)
xf86Events = (xEvent *)xcalloc(sizeof(xEvent), GetMaximumEventsNum());
if (!xf86Events)
@@ -430,6 +457,7 @@ xf86PostMotionEvent(DeviceIntPtr device,
}
}
+out:
xfree(valuators);
}
@@ -476,6 +504,15 @@ xf86PostButtonEvent(DeviceIntPtr device,
va_list var;
int *valuators = NULL;
int i = 0, nevents = 0;
+ int index;
+
+#if XFreeXDGA
+ if (miPointerGetScreen(inputInfo.pointer)) {
+ index = miPointerGetScreen(inputInfo.pointer)->myNum;
+ if (DGAStealButtonEvent(index, button, is_down))
+ return;
+ }
+#endif
valuators = xcalloc(sizeof(int), num_valuators);
@@ -552,6 +589,15 @@ xf86PostKeyboardEvent(DeviceIntPtr device,
int is_down)
{
int nevents = 0, i = 0;
+ int index;
+
+#if XFreeXDGA
+ if (miPointerGetScreen(inputInfo.pointer)) {
+ index = miPointerGetScreen(inputInfo.pointer)->myNum;
+ if (DGAStealKeyEvent(index, key_code, is_down))
+ return;
+ }
+#endif
if (!xf86Events)
xf86Events = (xEvent *)xcalloc(sizeof(xEvent), GetMaximumEventsNum());
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
index fe65643ce..b2bc8dec1 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -86,6 +86,9 @@
#define XI_PRIVATE(dev) \
(((LocalDevicePtr)((dev)->public.devicePrivate))->private)
+/* Stupid API backwards-compatibility. */
+#define TS_Raw 60
+#define TS_Scaled 61
#ifdef XINPUT
/* This holds the input driver entry and module information. */
@@ -144,6 +147,7 @@ typedef struct _LocalDeviceRec {
InputDriverPtr drv;
pointer module;
pointer options;
+ unsigned int history_size;
} LocalDeviceRec, *LocalDevicePtr, InputInfoRec, *InputInfoPtr;
typedef struct _DeviceAssocRec
@@ -191,6 +195,10 @@ InputInfoPtr xf86AllocateInput(InputDriverPtr drv, int flags);
InputDriverPtr xf86LookupInputDriver(const char *name);
InputInfoPtr xf86LookupInput(const char *name);
void xf86DeleteInput(InputInfoPtr pInp, int flags);
+void xf86MotionHistoryAllocate(LocalDevicePtr local);
+int xf86GetMotionEvents(DeviceIntPtr dev, xTimecoord *buff,
+ unsigned long start, unsigned long stop,
+ ScreenPtr pScreen);
/* xf86Option.c */
void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c
index d64cfaee4..537d53d7d 100644
--- a/hw/xfree86/common/xf86fbman.c
+++ b/hw/xfree86/common/xf86fbman.c
@@ -968,7 +968,7 @@ localAllocateOffscreenLinear(
linear->size = h * w;
linear->offset = (pitch * area->box.y1) + area->box.x1;
if (gran > 1)
- linear->offset += ((linear->offset + gran - 1) / gran) * gran;
+ linear->offset = ((linear->offset + gran - 1) / gran) * gran;
linear->granularity = gran;
linear->MoveLinearCallback = moveCB;
linear->RemoveLinearCallback = removeCB;
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index 3e908b86a..2b097d2db 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -110,7 +110,7 @@ static void xf86XVAdjustFrame(int index, int x, int y, int flags);
static Bool xf86XVInitAdaptors(ScreenPtr, XF86VideoAdaptorPtr*, int);
-int XF86XVWindowIndex = -1;
+static int XF86XVWindowIndex = -1;
int XF86XvScreenIndex = -1;
static unsigned long XF86XVGeneration = 0;
static unsigned long PortResource = 0;