summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/dmx/Makefile.am10
-rw-r--r--hw/dmx/dmxclient.h4
-rw-r--r--hw/dmx/dmxcursor.c133
-rw-r--r--hw/dmx/dmxinput.c3
-rw-r--r--hw/dmx/dmxinput.h2
-rw-r--r--hw/dmx/input/dmxbackend.c18
-rw-r--r--hw/dmx/input/dmxevents.c267
-rw-r--r--hw/dmx/input/dmxinputinit.c113
-rw-r--r--hw/dmx/input/dmxxinput.c6
-rw-r--r--hw/dmx/input/lnx-keyboard.c12
-rw-r--r--hw/kdrive/ati/ati_dma.c2
-rw-r--r--hw/kdrive/ephyr/ephyrinit.c2
-rw-r--r--hw/kdrive/src/kinput.c2
-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/xf86Module.h2
-rw-r--r--hw/xfree86/common/xf86Priv.h2
-rw-r--r--hw/xfree86/common/xf86XKB.c2
-rw-r--r--hw/xfree86/common/xf86Xinput.c53
-rw-r--r--hw/xfree86/common/xf86Xinput.h8
-rw-r--r--hw/xfree86/common/xf86xv.c2
-rw-r--r--hw/xfree86/ddc/edid_modes.c13
-rw-r--r--hw/xfree86/ddc/xf86DDC.c53
-rw-r--r--hw/xfree86/dixmods/extmod/dgaproc.h5
-rw-r--r--hw/xfree86/dixmods/glxmodule.c4
-rw-r--r--hw/xfree86/dixmods/xkbKillSrv.c2
-rw-r--r--hw/xfree86/dixmods/xkbPrivate.c2
-rw-r--r--hw/xfree86/dixmods/xkbVT.c2
-rw-r--r--hw/xfree86/doc/man/xorg.conf.man.pre79
-rw-r--r--hw/xfree86/i2c/xf86i2cmodule.c36
-rw-r--r--hw/xfree86/loader/dixsym.c2
-rw-r--r--hw/xfree86/loader/loader.c116
-rw-r--r--hw/xfree86/loader/loaderProcs.h4
-rw-r--r--hw/xfree86/loader/loadmod.c102
-rw-r--r--hw/xfree86/loader/misym.c3
-rw-r--r--hw/xfree86/loader/xf86sym.c1
-rw-r--r--hw/xfree86/modes/xf86Crtc.c49
-rw-r--r--hw/xfree86/modes/xf86Crtc.h8
-rw-r--r--hw/xfree86/modes/xf86EdidModes.c13
-rw-r--r--hw/xfree86/modes/xf86RandR12.c140
-rw-r--r--hw/xfree86/modes/xf86Rotate.c68
-rw-r--r--hw/xfree86/os-support/shared/libc_wrapper.c2
-rw-r--r--hw/xfree86/parser/DRI.c31
-rw-r--r--hw/xfree86/parser/Flags.c9
-rw-r--r--hw/xfree86/parser/Layout.c38
-rw-r--r--hw/xfree86/parser/Module.c2
-rw-r--r--hw/xfree86/parser/Monitor.c32
-rw-r--r--hw/xfree86/parser/Screen.c2
-rw-r--r--hw/xfree86/parser/Vendor.c15
-rw-r--r--hw/xfree86/parser/Video.c34
-rw-r--r--hw/xfree86/parser/configProcs.h16
-rw-r--r--hw/xfree86/parser/read.c38
-rw-r--r--hw/xfree86/parser/scan.c16
-rw-r--r--hw/xfree86/parser/xf86Parser.h1
-rw-r--r--hw/xfree86/ramdac/xf86RamDacMod.c46
-rw-r--r--hw/xfree86/xaa/Makefile.am1
-rw-r--r--hw/xfree86/xaa/xaaDashLine.c2
-rw-r--r--hw/xfree86/xaa/xaaGC.c2
-rw-r--r--hw/xfree86/xaa/xaaGCmisc.c2
-rw-r--r--hw/xfree86/xaa/xaaInit.c19
-rw-r--r--hw/xfree86/xaa/xaaLineMisc.c2
-rw-r--r--hw/xfree86/xaa/xaaWrapper.c2
-rw-r--r--hw/xfree86/xaa/xaalocal.h3
-rw-r--r--hw/xfree86/xf4bpp/Makefile.am1
-rw-r--r--hw/xfree86/xf4bpp/offscreen.c19
-rw-r--r--hw/xfree86/xf4bpp/ppcGC.c9
-rw-r--r--hw/xfree86/xf4bpp/ppcPolyRec.c130
-rw-r--r--hw/xfree86/xf4bpp/xf4bpp.h8
-rw-r--r--hw/xgl/egl/kinput.c2
-rw-r--r--hw/xgl/glx/xglx.c2
-rw-r--r--hw/xnest/Display.c2
-rw-r--r--hw/xnest/Keyboard.c2
-rw-r--r--hw/xnest/Screen.c2
-rw-r--r--hw/xwin/InitOutput.c2
-rw-r--r--hw/xwin/winconfig.c2
-rw-r--r--hw/xwin/winkeybd.c2
83 files changed, 1214 insertions, 894 deletions
diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am
index 17d27ed39..41dc5d210 100644
--- a/hw/dmx/Makefile.am
+++ b/hw/dmx/Makefile.am
@@ -2,7 +2,6 @@ DIST_SUBDIRS = input config glxProxy examples doc
SUBDIRS = input config examples
bin_PROGRAMS = Xdmx
-noinst_LIBRARIES = libfbcmap.a
if XINERAMA
PANORAMIX_SRCS = $(top_srcdir)/Xext/panoramiX.c
@@ -17,6 +16,9 @@ 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
@@ -26,11 +28,9 @@ AM_CFLAGS = \
$(DIX_CFLAGS) \
$(GLX_INCS) \
$(GLX_DEFS) \
+ $(DMX_CFLAGS) \
@DMXMODULES_CFLAGS@
-libfbcmap_a_SOURCES = libfbcmap.a
-libfbcmap_a_CFLAGS = $(AM_CFLAGS) -DXFree86Server
-
Xdmx_SOURCES = dmx.c \
dmxcb.c \
dmxcb.h \
@@ -76,6 +76,7 @@ Xdmx_SOURCES = dmx.c \
dmxwindow.c \
dmxwindow.h \
$(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/fb/fbcmap.c \
$(GLX_SRCS)
@@ -89,7 +90,6 @@ Xdmx_LDADD = $(XORG_CORE_LIBS) \
$(GLX_LIBS) \
input/libdmxinput.a \
config/libdmxconfig.a \
- libfbcmap.a \
@DMXMODULES_LIBS@
# Man page
diff --git a/hw/dmx/dmxclient.h b/hw/dmx/dmxclient.h
index 586b82990..657a1275f 100644
--- a/hw/dmx/dmxclient.h
+++ b/hw/dmx/dmxclient.h
@@ -126,7 +126,7 @@ typedef XID KeySym64;
#undef KeySym
#endif
-/* These are in exglobals.h, but that conflicts with X11/extensions/XKBsrv.h */
+/* These are in exglobals.h, but that conflicts with xkbsrv.h */
extern int ProximityIn;
extern int ProximityOut;
extern int DeviceValuator;
@@ -144,7 +144,7 @@ extern int ChangeDeviceNotify;
#ifndef XKB_IN_SERVER
#define XKB_IN_SERVER
#endif
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#undef XPointer
#endif
#include <X11/extensions/XIproto.h>
diff --git a/hw/dmx/dmxcursor.c b/hw/dmx/dmxcursor.c
index e74a05215..a7d9378b0 100644
--- a/hw/dmx/dmxcursor.c
+++ b/hw/dmx/dmxcursor.c
@@ -130,14 +130,16 @@ static Bool dmxCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
int globalX;
int globalY;
- if (screenInfo.numScreens == 1) return FALSE;
+ if (screenInfo.numScreens == 1)
+ return FALSE;
/* On current screen? */
dmxScreen = &dmxScreens[(*ppScreen)->myNum];
if (localX >= 0
&& localX < dmxScreen->rootWidth
&& localY >= 0
- && localY < dmxScreen->rootHeight) return FALSE;
+ && localY < dmxScreen->rootHeight)
+ return FALSE;
/* Convert to global coordinate space */
globalX = dmxScreen->rootXOrigin + localX;
@@ -162,7 +164,8 @@ static Bool dmxCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
&& globalX < dmxScreen->rootXOrigin + dmxScreen->rootWidth
&& globalY >= dmxScreen->rootYOrigin
&& globalY < dmxScreen->rootYOrigin + dmxScreen->rootHeight) {
- if (dmxScreen->index == (*ppScreen)->myNum) return FALSE;
+ if (dmxScreen->index == (*ppScreen)->myNum)
+ return FALSE;
*ppScreen = screenInfo.screens[dmxScreen->index];
*x = globalX - dmxScreen->rootXOrigin;
*y = globalY - dmxScreen->rootYOrigin;
@@ -179,7 +182,12 @@ static void dmxCrossScreen(ScreenPtr pScreen, Bool entering)
static void dmxWarpCursor(ScreenPtr pScreen, int x, int y)
{
DMXDBG3("dmxWarpCursor(%d,%d,%d)\n", pScreen->myNum, x, y);
+#if 11 /*BP*/
+ /* This call is depracated. Replace with???? */
miPointerWarpCursor(pScreen, x, y);
+#else
+ pScreen->SetCursorPosition(pScreen, x, y, FALSE);
+#endif
}
miPointerScreenFuncRec dmxPointerCursorFuncs =
@@ -187,7 +195,7 @@ miPointerScreenFuncRec dmxPointerCursorFuncs =
dmxCursorOffScreen,
dmxCrossScreen,
dmxWarpCursor,
- dmxeqEnqueue,
+ dmxeqEnqueue, /*XXX incompatible type/function! */
dmxeqSwitchScreen
};
@@ -198,7 +206,8 @@ static int *dmxSLCreate(void)
int *list = malloc(dmxNumScreens * sizeof(*list));
int i;
- for (i = 0; i < dmxNumScreens; i++) list[i] = 1;
+ for (i = 0; i < dmxNumScreens; i++)
+ list[i] = 1;
return list;
}
@@ -212,7 +221,9 @@ static void dmxSLFree(int *list)
static int dmxSLFindNext(int *list)
{
int i;
- for (i = 0; i < dmxNumScreens; i++) if (list[i]) return i;
+ for (i = 0; i < dmxNumScreens; i++)
+ if (list[i])
+ return i;
return -1;
}
@@ -225,7 +236,8 @@ static int dmxTryComputeScreenOrigins(int *screensLeft)
int changed = 0;
for (i = 0; i < dmxNumScreens; i++) {
- if (!screensLeft[i]) continue;
+ if (!screensLeft[i])
+ continue;
screen = &dmxScreens[i];
switch (screen->where) {
case PosAbsolute:
@@ -235,14 +247,16 @@ static int dmxTryComputeScreenOrigins(int *screensLeft)
break;
case PosRelative:
ref = screen->whereRefScreen;
- if (screensLeft[ref]) break;
+ if (screensLeft[ref])
+ break;
dixScreenOrigins[i].x = dixScreenOrigins[ref].x + screen->whereX;
dixScreenOrigins[i].y = dixScreenOrigins[ref].y + screen->whereY;
++changed, screensLeft[i] = 0;
break;
case PosRightOf:
ref = screen->whereRefScreen;
- if (screensLeft[ref]) break;
+ if (screensLeft[ref])
+ break;
pScreen = screenInfo.screens[ref];
dixScreenOrigins[i].x = dixScreenOrigins[ref].x + pScreen->width;
dixScreenOrigins[i].y = dixScreenOrigins[ref].y;
@@ -250,7 +264,8 @@ static int dmxTryComputeScreenOrigins(int *screensLeft)
break;
case PosLeftOf:
ref = screen->whereRefScreen;
- if (screensLeft[ref]) break;
+ if (screensLeft[ref])
+ break;
pScreen = screenInfo.screens[i];
dixScreenOrigins[i].x = dixScreenOrigins[ref].x - pScreen->width;
dixScreenOrigins[i].y = dixScreenOrigins[ref].y;
@@ -258,7 +273,8 @@ static int dmxTryComputeScreenOrigins(int *screensLeft)
break;
case PosBelow:
ref = screen->whereRefScreen;
- if (screensLeft[ref]) break;
+ if (screensLeft[ref])
+ break;
pScreen = screenInfo.screens[ref];
dixScreenOrigins[i].x = dixScreenOrigins[ref].x;
dixScreenOrigins[i].y = dixScreenOrigins[ref].y + pScreen->height;
@@ -266,7 +282,8 @@ static int dmxTryComputeScreenOrigins(int *screensLeft)
break;
case PosAbove:
ref = screen->whereRefScreen;
- if (screensLeft[ref]) break;
+ if (screensLeft[ref])
+ break;
pScreen = screenInfo.screens[i];
dixScreenOrigins[i].x = dixScreenOrigins[ref].x;
dixScreenOrigins[i].y = dixScreenOrigins[ref].y - pScreen->height;
@@ -308,8 +325,10 @@ static void dmxComputeScreenOrigins(void)
minX = dixScreenOrigins[0].x;
minY = dixScreenOrigins[0].y;
for (i = 1; i < dmxNumScreens; i++) { /* Compute minX, minY */
- if (dixScreenOrigins[i].x < minX) minX = dixScreenOrigins[i].x;
- if (dixScreenOrigins[i].y < minY) minY = dixScreenOrigins[i].y;
+ if (dixScreenOrigins[i].x < minX)
+ minX = dixScreenOrigins[i].x;
+ if (dixScreenOrigins[i].y < minY)
+ minY = dixScreenOrigins[i].y;
}
if (minX || minY) {
for (i = 0; i < dmxNumScreens; i++) {
@@ -411,28 +430,36 @@ int dmxOnScreen(int x, int y, DMXScreenInfo *dmxScreen)
static int dmxDoesOverlap(DMXScreenInfo *a, DMXScreenInfo *b)
{
if (dmxOnScreen(a->rootXOrigin,
- a->rootYOrigin, b)) return 1;
+ a->rootYOrigin, b))
+ return 1;
if (dmxOnScreen(a->rootXOrigin,
- a->rootYOrigin + a->scrnWidth, b)) return 1;
+ a->rootYOrigin + a->scrnWidth, b))
+ return 1;
if (dmxOnScreen(a->rootXOrigin + a->scrnHeight,
- a->rootYOrigin, b)) return 1;
+ a->rootYOrigin, b))
+ return 1;
if (dmxOnScreen(a->rootXOrigin + a->scrnHeight,
- a->rootYOrigin + a->scrnWidth, b)) return 1;
+ a->rootYOrigin + a->scrnWidth, b))
+ return 1;
if (dmxOnScreen(b->rootXOrigin,
- b->rootYOrigin, a)) return 1;
+ b->rootYOrigin, a))
+ return 1;
if (dmxOnScreen(b->rootXOrigin,
- b->rootYOrigin + b->scrnWidth, a)) return 1;
+ b->rootYOrigin + b->scrnWidth, a))
+ return 1;
if (dmxOnScreen(b->rootXOrigin + b->scrnHeight,
- b->rootYOrigin, a)) return 1;
+ b->rootYOrigin, a))
+ return 1;
if (dmxOnScreen(b->rootXOrigin + b->scrnHeight,
- b->rootYOrigin + b->scrnWidth, a)) return 1;
+ b->rootYOrigin + b->scrnWidth, a))
+ return 1;
return 0;
}
@@ -476,7 +503,8 @@ static void *dmxTestSameDisplay(DMXScreenInfo *a, void *closure)
{
DMXScreenInfo *b = closure;
- if (a == b) return a;
+ if (a == b)
+ return a;
return NULL;
}
@@ -489,14 +517,16 @@ void dmxInitOverlap(void)
int i, j;
DMXScreenInfo *a, *b, *pt;
- for (i = 0; i < dmxNumScreens; i++) dmxScreens[i].over = NULL;
+ for (i = 0; i < dmxNumScreens; i++)
+ dmxScreens[i].over = NULL;
for (i = 0; i < dmxNumScreens; i++) {
a = &dmxScreens[i];
for (j = i+1; j < dmxNumScreens; j++) {
b = &dmxScreens[j];
- if (b->over) continue;
+ if (b->over)
+ continue;
if (dmxDoesOverlap(a, b)) {
DMXDBG6("%d overlaps %d: a=%p %p b=%p %p\n",
@@ -510,7 +540,8 @@ void dmxInitOverlap(void)
for (i = 0; i < dmxNumScreens; i++) {
a = &dmxScreens[i];
- if (!a->over) continue;
+ if (!a->over)
+ continue;
/* Flag all pairs that are on same display */
for (pt = a->over; pt != a; pt = pt->over) {
@@ -521,7 +552,8 @@ void dmxInitOverlap(void)
* screens that mutually overlap on the backend display,
* so we call dmxDoesOverlap, which is stricter than the
* ->over set. */
- if (!dmxDoesOverlap(a, pt)) continue;
+ if (!dmxDoesOverlap(a, pt))
+ continue;
a->cursorNotShared = 1;
pt->cursorNotShared = 1;
dmxLog(dmxInfo,
@@ -731,9 +763,11 @@ static Bool dmxRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
return _dmxRealizeCursor(pScreen, pCursor);
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
- if (pt->cursorNotShared) continue;
+ if (pt->cursorNotShared)
+ continue;
_dmxRealizeCursor(screenInfo.screens[pt->index], pCursor);
- if (pt == start) break;
+ if (pt == start)
+ break;
}
return TRUE;
}
@@ -747,9 +781,11 @@ static Bool dmxUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
return _dmxUnrealizeCursor(pScreen, pCursor);
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
- if (pt->cursorNotShared) continue;
+ if (pt->cursorNotShared)
+ continue;
_dmxUnrealizeCursor(screenInfo.screens[pt->index], pCursor);
- if (pt == start) break;
+ if (pt == start)
+ break;
}
return TRUE;
}
@@ -758,10 +794,13 @@ static CursorPtr dmxFindCursor(DMXScreenInfo *start)
{
DMXScreenInfo *pt;
- if (!start || !start->over) return GetSpriteCursor();
+ if (!start || !start->over)
+ return GetSpriteCursor();
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
- if (pt->cursor) return pt->cursor;
- if (pt == start) break;
+ if (pt->cursor)
+ return pt->cursor;
+ if (pt == start)
+ break;
}
return GetSpriteCursor();
}
@@ -769,7 +808,12 @@ static CursorPtr dmxFindCursor(DMXScreenInfo *start)
/** Move the cursor to coordinates (\a x, \a y)on \a pScreen. This
* function is usually called via #dmxPointerSpriteFuncs, except during
* reconfiguration when the cursor is repositioned to force an update on
- * newley overlapping screens and on screens that no longer overlap. */
+ * newley overlapping screens and on screens that no longer overlap.
+ *
+ * The coords (x,y) are in global coord space. We'll loop over the
+ * back-end screens and see if they contain the global coord. If so, call
+ * _dmxMoveCursor() (XWarpPointer) to position the pointer on that screen.
+ */
void dmxMoveCursor(ScreenPtr pScreen, int x, int y)
{
DMXScreenInfo *start = &dmxScreens[pScreen->myNum];
@@ -783,7 +827,8 @@ void dmxMoveCursor(ScreenPtr pScreen, int x, int y)
}
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
- if (pt->cursorNotShared) continue;
+ if (pt->cursorNotShared)
+ continue;
if (dmxOnScreen(x + start->rootXOrigin, y + start->rootYOrigin, pt)) {
if (/* pt != start && */ !pt->cursorVisible) {
if (!pt->cursor) {
@@ -811,7 +856,8 @@ void dmxMoveCursor(ScreenPtr pScreen, int x, int y)
x + start->rootXOrigin - pt->rootXOrigin,
y + start->rootYOrigin - pt->rootYOrigin);
}
- if (pt == start) break;
+ if (pt == start)
+ break;
}
}
@@ -843,7 +889,7 @@ static void dmxSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
gx = start->rootXOrigin + x;
gy = start->rootYOrigin + y;
if (x && y && (GX != gx || GY != gy))
- dmxCoreMotion(gx, gy, 0, DMX_NO_BLOCK);
+ dmxCoreMotion(NULL, gx, gy, 0, DMX_NO_BLOCK);
if (!start->over || !dmxCursorDoMultiCursors || start->cursorNotShared) {
_dmxSetCursor(pScreen, pCursor, x, y);
@@ -851,7 +897,8 @@ static void dmxSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
}
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
- if (pt->cursorNotShared) continue;
+ if (pt->cursorNotShared)
+ continue;
if (dmxOnScreen(x + start->rootXOrigin, y + start->rootYOrigin, pt)) {
_dmxSetCursor(screenInfo.screens[pt->index], pCursor,
x + start->rootXOrigin - pt->rootXOrigin,
@@ -861,7 +908,8 @@ static void dmxSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
x + start->rootXOrigin - pt->rootXOrigin,
y + start->rootYOrigin - pt->rootYOrigin);
}
- if (pt == start) break;
+ if (pt == start)
+ break;
}
}
@@ -896,8 +944,13 @@ void dmxCheckCursor(void)
pScreen = screenInfo.screens[dmxScreen->index];
if (!dmxOnScreen(x, y, dmxScreen)) {
+#if 00
if (firstScreen && i == miPointerCurrentScreen()->myNum)
miPointerSetNewScreen(firstScreen->index, x, y);
+#else
+ if (firstScreen && i == miPointerGetScreen(inputInfo.pointer)->myNum)
+ miPointerSetScreen(inputInfo.pointer, firstScreen->index, x, y);
+#endif
_dmxSetCursor(pScreen, NULL,
x - dmxScreen->rootXOrigin,
y - dmxScreen->rootYOrigin);
diff --git a/hw/dmx/dmxinput.c b/hw/dmx/dmxinput.c
index 37f458356..f47899c2f 100644
--- a/hw/dmx/dmxinput.c
+++ b/hw/dmx/dmxinput.c
@@ -49,6 +49,7 @@
#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
@@ -75,6 +76,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
diff --git a/hw/dmx/dmxinput.h b/hw/dmx/dmxinput.h
index 59fa823d3..3fb587086 100644
--- a/hw/dmx/dmxinput.h
+++ b/hw/dmx/dmxinput.h
@@ -154,7 +154,7 @@ typedef enum {
extern void dmxGetGlobalPosition(int *x, int *y);
extern DMXScreenInfo *dmxFindFirstScreen(int x, int y);
-extern void dmxCoreMotion(int x, int y, int delta,
+extern void dmxCoreMotion(DevicePtr pDev, int x, int y, int delta,
DMXBlockType block);
/* Support for dynamic addition of inputs. This functions is defined in
diff --git a/hw/dmx/input/dmxbackend.c b/hw/dmx/input/dmxbackend.c
index 8985a1b1d..7efb2eebe 100644
--- a/hw/dmx/input/dmxbackend.c
+++ b/hw/dmx/input/dmxbackend.c
@@ -242,7 +242,11 @@ static int dmxBackendOffscreen(int screen, int x, int y)
void dmxBackendUpdatePosition(pointer private, int x, int y)
{
GETPRIVFROMPRIVATE;
+#if 00 /*BP*/
int screen = miPointerCurrentScreen()->myNum;
+#else
+ int screen = miPointerGetScreen(inputInfo.pointer)->myNum;
+#endif
DMXScreenInfo *dmxScreen = &dmxScreens[priv->myScreen];
int oldRelative = priv->relative;
int topscreen = dmxBackendFindOverlapping(priv, screen, x, y);
@@ -391,6 +395,7 @@ void dmxBackendCollectEvents(DevicePtr pDev,
}
break;
case MotionNotify:
+#if 001 /*BP*/
DMXDBG9("dmxBackendCollectEvents: MotionNotify %d/%d (mi %d)"
" newscreen=%d: %d %d (e=%d; last=%d,%d)\n",
dmxScreen->index, priv->myScreen,
@@ -443,12 +448,25 @@ void dmxBackendCollectEvents(DevicePtr pDev,
(dmxScreen->rootYOrigin + X.xmotion.y
- dmxScreen->rootY));
}
+#else
+ /*
+ ErrorF("motion %d, %d, %d\n",
+ X.xmotion.x, X.xmotion.y, X.xmotion.state);
+ */
+ enqueue(priv->mou, X.type, 0/*X.xbutton.button*/, 0, &X, block);
+#endif
break;
case KeyPress:
case KeyRelease:
enqueue(priv->kbd, X.type, X.xkey.keycode, 0, NULL, block);
break;
+#if 11/*BP*/
+ case ButtonPress:
+ case ButtonRelease:
+ ErrorF("press/release at %d, %d\n", X.xbutton.x, X.xbutton.y);
+ /* fall-through */
+#endif
default:
/* Pass the whole event here, because
* this may be an extension event. */
diff --git a/hw/dmx/input/dmxevents.c b/hw/dmx/input/dmxevents.c
index 5316f0fdc..fae2049b3 100644
--- a/hw/dmx/input/dmxevents.c
+++ b/hw/dmx/input/dmxevents.c
@@ -56,6 +56,7 @@
#include "opaque.h"
#include "inputstr.h"
#include "mipointer.h"
+#include "mi.h"
#ifdef XINPUT
#include "XIstubs.h"
@@ -190,7 +191,135 @@ DMXScreenInfo *dmxFindFirstScreen(int x, int y)
return NULL;
}
-void dmxCoreMotion(int x, int y, int delta, DMXBlockType block)
+
+#if 11/*BP*/
+
+static void enqueueMotion(DevicePtr pDev, int x, int y)
+{
+ GETDMXINPUTFROMPDEV;
+ DeviceIntPtr p = dmxLocal->pDevice;
+ int i, nevents, valuators[3];
+ xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
+ int detail = 0;
+
+ valuators[0] = x;
+ valuators[1] = y;
+ valuators[2] = detail;
+ nevents = GetPointerEvents(events,
+ /*pDev*/p,
+ MotionNotify,
+ detail,
+ POINTER_ABSOLUTE,
+ 0, 2, valuators);
+ ErrorF("MOTION2 %d, %d n = %d\n", valuators[0], valuators[1], nevents);
+ /*
+ ErrorF("NEW MOTION %d st %d (%d,%d,%d) n=%d\n",
+ detail, e->xmotion.state,
+ valuators[0], valuators[1], valuators[2],
+ nevents);
+ */
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(p, events + i);
+ xfree(events);
+ return;
+}
+
+
+static void
+dmxCoreMotion2(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
+{
+ DMXScreenInfo *dmxScreen;
+ DMXInputInfo *dmxInput;
+ ScreenPtr pScreen;
+ int localX;
+ int localY;
+ int i;
+
+ if (!dmxGlobalInvalid && dmxGlobalX == x && dmxGlobalY == y) return;
+
+ DMXDBG5("dmxCoreMotion(%d,%d,%d) dmxGlobalX=%d dmxGlobalY=%d\n",
+ x, y, delta, dmxGlobalX, dmxGlobalY);
+
+ dmxGlobalInvalid = 0;
+ dmxGlobalX = x;
+ dmxGlobalY = y;
+
+ if (dmxGlobalX < 0) dmxGlobalX = 0;
+ if (dmxGlobalY < 0) dmxGlobalY = 0;
+ if (dmxGlobalX >= dmxGlobalWidth) dmxGlobalX = dmxGlobalWidth + delta -1;
+ if (dmxGlobalY >= dmxGlobalHeight) dmxGlobalY = dmxGlobalHeight + delta -1;
+
+ ErrorF("Global Pos: %d, %d\n", dmxGlobalX, dmxGlobalY);
+
+ if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) {
+ localX = dmxGlobalX - dmxScreen->rootXOrigin;
+ localY = dmxGlobalY - dmxScreen->rootYOrigin;
+ if ((pScreen = miPointerGetScreen(inputInfo.pointer))
+ && pScreen->myNum == dmxScreen->index) {
+ /* Screen is old screen */
+ if (block)
+ dmxSigioBlock();
+#if 000
+ miPointerSetPosition(inputInfo.pointer, &localX, &localY,
+ GetTimeInMillis());
+#else
+ if (pDev)
+ enqueueMotion(pDev, localX, localY);
+#endif
+ if (block)
+ dmxSigioUnblock();
+ } else {
+ /* Screen is new */
+ DMXDBG4(" New screen: old=%d new=%d localX=%d localY=%d\n",
+ pScreen->myNum, dmxScreen->index, localX, localY);
+ if (block)
+ dmxSigioBlock();
+ dmxeqProcessInputEvents();
+ miPointerSetScreen(inputInfo.pointer, dmxScreen->index,
+ localX, localY);
+#if 000
+ miPointerSetPosition(inputInfo.pointer, &localX, &localY,
+ GetTimeInMillis());
+#else
+ if (pDev)
+ enqueueMotion(pDev, localX, localY);
+#endif
+ if (block)
+ dmxSigioUnblock();
+ }
+#if 00
+ miPointerGetPosition(inputInfo.pointer, &localX, &localY);
+
+ if ((pScreen = miPointerGetScreen(inputInfo.pointer))) {
+ dmxGlobalX = localX + dmxScreens[pScreen->myNum].rootXOrigin;
+ dmxGlobalY = localY + dmxScreens[pScreen->myNum].rootYOrigin;
+ ErrorF("Global is now %d, %d %d, %d\n", dmxGlobalX, dmxGlobalY,
+ localX, localY);
+ DMXDBG6(" Moved to dmxGlobalX=%d dmxGlobalY=%d"
+ " on screen index=%d/%d localX=%d localY=%d\n",
+ dmxGlobalX, dmxGlobalY,
+ dmxScreen ? dmxScreen->index : -1, pScreen->myNum,
+ localX, localY);
+ }
+#endif
+ }
+ /* Send updates down to all core input
+ * drivers */
+ for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) {
+ int j;
+
+ for (j = 0; j < dmxInput->numDevs; j += dmxInput->devs[j]->binding)
+ if (!dmxInput->detached
+ && dmxInput->devs[j]->sendsCore
+ && dmxInput->devs[j]->update_position)
+ dmxInput->devs[j]->update_position(dmxInput->devs[j]->private,
+ dmxGlobalX, dmxGlobalY);
+ }
+ if (!dmxScreen) ProcessInputEvents();
+}
+#endif
+
+void dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
{
DMXScreenInfo *dmxScreen;
DMXInputInfo *dmxInput;
@@ -199,6 +328,11 @@ void dmxCoreMotion(int x, int y, int delta, DMXBlockType block)
int localY;
int i;
+#if 11/*BP*/
+ dmxCoreMotion2(pDev, x, y, delta, block);
+ return;
+#endif
+
if (!dmxGlobalInvalid && dmxGlobalX == x && dmxGlobalY == y) return;
DMXDBG5("dmxCoreMotion(%d,%d,%d) dmxGlobalX=%d dmxGlobalY=%d\n",
@@ -213,14 +347,25 @@ void dmxCoreMotion(int x, int y, int delta, DMXBlockType block)
if (dmxGlobalX >= dmxGlobalWidth) dmxGlobalX = dmxGlobalWidth + delta -1;
if (dmxGlobalY >= dmxGlobalHeight) dmxGlobalY = dmxGlobalHeight + delta -1;
+ ErrorF("Global Pos: %d, %d\n", dmxGlobalX, dmxGlobalY);
+
if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) {
localX = dmxGlobalX - dmxScreen->rootXOrigin;
localY = dmxGlobalY - dmxScreen->rootYOrigin;
+#if 00 /*BP*/
if ((pScreen = miPointerCurrentScreen())
+#else
+ if ((pScreen = miPointerGetScreen(inputInfo.pointer))
+#endif
&& pScreen->myNum == dmxScreen->index) {
/* Screen is old screen */
if (block) dmxSigioBlock();
+#if 00 /*BP*/
miPointerAbsoluteCursor(localX, localY, GetTimeInMillis());
+#else
+ miPointerSetPosition(inputInfo.pointer, &localX, &localY,
+ GetTimeInMillis());
+#endif
if (block) dmxSigioUnblock();
} else {
/* Screen is new */
@@ -228,15 +373,31 @@ void dmxCoreMotion(int x, int y, int delta, DMXBlockType block)
pScreen->myNum, dmxScreen->index, localX, localY);
if (block) dmxSigioBlock();
dmxeqProcessInputEvents();
+#if 00 /*BP*/
miPointerSetNewScreen(dmxScreen->index, localX, localY);
miPointerAbsoluteCursor(localX, localY, GetTimeInMillis());
+#else
+ miPointerSetScreen(inputInfo.pointer, dmxScreen->index,
+ localX, localY);
+ miPointerSetPosition(inputInfo.pointer, &localX, &localY,
+ GetTimeInMillis());
+#endif
if (block) dmxSigioUnblock();
}
+#if 00 /*BP*/
miPointerPosition(&localX, &localY);
+#else
+ miPointerGetPosition(inputInfo.pointer, &localX, &localY);
+#endif
+#if 00 /*BP*/
if ((pScreen = miPointerCurrentScreen())) {
+#else
+ if ((pScreen = miPointerGetScreen(inputInfo.pointer))) {
+#endif
dmxGlobalX = localX + dmxScreens[pScreen->myNum].rootXOrigin;
dmxGlobalY = localY + dmxScreens[pScreen->myNum].rootYOrigin;
+ ErrorF("Global is now %d, %d\n", dmxGlobalX, dmxGlobalY);
DMXDBG6(" Moved to dmxGlobalX=%d dmxGlobalY=%d"
" on screen index=%d/%d localX=%d localY=%d\n",
dmxGlobalX, dmxGlobalY,
@@ -259,6 +420,8 @@ void dmxCoreMotion(int x, int y, int delta, DMXBlockType block)
if (!dmxScreen) ProcessInputEvents();
}
+
+
#ifdef XINPUT
#define DMX_MAX_AXES 32 /* Max axes reported by this routine */
static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
@@ -508,12 +671,18 @@ void dmxMotion(DevicePtr pDev, int *v, int firstAxes, int axesCount,
return;
}
#endif
- if (axesCount == 2) switch (type) {
- case DMX_RELATIVE: dmxCoreMotion(dmxGlobalX - v[0],
- dmxGlobalY - v[1],
- 0, block); break;
- case DMX_ABSOLUTE: dmxCoreMotion(v[0], v[1], 0, block); break;
- case DMX_ABSOLUTE_CONFINED: dmxCoreMotion(v[0], v[1], -1, block); break;
+ if (axesCount == 2) {
+ switch (type) {
+ case DMX_RELATIVE:
+ dmxCoreMotion(pDev, dmxGlobalX - v[0], dmxGlobalY - v[1], 0, block);
+ break;
+ case DMX_ABSOLUTE:
+ dmxCoreMotion(pDev, v[0], v[1], 0, block);
+ break;
+ case DMX_ABSOLUTE_CONFINED:
+ dmxCoreMotion(pDev, v[0], v[1], -1, block);
+ break;
+ }
}
}
@@ -604,16 +773,90 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
return;
if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard)
xE.u.u.detail = dmxFixup(pDev, detail, keySym);
+#if 11/*BP*/
+ {
+ DeviceIntPtr p = dmxLocal->pDevice;
+ int i, nevents;
+ xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
+ nevents = GetKeyboardEvents(events,
+ /*pDev*/p,
+ /*KeyPress*/type,
+ /*n*/detail);
+ ErrorF("KEY %d n=%d\n", detail, nevents);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(p, events + i);
+ xfree(events);
+ return;
+ }
+#endif
break;
case ButtonPress:
case ButtonRelease:
+#if 00 /*BP*/
detail = dmxGetButtonMapping(dmxLocal, detail);
+#else
+ {
+ DeviceIntPtr p = dmxLocal->pDevice;
+ int i, nevents, valuators[3];
+ xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
+
+ valuators[0] = e->xbutton.x;
+ valuators[1] = e->xbutton.y;
+ /*
+ valuators[0] = dmxGlobalX;
+ valuators[1] = dmxGlobalY;
+ */
+ valuators[2] = e->xbutton.button;
+ nevents = GetPointerEvents(events,
+ /*pDev*/p,
+ /*KeyPress*/type,
+ detail,
+ POINTER_ABSOLUTE,
+ 0, 2/*3*/, valuators);
+
+ ErrorF("BUTTON %d, %d %d n=%d\n",
+ valuators[0], valuators[1], valuators[2], nevents);
+
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(p, events + i);
+ xfree(events);
+ return;
+ }
+#endif
break;
case MotionNotify:
/* All MotionNotify events should be sent via dmxCoreMotion and
* dmxExtMotion -- no input driver should build motion events by
* hand. */
+#if 00 /*BP*/
dmxLog(dmxError, "dmxEnqueueXEvent: MotionNotify not allowed here\n");
+#else
+ {
+ DeviceIntPtr p = dmxLocal->pDevice;
+ int i, nevents, valuators[3];
+ xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
+ valuators[0] = e->xmotion.x;
+ valuators[1] = e->xmotion.y;
+ valuators[2] = e->xmotion.state;
+ nevents = GetPointerEvents(events,
+ /*pDev*/p,
+ /*KeyPress*/type,
+ detail,
+ POINTER_ABSOLUTE,
+ 0, 3, valuators);
+ ErrorF("MOTION %d, %d n = %d\n", valuators[0], valuators[1], nevents);
+ /*
+ ErrorF("NEW MOTION %d st %d (%d,%d,%d) n=%d\n",
+ detail, e->xmotion.state,
+ valuators[0], valuators[1], valuators[2],
+ nevents);
+ */
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(p, events + i);
+ xfree(events);
+ return;
+ }
+#endif
break;
/* Always ignore these events */
case EnterNotify:
@@ -623,6 +866,7 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
* modifier map on the backend/console
* input device so that we have complete
* control of the input device LEDs. */
+ ErrorF("Enter/Leave/Keymap/Mapping\n");
return;
default:
#ifdef XINPUT
@@ -652,7 +896,16 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
if (!dmxLocal->sendsCore) dmxEnqueueExtEvent(dmxLocal, &xE, block);
else
#endif
+#if 00 /*BP*/
dmxeqEnqueue(&xE);
+#else
+ /* never get here! */
+ if (0) {
+ DeviceIntPtr p = dmxLocal->pDevice;
+ ErrorF("enque %d\n", type);
+ mieqEnqueue(p, &xE);
+ }
+#endif
}
/** A pointer to this routine is passed to low-level input drivers so
diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index 0519d2b72..cf680517f 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -72,6 +72,7 @@
#include "input.h"
#include "mipointer.h"
#include "windowstr.h"
+#include "mi.h"
#ifdef XINPUT
#include <X11/extensions/XI.h>
@@ -222,6 +223,57 @@ static DMXLocalInputInfoRec DMXLocalDevices[] = {
{ NULL } /* Must be last */
};
+
+#if 11 /*BP*/
+void
+DDXRingBell(int volume, int pitch, int duration)
+{
+ /* NO-OP */
+}
+
+/* taken from kdrive/src/kinput.c: */
+static void
+dmxKbdCtrl (DeviceIntPtr pDevice, KeybdCtrl *ctrl)
+{
+#if 0
+ KdKeyboardInfo *ki;
+
+ for (ki = kdKeyboards; ki; ki = ki->next) {
+ if (ki->dixdev && ki->dixdev->id == pDevice->id)
+ break;
+ }
+
+ if (!ki || !ki->dixdev || ki->dixdev->id != pDevice->id || !ki->driver)
+ return;
+
+ KdSetLeds(ki, ctrl->leds);
+ ki->bellPitch = ctrl->bell_pitch;
+ ki->bellDuration = ctrl->bell_duration;
+#endif
+}
+
+/* taken from kdrive/src/kinput.c: */
+static void
+dmxBell(int volume, DeviceIntPtr pDev, pointer arg, int something)
+{
+#if 0
+ KeybdCtrl *ctrl = arg;
+ KdKeyboardInfo *ki = NULL;
+
+ for (ki = kdKeyboards; ki; ki = ki->next) {
+ if (ki->dixdev && ki->dixdev->id == pDev->id)
+ break;
+ }
+
+ if (!ki || !ki->dixdev || ki->dixdev->id != pDev->id || !ki->driver)
+ return;
+
+ KdRingBell(ki, volume, ctrl->bell_pitch, ctrl->bell_duration);
+#endif
+}
+
+#endif /*BP*/
+
static void _dmxChangePointerControl(DMXLocalInputInfoPtr dmxLocal,
PtrCtrl *ctrl)
{
@@ -420,14 +472,24 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
memset(&info, 0, sizeof(info));
switch (what) {
case DEVICE_INIT:
- if (dmxLocal->init) dmxLocal->init(pDev);
- if (dmxLocal->get_info) dmxLocal->get_info(pDev, &info);
+ if (dmxLocal->init)
+ dmxLocal->init(pDev);
+ if (dmxLocal->get_info)
+ dmxLocal->get_info(pDev, &info);
if (info.keyboard) { /* XKEYBOARD makes this a special case */
dmxKeyboardOn(pDevice, &info);
break;
}
if (info.keyClass) {
+#if 00 /*BP*/
InitKeyClassDeviceStruct(pDevice, &info.keySyms, info.modMap);
+#else
+ DevicePtr pDev = (DevicePtr) pDevice;
+ InitKeyboardDeviceStruct(pDev,
+ &info.keySyms,
+ info.modMap,
+ dmxBell, dmxKbdCtrl);
+#endif
}
if (info.buttonClass) {
InitButtonClassDeviceStruct(pDevice, info.numButtons, info.map);
@@ -435,13 +497,19 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
if (info.valuatorClass) {
if (info.numRelAxes && dmxLocal->sendsCore) {
InitValuatorClassDeviceStruct(pDevice, info.numRelAxes,
+#if 00 /*BP*/
miPointerGetMotionEvents,
miPointerGetMotionBufferSize(),
+#else
+ GetMotionHistory,
+ GetMaximumEventsNum(),
+#endif
Relative);
+ ErrorF("MOTION BUFFER SIZE %d\n", GetMaximumEventsNum());
#ifdef XINPUT
for (i = 0; i < info.numRelAxes; i++)
InitValuatorAxisStruct(pDevice, i, info.minval[0],
- info.maxval[0], info.res[0],
+ 1280/*info.maxval[0]*/, info.res[0],
info.minres[0], info.maxres[0]);
#endif
} else if (info.numRelAxes) {
@@ -452,7 +520,7 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
#ifdef XINPUT
for (i = 0; i < info.numRelAxes; i++)
InitValuatorAxisStruct(pDevice, i, info.minval[0],
- info.maxval[0], info.res[0],
+ 1280/*info.maxval[0]*/, info.res[0],
info.minres[0], info.maxres[0]);
#endif
} else if (info.numAbsAxes) {
@@ -463,7 +531,7 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
#ifdef XINPUT
for (i = 0; i < info.numAbsAxes; i++)
InitValuatorAxisStruct(pDevice, i+info.numRelAxes,
- info.minval[i+1], info.maxval[i+1],
+ info.minval[i+1], 1280/*info.maxval[i+1]*/,
info.res[i+1], info.minres[i+1],
info.maxres[i+1]);
#endif
@@ -520,12 +588,27 @@ static void dmxProcessInputEvents(DMXInputInfo *dmxInput)
{
int i;
+ /*
+ ErrorF("%s\n", __FUNCTION__);
+ */
+
dmxeqProcessInputEvents();
+#if 00 /*BP*/
miPointerUpdate();
- if (dmxInput->detached) return;
+#endif
+ if (dmxInput->detached)
+ return;
for (i = 0; i < dmxInput->numDevs; i += dmxInput->devs[i]->binding)
- if (dmxInput->devs[i]->process_input)
+ if (dmxInput->devs[i]->process_input) {
+#if 11 /*BP*/
+ miPointerUpdateSprite(dmxInput->devs[i]->pDevice);
+#endif
dmxInput->devs[i]->process_input(dmxInput->devs[i]->private);
+ }
+
+#if 11 /*BP*/
+ mieqProcessInputEvents();
+#endif
}
static void dmxUpdateWindowInformation(DMXInputInfo *dmxInput,
@@ -553,7 +636,8 @@ static void dmxUpdateWindowInformation(DMXInputInfo *dmxInput,
}
#endif
- if (dmxInput->detached) return;
+ if (dmxInput->detached)
+ return;
for (i = 0; i < dmxInput->numDevs; i += dmxInput->devs[i]->binding)
if (dmxInput->devs[i]->update_info)
dmxInput->devs[i]->update_info(dmxInput->devs[i]->private,
@@ -564,7 +648,8 @@ static void dmxCollectAll(DMXInputInfo *dmxInput)
{
int i;
- if (dmxInput->detached) return;
+ if (dmxInput->detached)
+ return;
for (i = 0; i < dmxInput->numDevs; i += dmxInput->devs[i]->binding)
if (dmxInput->devs[i]->collect_events)
dmxInput->devs[i]->collect_events(&dmxInput->devs[i]
@@ -661,7 +746,8 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal)
char *devname;
DMXInputInfo *dmxInput;
- if (!dmxLocal) return NULL;
+ if (!dmxLocal)
+ return NULL;
dmxInput = &dmxInputs[dmxLocal->inputIdx];
if (dmxLocal->sendsCore) {
@@ -710,8 +796,13 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal)
registerProcPtr(pDevice);
- if (dmxLocal->isCore && dmxLocal->type == DMX_LOCAL_MOUSE)
+ if (dmxLocal->isCore && dmxLocal->type == DMX_LOCAL_MOUSE) {
+#if 00 /*BP*/
miRegisterPointerDevice(screenInfo.screens[0], pDevice);
+#else
+ /* Nothing? dmxDeviceOnOff() should get called to init, right? */
+#endif
+ }
if (dmxLocal->create_private)
dmxLocal->private = dmxLocal->create_private(pDevice);
diff --git a/hw/dmx/input/dmxxinput.c b/hw/dmx/input/dmxxinput.c
index 81d1cfbe6..ad2a77c9c 100644
--- a/hw/dmx/input/dmxxinput.c
+++ b/hw/dmx/input/dmxxinput.c
@@ -99,9 +99,13 @@ int ChangePointerDevice(DeviceIntPtr old_dev,
}
dmxLocalNew->savedMotionProc = new_dev->valuator->GetMotionProc;
dmxLocalNew->savedMotionEvents = new_dev->valuator->numMotionEvents;
+#if 00 /*BP*/
new_dev->valuator->GetMotionProc = miPointerGetMotionEvents;
new_dev->valuator->numMotionEvents = miPointerGetMotionBufferSize();
-
+#else
+ new_dev->valuator->GetMotionProc = GetMotionHistory;
+ new_dev->valuator->numMotionEvents = GetMaximumEventsNum();
+#endif
/* Switch our notion of core pointer */
dmxLocalOld->isCore = 0;
dmxLocalOld->sendsCore = dmxLocalOld->savedSendsCore;
diff --git a/hw/dmx/input/lnx-keyboard.c b/hw/dmx/input/lnx-keyboard.c
index 97cc3077e..b09492b89 100644
--- a/hw/dmx/input/lnx-keyboard.c
+++ b/hw/dmx/input/lnx-keyboard.c
@@ -164,7 +164,9 @@
#include <sys/kd.h>
#include <termios.h>
#include "atKeynames.h"
+#if 00
#include "xf86Keymap.h"
+#endif
#include <linux/keyboard.h>
#define NUM_AT2LNX (sizeof(at2lnx) / sizeof(at2lnx[0]))
@@ -800,7 +802,12 @@ static void kbdLinuxReadKernelMapping(int fd, KeySymsPtr pKeySyms)
tbl[2] = 8; /* alt */
tbl[3] = tbl[2] | 1;
+#if 00/*BP*/
k = map+GLYPHS_PER_KEY;
+#else
+ ErrorF("kbdLinuxReadKernelMapping() is broken/no-op'd\n");
+ return;
+#endif
maxkey = NUM_AT2LNX;
for (i = 0; i < maxkey; ++i) {
@@ -927,8 +934,13 @@ static void kbdLinuxGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
char type;
int i;
+#if 00/*BP*/
mapCopy = xalloc(sizeof(map));
memcpy(mapCopy, map, sizeof(map));
+#else
+ ErrorF("kbdLinuxGetMap() is broken/no-op'd\n");
+ return;
+#endif
kbdLinuxReadKernelMapping(priv->fd, pKeySyms);
diff --git a/hw/kdrive/ati/ati_dma.c b/hw/kdrive/ati/ati_dma.c
index f75ff12e7..70b86d36c 100644
--- a/hw/kdrive/ati/ati_dma.c
+++ b/hw/kdrive/ati/ati_dma.c
@@ -788,7 +788,7 @@ ATIPseudoDMAInit(ScreenPtr pScreen)
atis->cce_pri_size = MMIO_IN32(mmio, RADEON_REG_CP_CSQ_CNTL) &
R200_CSQ_CNT_PRIMARY_MASK;
MMIO_OUT32(mmio, RADEON_REG_ME_CNTL, RADEON_ME_MODE_FREE_RUN);
- } if (atic->is_radeon) {
+ } else if (atic->is_radeon) {
MMIO_OUT32(mmio, RADEON_REG_CP_CSQ_CNTL,
RADEON_CSQ_PRIPIO_INDDIS);
atis->cce_pri_size = MMIO_IN32(mmio, RADEON_REG_CP_CSQ_CNTL) &
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 8310f6590..4a212e304 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -81,7 +81,7 @@ ddxUseMsg (void)
ErrorF("-host-cursor Re-use exisiting X host server cursor\n");
ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n");
ErrorF("-grayscale Simulate 8bit grayscale\n");
- ErrorF("-fakexa Simulate acceleration using software rendering\n");
+ ErrorF("-fakexa Simulate acceleration using software rendering\n");
ErrorF("\n");
exit(1);
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 23fede246..20440dc2c 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -42,7 +42,7 @@
#endif
#ifdef XKB
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
#include <X11/extensions/XI.h>
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 7617bf78a..9740b0732 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -1791,6 +1791,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
@@ -2836,18 +2845,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;
@@ -3071,15 +3069,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 b638e9026..8d7195994 100644
--- a/hw/xfree86/common/xf86Bus.h
+++ b/hw/xfree86/common/xf86Bus.h
@@ -141,12 +141,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 2981e173c..66e6b055b 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -75,7 +75,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
@@ -538,25 +538,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
@@ -2502,17 +2483,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 f71486c9d..4b482dfdc 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -68,7 +68,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 9a24040af..e588e9a8f 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)
{
@@ -1128,39 +1215,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,
@@ -1219,3 +1273,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 a91f6b34e..84588996d 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 9b23710bb..b41fe6e5f 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 93c89fd5f..913735bc9 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -2981,3 +2981,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/xf86Module.h b/hw/xfree86/common/xf86Module.h
index 281183960..8e644c433 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -84,7 +84,7 @@ typedef enum {
* mask is 0xFFFF0000.
*/
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 3)
-#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(1, 2)
+#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(2, 0)
#define ABI_XINPUT_VERSION SET_ABI_VERSION(1, 0)
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(0, 3)
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 5)
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index 9279dbd7b..59ce8da86 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/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;
@@ -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 */
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 2c740018c..cc98a0cb2 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -99,6 +99,10 @@
#include "mi.h"
+#ifdef XFreeXDGA
+#include "dgaproc.h"
+#endif
+
xEvent *xf86Events = NULL;
static Bool
@@ -142,6 +146,9 @@ xf86ProcessCommonOptions(LocalDevicePtr local,
} else {
xf86Msg(X_CONFIG, "%s: doesn't report drag events\n", local->name);
}
+
+ /* Backwards compatibility. */
+ local->history_size = GetMotionHistorySize();
}
/***********************************************************************
@@ -440,10 +447,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;
@@ -457,6 +466,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)
@@ -475,6 +502,7 @@ xf86PostMotionEvent(DeviceIntPtr device,
}
}
+out:
xfree(valuators);
}
@@ -521,13 +549,15 @@ xf86PostButtonEvent(DeviceIntPtr device,
va_list var;
int *valuators = NULL;
int i = 0, nevents = 0;
- int flags = 0;
-
- if (is_absolute)
- flags = POINTER_ABSOLUTE;
- else
- flags = POINTER_RELATIVE;
+ 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);
va_start(var, num_valuators);
@@ -542,7 +572,7 @@ xf86PostButtonEvent(DeviceIntPtr device,
nevents = GetPointerEvents(xf86Events, device,
is_down ? ButtonPress : ButtonRelease, button,
- flags,
+ (is_absolute) ? POINTER_ABSOLUTE : POINTER_RELATIVE,
first_valuator, num_valuators, valuators);
for (i = 0; i < nevents; i++)
@@ -602,6 +632,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 4eaf8fc6d..60f9ec337 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -87,6 +87,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. */
@@ -145,6 +148,7 @@ typedef struct _LocalDeviceRec {
InputDriverPtr drv;
pointer module;
pointer options;
+ unsigned int history_size;
} LocalDeviceRec, *LocalDevicePtr, InputInfoRec, *InputInfoPtr;
typedef struct _DeviceAssocRec
@@ -192,6 +196,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/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;
diff --git a/hw/xfree86/ddc/edid_modes.c b/hw/xfree86/ddc/edid_modes.c
index cfc8ddc13..926bc8921 100644
--- a/hw/xfree86/ddc/edid_modes.c
+++ b/hw/xfree86/ddc/edid_modes.c
@@ -107,6 +107,19 @@ DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing,
{
DisplayModePtr Mode;
+ /*
+ * Refuse to create modes that are insufficiently large. 64 is a random
+ * number, maybe the spec says something about what the minimum is. In
+ * particular I see this frequently with _old_ EDID, 1.0 or so, so maybe
+ * our parser is just being too aggresive there.
+ */
+ if (timing->h_active < 64 || timing->v_active < 64) {
+ xf86DrvMsg(scrnIndex, X_INFO,
+ "%s: Ignoring tiny %dx%d mode\n", __func__,
+ timing->h_active, timing->v_active);
+ return NULL;
+ }
+
/* We don't do stereo */
if (timing->stereo) {
xf86DrvMsg(scrnIndex, X_INFO,
diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c
index 4ce585c9f..21984bc04 100644
--- a/hw/xfree86/ddc/xf86DDC.c
+++ b/hw/xfree86/ddc/xf86DDC.c
@@ -15,52 +15,6 @@
static const OptionInfoRec *DDCAvailableOptions(void *unused);
-#if DDC_MODULE
-
-static MODULESETUPPROTO(ddcSetup);
-
-static XF86ModuleVersionInfo ddcVersRec =
-{
- "ddc",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_VIDEODRV, /* needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-_X_EXPORT XF86ModuleData ddcModuleData = { &ddcVersRec, ddcSetup, NULL };
-
-ModuleInfoRec DDC = {
- 1,
- "DDC",
- NULL,
- 0,
- DDCAvailableOptions,
-};
-
-static pointer
-ddcSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- static Bool setupDone = FALSE;
-
- if (!setupDone) {
- setupDone = TRUE;
- xf86AddModuleInfo(&DDC, module);
- }
- /*
- * The return value must be non-NULL on success even though there
- * is no TearDownProc.
- */
- return (pointer)1;
-}
-
-#endif
-
#define RETRIES 4
static unsigned char *EDIDRead_DDC1(
@@ -337,6 +291,12 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
unsigned char *R_Buffer;
int i;
+ /*
+ * Slow down the bus so that older monitors don't
+ * miss things.
+ */
+ pBus->RiseFallTime = 20;
+
if (!(dev = xf86I2CFindDev(pBus, 0x00A0))) {
dev = xf86CreateI2CDevRec();
dev->DevName = "ddc2";
@@ -344,7 +304,6 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
dev->ByteTimeout = 2200; /* VESA DDC spec 3 p. 43 (+10 %) */
dev->StartTimeout = 550;
dev->BitTimeout = 40;
- dev->ByteTimeout = 40;
dev->AcknTimeout = 40;
dev->pI2CBus = pBus;
diff --git a/hw/xfree86/dixmods/extmod/dgaproc.h b/hw/xfree86/dixmods/extmod/dgaproc.h
index 5e424afb2..aaea4e20c 100644
--- a/hw/xfree86/dixmods/extmod/dgaproc.h
+++ b/hw/xfree86/dixmods/extmod/dgaproc.h
@@ -120,8 +120,9 @@ int DGAGetOldDGAMode(int Index);
int DGAGetModeInfo(int Index, XDGAModePtr mode, int num);
Bool DGAVTSwitch(void);
-Bool DGAStealMouseEvent(int Index, xEvent *e, int dx, int dy);
-Bool DGAStealKeyEvent(int Index, xEvent *e);
+Bool DGAStealButtonEvent(int Index, int button, int is_down);
+Bool DGAStealMotionEvent(int Index, int dx, int dy);
+Bool DGAStealKeyEvent(int Index, int key_code, int is_down);
Bool DGAIsDgaEvent (xEvent *e);
Bool DGADeliverEvent (ScreenPtr pScreen, xEvent *e);
diff --git a/hw/xfree86/dixmods/glxmodule.c b/hw/xfree86/dixmods/glxmodule.c
index 401707abc..5384f434b 100644
--- a/hw/xfree86/dixmods/glxmodule.c
+++ b/hw/xfree86/dixmods/glxmodule.c
@@ -95,8 +95,8 @@ __glXMesaProxyScreenProbe(ScreenPtr pScreen)
static __GLXprovider *provider;
if (provider == NULL) {
- GLcore = LoadSubModuleLocal(glxModule, "GLcore", NULL, NULL, NULL, NULL,
- NULL, NULL);
+ GLcore = LoadSubModule(glxModule, "GLcore", NULL, NULL, NULL, NULL,
+ NULL, NULL);
if (GLcore == NULL)
return NULL;
diff --git a/hw/xfree86/dixmods/xkbKillSrv.c b/hw/xfree86/dixmods/xkbKillSrv.c
index 415873ad0..b3399db4a 100644
--- a/hw/xfree86/dixmods/xkbKillSrv.c
+++ b/hw/xfree86/dixmods/xkbKillSrv.c
@@ -40,7 +40,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XI.h>
#include "xf86.h"
diff --git a/hw/xfree86/dixmods/xkbPrivate.c b/hw/xfree86/dixmods/xkbPrivate.c
index e6d4f0fc0..e0cd21739 100644
--- a/hw/xfree86/dixmods/xkbPrivate.c
+++ b/hw/xfree86/dixmods/xkbPrivate.c
@@ -12,7 +12,7 @@
#include <X11/X.h>
#include "windowstr.h"
#define XKBSRV_NEED_FILE_FUNCS
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include "xf86.h"
diff --git a/hw/xfree86/dixmods/xkbVT.c b/hw/xfree86/dixmods/xkbVT.c
index a1cdc7016..e6d69e2eb 100644
--- a/hw/xfree86/dixmods/xkbVT.c
+++ b/hw/xfree86/dixmods/xkbVT.c
@@ -40,7 +40,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XI.h>
#include "xf86.h"
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index bbba21112..cc60d0754 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -1004,12 +1004,22 @@ The
.B Identifier
entry specifies the unique name for this monitor. The
.B Monitor
-section provides information about the specifications of the monitor,
-monitor-specific
+section may be used to provide information about the specifications of the
+monitor, monitor-specific
.BR Options ,
-and information about the video modes to use with the monitor. Specifying
-video modes is optional because the server now has a built-in list of
-VESA standard modes. When modes are specified explicitly in the
+and information about the video modes to use with the monitor.
+.PP
+With RandR 1.2-enabled drivers, monitor sections are tied to specific outputs
+of the video card. Each output has a name, and the server will look for a
+Monitor named
+.B \*qMonitor-outputname\*q
+for configuration of that output (for example,
+.B \*qMonitor-VGA\*q
+for a VGA output)
+.PP
+Specifying video modes is optional because the server will use the DDC or other
+information provided by the monitor to automatically configure the list of
+modes available. When modes are specified explicitly in the
.B Monitor
section (with the
.BR Modes ,
@@ -1017,7 +1027,8 @@ section (with the
or
.B UseModes
keywords), built-in modes with the same names are not included. Built-in
-modes with different names are, however, still implicitly included.
+modes with different names are, however, still implicitly included, when they
+meet the requirements of the monitor.
.PP
The entries that may be used in
.B Monitor
@@ -1214,6 +1225,62 @@ monitors do not require it. The default is off.
This optional entry specifies the vertical refresh rate that the server
should aim for when selecting video modes. Without this option, the
default is to prefer modes with higher refresh rates.
+.TP 7
+.BI "Option " "\*qPreferredMode\*q " \*qstring\*q
+This optional entry specifies a mode to be marked as the preferred initial mode
+of the monitor.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qPosition\*q " "\*qx y\*q"
+This optional entry specifies the position of the monitor within the X
+screen.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qLeftOf\*q " \*qmonitor\*q
+This optional entry specifies that the monitor should be positioned to the
+left of the monitor of the given name.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qRightOf\*q " \*qmonitor\*q
+This optional entry specifies that the monitor should be positioned to the
+right of the monitor of the given name.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qAbove\*q " \*qmonitor\*q
+This optional entry specifies that the monitor should be positioned above the
+monitor of the given name.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qBelow\*q " \*qmonitor\*q
+This optional entry specifies that the monitor should be positioned below the
+monitor of the given name.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qEnable\*q " \*qbool\*q
+This optional entry specifies whether the monitor should be turned on
+at startup. By default, the server will attempt to enable all connected
+monitors.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qMinClock\*q " \*qfrequency\*q
+This optional entry specifies the minimum dot clock, in kHz, that is supported
+by the monitor.
+.TP 7
+.BI "Option " "\*qMaxClock\*q " \*qfrequency\*q
+This optional entry specifies the maximum dot clock, in kHz, that is supported
+by the monitor.
+.TP 7
+.BI "Option " "\*qIgnore\*q " \*qbool\*q
+This optional entry specifies that the monitor should be ignored entirely,
+and not reported through RandR. This is useful if the hardware reports the
+presence of outputs that don't exist.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qRotate\*q " \*qrotation\*q
+This optional entry specifies the initial rotation of the given monitor.
+Valid values for rotation are \*qnormal\*q, \*qleft\*q, \*qright\*q, and
+\*qinverted\*q.
+(RandR 1.2-supporting drivers only)
.SH MODES SECTION
The config file may have multiple
diff --git a/hw/xfree86/i2c/xf86i2cmodule.c b/hw/xfree86/i2c/xf86i2cmodule.c
deleted file mode 100644
index 3c6d313c7..000000000
--- a/hw/xfree86/i2c/xf86i2cmodule.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* (c) Itai Nahshon
- *
- * This code is derived from and inspired by the I2C driver
- * from the Linux kernel.
- * (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de>
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(i2cSetup);
-
-static XF86ModuleVersionInfo i2cVersRec =
-{
- "i2c",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- 1, 2, 0,
- ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-_X_EXPORT XF86ModuleData i2cModuleData = { &i2cVersRec, i2cSetup, NULL };
-
-static pointer
-i2cSetup(pointer module, pointer opts, int *errmaj, int *errmin) {
-/* ErrorF("i2cSetup\n"); */
- return (pointer)1;
-}
diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c
index 594bf4377..5d06b05c7 100644
--- a/hw/xfree86/loader/dixsym.c
+++ b/hw/xfree86/loader/dixsym.c
@@ -86,7 +86,7 @@
#endif
#include "selection.h"
#ifdef XKB
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
extern int XkbDfltRepeatDelay, XkbDfltRepeatInterval;
#endif
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index ddd624c2a..774a4c4a0 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -189,101 +189,6 @@ _LoaderListPop(int handle)
return 0;
}
-/*
- * _LoaderHandleToName() will return the name of the first module with a
- * given handle. This requires getting the last module on the LIFO with
- * the given handle.
- */
-char *
-_LoaderHandleToName(int handle)
-{
- loaderPtr item = listHead;
- loaderPtr aritem = NULL;
- loaderPtr lastitem = NULL;
-
- if (handle < 0) {
- return "(built-in)";
- }
- while (item) {
- if (item->handle == handle) {
- if (strchr(item->name, ':') == NULL)
- aritem = item;
- else
- lastitem = item;
- }
- item = item->next;
- }
-
- if (aritem)
- return aritem->name;
-
- if (lastitem)
- return lastitem->name;
-
- return 0;
-}
-
-/*
- * _LoaderHandleToCanonicalName() will return the cname of the first module
- * with a given handle. This requires getting the last module on the LIFO with
- * the given handle.
- */
-char *
-_LoaderHandleToCanonicalName(int handle)
-{
- loaderPtr item = listHead;
- loaderPtr lastitem = NULL;
-
- if (handle < 0) {
- return "(built-in)";
- }
- while (item) {
- if (item->handle == handle) {
- lastitem = item;
- }
- item = item->next;
- }
-
- if (lastitem)
- return lastitem->cname;
-
- return NULL;
-}
-
-/*
- * _LoaderModuleToName() will return the name of the first module with a
- * given handle. This requires getting the last module on the LIFO with
- * the given handle.
- */
-char *
-_LoaderModuleToName(int module)
-{
- loaderPtr item = listHead;
- loaderPtr aritem = NULL;
- loaderPtr lastitem = NULL;
-
- if (module < 0) {
- return "(built-in)";
- }
- while (item) {
- if (item->module == module) {
- if (strchr(item->name, ':') == NULL)
- aritem = item;
- else
- lastitem = item;
- }
- item = item->next;
- }
-
- if (aritem)
- return aritem->name;
-
- if (lastitem)
- return lastitem->name;
-
- return 0;
-}
-
/* These four are just ABI stubs */
_X_EXPORT void
LoaderRefSymbols(const char *sym0, ...)
@@ -450,35 +355,14 @@ LoaderUnload(int handle)
return 0;
}
-void
-LoaderDuplicateSymbol(const char *symbol, const int handle)
-{
- ErrorF("Duplicate symbol %s in %s\n", symbol,
- listHead ? listHead->name : "(built-in)");
- ErrorF("Also defined in %s\n", _LoaderHandleToName(handle));
- FatalError("Module load failure\n");
-}
-
unsigned long LoaderOptions = 0;
void
-LoaderResetOptions(void)
-{
- LoaderOptions = 0;
-}
-
-void
LoaderSetOptions(unsigned long opts)
{
LoaderOptions |= opts;
}
-void
-LoaderClearOptions(unsigned long opts)
-{
- LoaderOptions &= ~opts;
-}
-
_X_EXPORT int
LoaderGetABIVersion(const char *abiclass)
{
diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h
index ecbd6762d..b71ad4590 100644
--- a/hw/xfree86/loader/loaderProcs.h
+++ b/hw/xfree86/loader/loaderProcs.h
@@ -97,9 +97,6 @@ void LoadFont(FontModule *);
void UnloadModule(ModuleDescPtr);
void UnloadSubModule(ModuleDescPtr);
void UnloadDriver(ModuleDescPtr);
-void FreeModuleDesc(ModuleDescPtr mod);
-ModuleDescPtr NewModuleDesc(const char *);
-ModuleDescPtr AddSibling(ModuleDescPtr head, ModuleDescPtr new);
void LoaderSetPath(const char *path);
void LoaderSortExtensions(void);
@@ -108,7 +105,6 @@ unsigned long LoaderGetModuleVersion(ModuleDescPtr mod);
void LoaderResetOptions(void);
void LoaderSetOptions(unsigned long);
-void LoaderClearOptions(unsigned long);
/* Options for LoaderSetOptions */
#define LDR_OPT_ABI_MISMATCH_NONFATAL 0x0001
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index c220d8a61..db12da466 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -745,6 +745,13 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
return TRUE;
}
+static ModuleDescPtr
+AddSibling(ModuleDescPtr head, ModuleDescPtr new)
+{
+ new->sib = head;
+ return (new);
+}
+
_X_EXPORT ModuleDescPtr
LoadSubModule(ModuleDescPtr parent, const char *module,
const char **subdirlist, const char **patternlist,
@@ -775,35 +782,28 @@ LoadSubModule(ModuleDescPtr parent, const char *module,
return submod;
}
-ModuleDescPtr
-LoadSubModuleLocal(ModuleDescPtr parent, const char *module,
- const char **subdirlist, const char **patternlist,
- pointer options, const XF86ModReqInfo * modreq,
- int *errmaj, int *errmin)
+static ModuleDescPtr
+NewModuleDesc(const char *name)
{
- ModuleDescPtr submod;
-
- xf86MsgVerb(X_INFO, 3, "Loading local sub module \"%s\"\n", module);
+ ModuleDescPtr mdp = xalloc(sizeof(ModuleDesc));
- if (PathIsAbsolute(module))
- {
- xf86Msg(X_ERROR,
- "LoadSubModule: Absolute module path not permitted: \"%s\"\n",
- module);
- if (errmaj)
- *errmaj = LDR_BADUSAGE;
- if (errmin)
- *errmin = 0;
- return NULL;
+ if (mdp) {
+ mdp->child = NULL;
+ mdp->sib = NULL;
+ mdp->parent = NULL;
+ mdp->demand_next = NULL;
+ mdp->name = xstrdup(name);
+ mdp->filename = NULL;
+ mdp->identifier = NULL;
+ mdp->client_id = 0;
+ mdp->in_use = 0;
+ mdp->handle = -1;
+ mdp->SetupProc = NULL;
+ mdp->TearDownProc = NULL;
+ mdp->TearDownData = NULL;
}
- submod = doLoadModule(module, NULL, subdirlist, patternlist, options,
- modreq, errmaj, errmin, 0);
- if (submod && submod != (ModuleDescPtr) 1) {
- parent->child = AddSibling(parent->child, submod);
- submod->parent = parent;
- }
- return submod;
+ return (mdp);
}
_X_EXPORT ModuleDescPtr
@@ -869,7 +869,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
for (cim = compiled_in_modules; *cim; cim++)
if (!strcmp (module, *cim))
{
- xf86MsgVerb(X_INFO, 3, "Module alread ybuilt-in");
+ xf86MsgVerb(X_INFO, 3, "Module already built-in\n");
return (ModuleDescPtr) 1;
}
@@ -1099,26 +1099,12 @@ LoadModule(const char *module, const char *path, const char **subdirlist,
modreq, errmaj, errmin, LD_FLAG_GLOBAL);
}
-ModuleDescPtr
-LoadDriver(const char *module, const char *path, int handle, pointer options,
- int *errmaj, int *errmin)
-{
- return LoadModule(module, path, NULL, NULL, options, NULL, errmaj,
- errmin);
-}
-
void
UnloadModule(ModuleDescPtr mod)
{
UnloadModuleOrDriver(mod);
}
-void
-UnloadDriver(ModuleDescPtr mod)
-{
- UnloadModuleOrDriver(mod);
-}
-
static void
UnloadModuleOrDriver(ModuleDescPtr mod)
{
@@ -1168,7 +1154,7 @@ UnloadSubModule(ModuleDescPtr mod)
xfree(mod);
}
-void
+static void
FreeModuleDesc(ModuleDescPtr head)
{
ModuleDescPtr sibs, prev;
@@ -1177,7 +1163,7 @@ FreeModuleDesc(ModuleDescPtr head)
return;
/*
* only free it if it's not marked as in use. In use means that it may
- * be unloaded someday, and UnloadModule or UnloadDriver will free it
+ * be unloaded someday, and UnloadModule will free it
*/
if (head->in_use)
return;
@@ -1192,38 +1178,6 @@ FreeModuleDesc(ModuleDescPtr head)
}
}
-ModuleDescPtr
-NewModuleDesc(const char *name)
-{
- ModuleDescPtr mdp = xalloc(sizeof(ModuleDesc));
-
- if (mdp) {
- mdp->child = NULL;
- mdp->sib = NULL;
- mdp->parent = NULL;
- mdp->demand_next = NULL;
- mdp->name = xstrdup(name);
- mdp->filename = NULL;
- mdp->identifier = NULL;
- mdp->client_id = 0;
- mdp->in_use = 0;
- mdp->handle = -1;
- mdp->SetupProc = NULL;
- mdp->TearDownProc = NULL;
- mdp->TearDownData = NULL;
- }
-
- return (mdp);
-}
-
-ModuleDescPtr
-AddSibling(ModuleDescPtr head, ModuleDescPtr new)
-{
- new->sib = head;
- return (new);
-
-}
-
static void
RemoveChild(ModuleDescPtr child)
{
diff --git a/hw/xfree86/loader/misym.c b/hw/xfree86/loader/misym.c
index 46d6a024d..78ae10e02 100644
--- a/hw/xfree86/loader/misym.c
+++ b/hw/xfree86/loader/misym.c
@@ -208,9 +208,6 @@ _X_HIDDEN void *miLookupTab[] = {
#ifdef RENDER
SYMFUNC(miGlyphExtents)
#endif
-#ifdef COMPOSITE
- SYMFUNC(miDisableCompositeWrapper)
-#endif
#ifdef DAMAGE
SYMFUNC(DamageDamageRegion)
#endif
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index bc7c8148b..5175f01f9 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -1170,6 +1170,7 @@ _X_HIDDEN void *xfree86LookupTab[] = {
SYMVAR(pciNumBuses)
/* modes */
+ SYMVAR(xf86CrtcConfigPrivateIndex)
SYMFUNC(xf86CrtcConfigInit)
SYMFUNC(xf86CrtcConfigPrivateIndex)
SYMFUNC(xf86CrtcCreate)
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 1a4292092..7d86b6606 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -312,7 +312,13 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
{
xf86OutputPtr output = xf86_config->output[i];
if (output->crtc == crtc)
+ {
output->funcs->commit(output);
+#ifdef RANDR_12_INTERFACE
+ if (output->randr_output)
+ RRPostPendingProperties (output->randr_output);
+#endif
+ }
}
/* XXX free adjustedmode */
@@ -566,6 +572,36 @@ xf86CrtcCreateScreenResources (ScreenPtr screen)
}
/*
+ * Clean up config on server reset
+ */
+static Bool
+xf86CrtcCloseScreen (int index, ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o, c;
+
+ screen->CloseScreen = config->CloseScreen;
+
+ xf86RotateCloseScreen (screen);
+
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+
+ output->crtc = NULL;
+ output->randr_output = NULL;
+ }
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = config->crtc[c];
+
+ crtc->randr_crtc = NULL;
+ }
+ return screen->CloseScreen (index, screen);
+}
+
+/*
* Called at ScreenInit time to set up
*/
Bool
@@ -596,6 +632,10 @@ xf86CrtcScreenInit (ScreenPtr screen)
/* Wrap CreateScreenResources so we can initialize the RandR code */
config->CreateScreenResources = screen->CreateScreenResources;
screen->CreateScreenResources = xf86CrtcCreateScreenResources;
+
+ config->CloseScreen = screen->CloseScreen;
+ screen->CloseScreen = xf86CrtcCloseScreen;
+
return TRUE;
}
@@ -1555,6 +1595,8 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
{
crtc->desiredMode = *mode;
crtc->desiredRotation = output->initial_rotation;
+ crtc->desiredX = output->initial_x;
+ crtc->desiredY = output->initial_y;
crtc->enabled = TRUE;
crtc->x = output->initial_x;
crtc->y = output->initial_y;
@@ -1779,7 +1821,12 @@ xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation)
if (!xf86CrtcSetMode (crtc, crtc_mode, rotation, 0, 0))
ok = FALSE;
else
+ {
crtc->desiredMode = *crtc_mode;
+ crtc->desiredRotation = rotation;
+ crtc->desiredX = 0;
+ crtc->desiredY = 0;
+ }
}
xf86DisableUnusedFunctions(pScrn);
return ok;
@@ -1889,7 +1936,7 @@ xf86OutputSetEDIDProperty (xf86OutputPtr output, void *data, int data_len)
if (data_len != 0) {
RRChangeOutputProperty(output->randr_output, edid_atom, XA_INTEGER, 8,
- PropModeReplace, data_len, data, FALSE);
+ PropModeReplace, data_len, data, FALSE, TRUE);
} else {
RRDeleteOutputProperty(output->randr_output, edid_atom);
}
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index b7515928e..42daf6079 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -544,6 +544,8 @@ typedef struct _xf86CrtcConfig {
CreateScreenResourcesProcPtr CreateScreenResources;
+ CloseScreenProcPtr CloseScreen;
+
/* Cursor information */
xf86CursorInfoPtr cursor_info;
CursorPtr cursor;
@@ -593,6 +595,12 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
Bool
xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation);
+/*
+ * Clean up rotation during CloseScreen
+ */
+void
+xf86RotateCloseScreen (ScreenPtr pScreen);
+
/**
* Return whether any output is assigned to the crtc
*/
diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index c4cf6870b..7a8ec1935 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -197,6 +197,19 @@ DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing,
{
DisplayModePtr Mode;
+ /*
+ * Refuse to create modes that are insufficiently large. 64 is a random
+ * number, maybe the spec says something about what the minimum is. In
+ * particular I see this frequently with _old_ EDID, 1.0 or so, so maybe
+ * our parser is just being too aggresive there.
+ */
+ if (timing->h_active < 64 || timing->v_active < 64) {
+ xf86DrvMsg(scrnIndex, X_INFO,
+ "%s: Ignoring tiny %dx%d mode\n", __func__,
+ timing->h_active, timing->v_active);
+ return NULL;
+ }
+
/* We don't do stereo */
if (timing->stereo) {
xf86DrvMsg(scrnIndex, X_INFO,
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 5e8225e54..13437a5a5 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -557,6 +557,56 @@ xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y)
}
#if RANDR_12_INTERFACE
+
+#define FLAG_BITS (RR_HSyncPositive | \
+ RR_HSyncNegative | \
+ RR_VSyncPositive | \
+ RR_VSyncNegative | \
+ RR_Interlace | \
+ RR_DoubleScan | \
+ RR_CSync | \
+ RR_CSyncPositive | \
+ RR_CSyncNegative | \
+ RR_HSkewPresent | \
+ RR_BCast | \
+ RR_PixelMultiplex | \
+ RR_DoubleClock | \
+ RR_ClockDivideBy2)
+
+static Bool
+xf86RandRModeMatches (RRModePtr randr_mode,
+ DisplayModePtr mode)
+{
+#if 0
+ if (match_name)
+ {
+ /* check for same name */
+ int len = strlen (mode->name);
+ if (randr_mode->mode.nameLength != len) return FALSE;
+ if (memcmp (randr_mode->name, mode->name, len) != 0) return FALSE;
+ }
+#endif
+
+ /* check for same timings */
+ if (randr_mode->mode.dotClock / 1000 != mode->Clock) return FALSE;
+ if (randr_mode->mode.width != mode->HDisplay) return FALSE;
+ if (randr_mode->mode.hSyncStart != mode->HSyncStart) return FALSE;
+ if (randr_mode->mode.hSyncEnd != mode->HSyncEnd) return FALSE;
+ if (randr_mode->mode.hTotal != mode->HTotal) return FALSE;
+ if (randr_mode->mode.hSkew != mode->HSkew) return FALSE;
+ if (randr_mode->mode.height != mode->VDisplay) return FALSE;
+ if (randr_mode->mode.vSyncStart != mode->VSyncStart) return FALSE;
+ if (randr_mode->mode.vSyncEnd != mode->VSyncEnd) return FALSE;
+ if (randr_mode->mode.vTotal != mode->VTotal) return FALSE;
+
+ /* check for same flags (using only the XF86 valid flag bits) */
+ if ((randr_mode->mode.modeFlags & FLAG_BITS) != (mode->Flags & FLAG_BITS))
+ return FALSE;
+
+ /* everything matches */
+ return TRUE;
+}
+
static Bool
xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc)
{
@@ -595,12 +645,15 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc)
* We make copies of modes, so pointer equality
* isn't sufficient
*/
- for (j = 0; j < randr_output->numModes; j++)
+ for (j = 0; j < randr_output->numModes + randr_output->numUserModes; j++)
{
- DisplayModePtr outMode = randr_output->modes[j]->devPrivate;
- if (xf86ModesEqual(mode, outMode))
+ RRModePtr m = (j < randr_output->numModes ?
+ randr_output->modes[j] :
+ randr_output->userModes[j-randr_output->numModes]);
+
+ if (xf86RandRModeMatches (m, mode))
{
- randr_mode = randr_output->modes[j];
+ randr_mode = m;
break;
}
}
@@ -612,6 +665,39 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc)
return ret;
}
+/*
+ * Convert a RandR mode to a DisplayMode
+ */
+static void
+xf86RandRModeConvert (ScrnInfoPtr scrn,
+ RRModePtr randr_mode,
+ DisplayModePtr mode)
+{
+ mode->prev = NULL;
+ mode->next = NULL;
+ mode->name = NULL;
+ mode->status = MODE_OK;
+ mode->type = 0;
+
+ mode->Clock = randr_mode->mode.dotClock / 1000;
+
+ mode->HDisplay = randr_mode->mode.width;
+ mode->HSyncStart = randr_mode->mode.hSyncStart;
+ mode->HSyncEnd = randr_mode->mode.hSyncEnd;
+ mode->HTotal = randr_mode->mode.hTotal;
+ mode->HSkew = randr_mode->mode.hSkew;
+
+ mode->VDisplay = randr_mode->mode.height;
+ mode->VSyncStart = randr_mode->mode.vSyncStart;
+ mode->VSyncEnd = randr_mode->mode.vSyncEnd;
+ mode->VTotal = randr_mode->mode.vTotal;
+ mode->VScan = 0;
+
+ mode->Flags = randr_mode->mode.modeFlags & FLAG_BITS;
+
+ xf86SetModeCrtc (mode, scrn->adjustFlags);
+}
+
static Bool
xf86RandR12CrtcSet (ScreenPtr pScreen,
RRCrtcPtr randr_crtc,
@@ -625,16 +711,15 @@ xf86RandR12CrtcSet (ScreenPtr pScreen,
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
xf86CrtcPtr crtc = randr_crtc->devPrivate;
- DisplayModePtr mode = randr_mode ? randr_mode->devPrivate : NULL;
Bool changed = FALSE;
int o, ro;
xf86CrtcPtr *save_crtcs;
Bool save_enabled = crtc->enabled;
save_crtcs = ALLOCATE_LOCAL(config->num_crtc * sizeof (xf86CrtcPtr));
- if ((mode != NULL) != crtc->enabled)
+ if ((randr_mode != NULL) != crtc->enabled)
changed = TRUE;
- else if (mode && !xf86ModesEqual (&crtc->mode, mode))
+ else if (randr_mode && !xf86RandRModeMatches (randr_mode, &crtc->mode))
changed = TRUE;
if (rotation != crtc->rotation)
@@ -668,11 +753,14 @@ xf86RandR12CrtcSet (ScreenPtr pScreen,
/* XXX need device-independent mode setting code through an API */
if (changed)
{
- crtc->enabled = mode != NULL;
+ crtc->enabled = randr_mode != NULL;
- if (mode)
+ if (randr_mode)
{
- if (!xf86CrtcSetMode (crtc, mode, rotation, x, y))
+ DisplayModeRec mode;
+
+ xf86RandRModeConvert (pScrn, randr_mode, &mode);
+ if (!xf86CrtcSetMode (crtc, &mode, rotation, x, y))
{
crtc->enabled = save_enabled;
for (o = 0; o < config->num_output; o++)
@@ -686,7 +774,7 @@ xf86RandR12CrtcSet (ScreenPtr pScreen,
/*
* Save the last successful setting for EnterVT
*/
- crtc->desiredMode = *mode;
+ crtc->desiredMode = mode;
crtc->desiredRotation = rotation;
crtc->desiredX = x;
crtc->desiredY = y;
@@ -729,6 +817,26 @@ xf86RandR12OutputSetProperty (ScreenPtr pScreen,
return output->funcs->set_property(output, property, value);
}
+static Bool
+xf86RandR12OutputValidateMode (ScreenPtr pScreen,
+ RROutputPtr randr_output,
+ RRModePtr randr_mode)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ xf86OutputPtr output = randr_output->devPrivate;
+ DisplayModeRec mode;
+
+ xf86RandRModeConvert (pScrn, randr_mode, &mode);
+ if (output->funcs->mode_valid (output, &mode) != MODE_OK)
+ return FALSE;
+ return TRUE;
+}
+
+static void
+xf86RandR12ModeDestroy (ScreenPtr pScreen, RRModePtr randr_mode)
+{
+}
+
/**
* Given a list of xf86 modes and a RandR Output object, construct
* RandR modes and assign them to the output
@@ -775,7 +883,6 @@ xf86RROutputSetModes (RROutputPtr randr_output, DisplayModePtr modes)
rrmode = RRModeGet (&modeInfo, mode->name);
if (rrmode) {
- rrmode->devPrivate = mode;
rrmodes[nmode++] = rrmode;
npreferred += pref;
}
@@ -905,8 +1012,7 @@ xf86RandR12CreateObjects12 (ScreenPtr pScreen)
{
xf86CrtcPtr crtc = config->crtc[c];
- crtc->randr_crtc = RRCrtcCreate (crtc);
- RRCrtcAttachScreen (crtc->randr_crtc, pScreen);
+ crtc->randr_crtc = RRCrtcCreate (pScreen, crtc);
RRCrtcGammaSetSize (crtc->randr_crtc, 256);
}
/*
@@ -916,13 +1022,13 @@ xf86RandR12CreateObjects12 (ScreenPtr pScreen)
{
xf86OutputPtr output = config->output[o];
- output->randr_output = RROutputCreate (output->name,
+ output->randr_output = RROutputCreate (pScreen, output->name,
strlen (output->name),
output);
- RROutputAttachScreen (output->randr_output, pScreen);
if (output->funcs->create_resources != NULL)
output->funcs->create_resources(output);
+ RRPostPendingProperties (output->randr_output);
}
return TRUE;
}
@@ -959,6 +1065,8 @@ xf86RandR12Init12 (ScreenPtr pScreen)
rp->rrCrtcSet = xf86RandR12CrtcSet;
rp->rrCrtcSetGamma = xf86RandR12CrtcSetGamma;
rp->rrOutputSetProperty = xf86RandR12OutputSetProperty;
+ rp->rrOutputValidateMode = xf86RandR12OutputValidateMode;
+ rp->rrModeDestroy = xf86RandR12ModeDestroy;
rp->rrSetConfig = NULL;
pScrn->PointerMoved = xf86RandR12PointerMoved;
if (!xf86RandR12CreateObjects12 (pScreen))
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index e82b69e1b..e8fafd073 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -321,36 +321,68 @@ xf86RotateWakeupHandler(pointer data, int i, pointer LastSelectMask)
{
}
-Bool
-xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation)
+static void
+xf86RotateDestroy (xf86CrtcPtr crtc)
{
ScrnInfoPtr pScrn = crtc->scrn;
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
ScreenPtr pScreen = pScrn->pScreen;
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ int c;
- if (rotation == RR_Rotate_0)
+ /* Free memory from rotation */
+ if (crtc->rotatedPixmap || crtc->rotatedData)
{
- /* Free memory from rotation */
+ crtc->funcs->shadow_destroy (crtc, crtc->rotatedPixmap, crtc->rotatedData);
+ crtc->rotatedPixmap = NULL;
+ crtc->rotatedData = NULL;
+ }
+
+ for (c = 0; c < xf86_config->num_crtc; c++)
if (crtc->rotatedPixmap || crtc->rotatedData)
- {
- crtc->funcs->shadow_destroy (crtc, crtc->rotatedPixmap, crtc->rotatedData);
- crtc->rotatedPixmap = NULL;
- crtc->rotatedData = NULL;
- }
+ return;
- if (xf86_config->rotation_damage)
+ /*
+ * Clean up damage structures when no crtcs are rotated
+ */
+ if (xf86_config->rotation_damage)
+ {
+ /* Free damage structure */
+ if (xf86_config->rotation_damage_registered)
{
- /* Free damage structure */
DamageUnregister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
xf86_config->rotation_damage);
xf86_config->rotation_damage_registered = FALSE;
- DamageDestroy (xf86_config->rotation_damage);
- xf86_config->rotation_damage = NULL;
- /* Free block/wakeup handler */
- RemoveBlockAndWakeupHandlers (xf86RotateBlockHandler,
- xf86RotateWakeupHandler,
- (pointer) pScreen);
}
+ DamageDestroy (xf86_config->rotation_damage);
+ xf86_config->rotation_damage = NULL;
+ /* Free block/wakeup handler */
+ RemoveBlockAndWakeupHandlers (xf86RotateBlockHandler,
+ xf86RotateWakeupHandler,
+ (pointer) pScreen);
+ }
+}
+
+void
+xf86RotateCloseScreen (ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+ int c;
+
+ for (c = 0; c < xf86_config->num_crtc; c++)
+ xf86RotateDestroy (xf86_config->crtc[c]);
+}
+
+Bool
+xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation)
+{
+ ScrnInfoPtr pScrn = crtc->scrn;
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ ScreenPtr pScreen = pScrn->pScreen;
+
+ if (rotation == RR_Rotate_0)
+ {
+ xf86RotateDestroy (crtc);
}
else
{
diff --git a/hw/xfree86/os-support/shared/libc_wrapper.c b/hw/xfree86/os-support/shared/libc_wrapper.c
index 4c4af4c24..a459d5d70 100644
--- a/hw/xfree86/os-support/shared/libc_wrapper.c
+++ b/hw/xfree86/os-support/shared/libc_wrapper.c
@@ -628,7 +628,7 @@ typedef struct _xf86_file_ {
char* fname;
} XF86FILE_priv;
-XF86FILE_priv stdhnd[3] = {
+static XF86FILE_priv stdhnd[3] = {
{ 0, XF86FILE_magic, NULL, "$stdinp$" },
{ 0, XF86FILE_magic, NULL, "$stdout$" },
{ 0, XF86FILE_magic, NULL, "$stderr$" }
diff --git a/hw/xfree86/parser/DRI.c b/hw/xfree86/parser/DRI.c
index dc75cd23f..18644bcc7 100644
--- a/hw/xfree86/parser/DRI.c
+++ b/hw/xfree86/parser/DRI.c
@@ -48,7 +48,21 @@ static xf86ConfigSymTabRec DRITab[] =
#define CLEANUP xf86freeBuffersList
-XF86ConfBuffersPtr
+static void
+xf86freeBuffersList (XF86ConfBuffersPtr ptr)
+{
+ XF86ConfBuffersPtr prev;
+
+ while (ptr) {
+ TestFree (ptr->buf_flags);
+ TestFree (ptr->buf_comment);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+static XF86ConfBuffersPtr
xf86parseBuffers (void)
{
int token;
@@ -169,18 +183,3 @@ xf86freeDRI (XF86ConfDRIPtr ptr)
TestFree (ptr->dri_comment);
xf86conffree (ptr);
}
-
-void
-xf86freeBuffersList (XF86ConfBuffersPtr ptr)
-{
- XF86ConfBuffersPtr prev;
-
- while (ptr) {
- TestFree (ptr->buf_flags);
- TestFree (ptr->buf_comment);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
diff --git a/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c
index 7ab70d1a8..4adea1ade 100644
--- a/hw/xfree86/parser/Flags.c
+++ b/hw/xfree86/parser/Flags.c
@@ -441,15 +441,6 @@ xf86uLongToString(unsigned long i)
return s;
}
-void
-xf86debugListOptions(XF86OptionPtr Options)
-{
- while (Options) {
- ErrorF("Option: %s Value: %s\n",Options->opt_name,Options->opt_val);
- Options = Options->list.next;
- }
-}
-
XF86OptionPtr
xf86parseOption(XF86OptionPtr head)
{
diff --git a/hw/xfree86/parser/Layout.c b/hw/xfree86/parser/Layout.c
index b9f4e9e6a..5d1348acb 100644
--- a/hw/xfree86/parser/Layout.c
+++ b/hw/xfree86/parser/Layout.c
@@ -382,24 +382,7 @@ xf86printLayoutSection (FILE * cf, XF86ConfLayoutPtr ptr)
}
}
-void
-xf86freeLayoutList (XF86ConfLayoutPtr ptr)
-{
- XF86ConfLayoutPtr prev;
-
- while (ptr)
- {
- TestFree (ptr->lay_identifier);
- TestFree (ptr->lay_comment);
- xf86freeAdjacencyList (ptr->lay_adjacency_lst);
- xf86freeInputrefList (ptr->lay_input_lst);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
-void
+static void
xf86freeAdjacencyList (XF86ConfAdjacencyPtr ptr)
{
XF86ConfAdjacencyPtr prev;
@@ -419,7 +402,7 @@ xf86freeAdjacencyList (XF86ConfAdjacencyPtr ptr)
}
-void
+static void
xf86freeInputrefList (XF86ConfInputrefPtr ptr)
{
XF86ConfInputrefPtr prev;
@@ -435,6 +418,23 @@ xf86freeInputrefList (XF86ConfInputrefPtr ptr)
}
+void
+xf86freeLayoutList (XF86ConfLayoutPtr ptr)
+{
+ XF86ConfLayoutPtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->lay_identifier);
+ TestFree (ptr->lay_comment);
+ xf86freeAdjacencyList (ptr->lay_adjacency_lst);
+ xf86freeInputrefList (ptr->lay_input_lst);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
#define CheckScreen(str, ptr)\
if (str[0] != '\0') \
{ \
diff --git a/hw/xfree86/parser/Module.c b/hw/xfree86/parser/Module.c
index f3ed9d19f..81eff18ae 100644
--- a/hw/xfree86/parser/Module.c
+++ b/hw/xfree86/parser/Module.c
@@ -83,7 +83,7 @@ static xf86ConfigSymTabRec ModuleTab[] =
#define CLEANUP xf86freeModules
-XF86LoadPtr
+static XF86LoadPtr
xf86parseModuleSubSection (XF86LoadPtr head, char *name)
{
int token;
diff --git a/hw/xfree86/parser/Monitor.c b/hw/xfree86/parser/Monitor.c
index 9dd0b1b1c..4bff4b23b 100644
--- a/hw/xfree86/parser/Monitor.c
+++ b/hw/xfree86/parser/Monitor.c
@@ -124,7 +124,21 @@ static xf86ConfigSymTabRec ModeTab[] =
#define CLEANUP xf86freeModeLineList
-XF86ConfModeLinePtr
+static void
+xf86freeModeLineList (XF86ConfModeLinePtr ptr)
+{
+ XF86ConfModeLinePtr prev;
+ while (ptr)
+ {
+ TestFree (ptr->ml_identifier);
+ TestFree (ptr->ml_comment);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+static XF86ConfModeLinePtr
xf86parseModeLine (void)
{
int token;
@@ -253,7 +267,7 @@ xf86parseModeLine (void)
return (ptr);
}
-XF86ConfModeLinePtr
+static XF86ConfModeLinePtr
xf86parseVerboseMode (void)
{
int token, token2;
@@ -830,20 +844,6 @@ xf86freeModesList (XF86ConfModesPtr ptr)
}
}
-void
-xf86freeModeLineList (XF86ConfModeLinePtr ptr)
-{
- XF86ConfModeLinePtr prev;
- while (ptr)
- {
- TestFree (ptr->ml_identifier);
- TestFree (ptr->ml_comment);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
XF86ConfMonitorPtr
xf86findMonitor (const char *ident, XF86ConfMonitorPtr p)
{
diff --git a/hw/xfree86/parser/Screen.c b/hw/xfree86/parser/Screen.c
index b7a64b035..79e1d24ef 100644
--- a/hw/xfree86/parser/Screen.c
+++ b/hw/xfree86/parser/Screen.c
@@ -83,7 +83,7 @@ static xf86ConfigSymTabRec DisplayTab[] =
#define CLEANUP xf86freeDisplayList
-XF86ConfDisplayPtr
+static XF86ConfDisplayPtr
xf86parseDisplaySubSection (void)
{
int token;
diff --git a/hw/xfree86/parser/Vendor.c b/hw/xfree86/parser/Vendor.c
index 3e9358b3b..d1e608067 100644
--- a/hw/xfree86/parser/Vendor.c
+++ b/hw/xfree86/parser/Vendor.c
@@ -75,7 +75,7 @@ static xf86ConfigSymTabRec VendorSubTab[] =
#define CLEANUP xf86freeVendorSubList
-XF86ConfVendSubPtr
+static XF86ConfVendSubPtr
xf86parseVendorSubSection (void)
{
int has_ident = FALSE;
@@ -242,16 +242,3 @@ xf86freeVendorSubList (XF86ConfVendSubPtr ptr)
xf86conffree (prev);
}
}
-
-XF86ConfVendorPtr
-xf86findVendor (const char *name, XF86ConfVendorPtr list)
-{
- while (list)
- {
- if (xf86nameCompare (list->vnd_identifier, name) == 0)
- return (list);
- list = list->list.next;
- }
- return (NULL);
-}
-
diff --git a/hw/xfree86/parser/Video.c b/hw/xfree86/parser/Video.c
index fa0ff7833..a8912cf44 100644
--- a/hw/xfree86/parser/Video.c
+++ b/hw/xfree86/parser/Video.c
@@ -74,7 +74,23 @@ static xf86ConfigSymTabRec VideoPortTab[] =
#define CLEANUP xf86freeVideoPortList
-XF86ConfVideoPortPtr
+static void
+xf86freeVideoPortList (XF86ConfVideoPortPtr ptr)
+{
+ XF86ConfVideoPortPtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->vp_identifier);
+ TestFree (ptr->vp_comment);
+ xf86optionListFree (ptr->vp_option_lst);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+static XF86ConfVideoPortPtr
xf86parseVideoPortSubSection (void)
{
int has_ident = FALSE;
@@ -266,22 +282,6 @@ xf86freeVideoAdaptorList (XF86ConfVideoAdaptorPtr ptr)
}
}
-void
-xf86freeVideoPortList (XF86ConfVideoPortPtr ptr)
-{
- XF86ConfVideoPortPtr prev;
-
- while (ptr)
- {
- TestFree (ptr->vp_identifier);
- TestFree (ptr->vp_comment);
- xf86optionListFree (ptr->vp_option_lst);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
XF86ConfVideoAdaptorPtr
xf86findVideoAdaptor (const char *ident, XF86ConfVideoAdaptorPtr p)
{
diff --git a/hw/xfree86/parser/configProcs.h b/hw/xfree86/parser/configProcs.h
index 0b989054b..3c9ce7a83 100644
--- a/hw/xfree86/parser/configProcs.h
+++ b/hw/xfree86/parser/configProcs.h
@@ -49,30 +49,23 @@ int xf86validateInput (XF86ConfigPtr p);
XF86ConfLayoutPtr xf86parseLayoutSection(void);
void xf86printLayoutSection(FILE *cf, XF86ConfLayoutPtr ptr);
void xf86freeLayoutList(XF86ConfLayoutPtr ptr);
-void xf86freeAdjacencyList(XF86ConfAdjacencyPtr ptr);
-void xf86freeInputrefList(XF86ConfInputrefPtr ptr);
int xf86validateLayout(XF86ConfigPtr p);
/* Module.c */
-XF86LoadPtr xf86parseModuleSubSection(XF86LoadPtr head, char *name);
XF86ConfModulePtr xf86parseModuleSection(void);
void xf86printModuleSection(FILE *cf, XF86ConfModulePtr ptr);
XF86LoadPtr xf86addNewLoadDirective(XF86LoadPtr head, char *name, int type, XF86OptionPtr opts);
void xf86freeModules(XF86ConfModulePtr ptr);
/* Monitor.c */
-XF86ConfModeLinePtr xf86parseModeLine(void);
-XF86ConfModeLinePtr xf86parseVerboseMode(void);
XF86ConfMonitorPtr xf86parseMonitorSection(void);
XF86ConfModesPtr xf86parseModesSection(void);
void xf86printMonitorSection(FILE *cf, XF86ConfMonitorPtr ptr);
void xf86printModesSection(FILE *cf, XF86ConfModesPtr ptr);
void xf86freeMonitorList(XF86ConfMonitorPtr ptr);
void xf86freeModesList(XF86ConfModesPtr ptr);
-void xf86freeModeLineList(XF86ConfModeLinePtr ptr);
int xf86validateMonitor(XF86ConfigPtr p, XF86ConfScreenPtr screen);
/* Pointer.c */
XF86ConfInputPtr xf86parsePointerSection(void);
/* Screen.c */
-XF86ConfDisplayPtr xf86parseDisplaySubSection(void);
XF86ConfScreenPtr xf86parseScreenSection(void);
void xf86printScreenSection(FILE *cf, XF86ConfScreenPtr ptr);
void xf86freeScreenList(XF86ConfScreenPtr ptr);
@@ -82,34 +75,25 @@ void xf86freeModeList(XF86ModePtr ptr);
int xf86validateScreen(XF86ConfigPtr p);
/* Vendor.c */
XF86ConfVendorPtr xf86parseVendorSection(void);
-XF86ConfVendSubPtr xf86parseVendorSubSection (void);
void xf86freeVendorList(XF86ConfVendorPtr p);
void xf86printVendorSection(FILE * cf, XF86ConfVendorPtr ptr);
void xf86freeVendorSubList (XF86ConfVendSubPtr ptr);
/* Video.c */
-XF86ConfVideoPortPtr xf86parseVideoPortSubSection(void);
XF86ConfVideoAdaptorPtr xf86parseVideoAdaptorSection(void);
void xf86printVideoAdaptorSection(FILE *cf, XF86ConfVideoAdaptorPtr ptr);
void xf86freeVideoAdaptorList(XF86ConfVideoAdaptorPtr ptr);
-void xf86freeVideoPortList(XF86ConfVideoPortPtr ptr);
-/* read.c */
-int xf86validateConfig(XF86ConfigPtr p);
/* scan.c */
-unsigned int xf86strToUL(char *str);
int xf86getToken(xf86ConfigSymTabRec *tab);
int xf86getSubToken(char **comment);
int xf86getSubTokenWithTab(char **comment, xf86ConfigSymTabRec *tab);
void xf86unGetToken(int token);
char *xf86tokenString(void);
void xf86parseError(char *format, ...);
-void xf86parseWarning(char *format, ...);
void xf86validationError(char *format, ...);
void xf86setSection(char *section);
int xf86getStringToken(xf86ConfigSymTabRec *tab);
/* write.c */
/* DRI.c */
-XF86ConfBuffersPtr xf86parseBuffers (void);
-void xf86freeBuffersList (XF86ConfBuffersPtr ptr);
XF86ConfDRIPtr xf86parseDRISection (void);
void xf86printDRISection (FILE * cf, XF86ConfDRIPtr ptr);
void xf86freeDRI (XF86ConfDRIPtr ptr);
diff --git a/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c
index b6b3bc377..9f79696ac 100644
--- a/hw/xfree86/parser/read.c
+++ b/hw/xfree86/parser/read.c
@@ -73,6 +73,25 @@ static xf86ConfigSymTabRec TopLevelTab[] =
#define CLEANUP xf86freeConfig
+/*
+ * This function resolves name references and reports errors if the named
+ * objects cannot be found.
+ */
+static int
+xf86validateConfig (XF86ConfigPtr p)
+{
+ if (!xf86validateDevice (p))
+ return FALSE;
+ if (!xf86validateScreen (p))
+ return FALSE;
+ if (!xf86validateInput (p))
+ return FALSE;
+ if (!xf86validateLayout (p))
+ return FALSE;
+
+ return (TRUE);
+}
+
XF86ConfigPtr
xf86readConfigFile (void)
{
@@ -219,25 +238,6 @@ xf86readConfigFile (void)
#undef CLEANUP
/*
- * This function resolves name references and reports errors if the named
- * objects cannot be found.
- */
-int
-xf86validateConfig (XF86ConfigPtr p)
-{
- if (!xf86validateDevice (p))
- return FALSE;
- if (!xf86validateScreen (p))
- return FALSE;
- if (!xf86validateInput (p))
- return FALSE;
- if (!xf86validateLayout (p))
- return FALSE;
-
- return (TRUE);
-}
-
-/*
* adds an item to the end of the linked list. Any record whose first field
* is a GenericListRec can be cast to this type and used with this function.
* A pointer to the head of the list is returned to handle the addition of
diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index f81c45afe..68e7ec650 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -116,7 +116,7 @@ extern char *__XOS2RedirRoot(char *path);
* A portable, but restricted, version of strtoul(). It only understands
* hex, octal, and decimal. But it's good enough for our needs.
*/
-unsigned int
+static unsigned int
xf86strToUL (char *str)
{
int base = 10;
@@ -922,20 +922,6 @@ xf86parseError (char *format,...)
}
void
-xf86parseWarning (char *format,...)
-{
- va_list ap;
-
- ErrorF ("Parse warning on line %d of section %s in file %s\n\t",
- configLineNo, configSection, configPath);
- va_start (ap, format);
- VErrorF (format, ap);
- va_end (ap);
-
- ErrorF ("\n");
-}
-
-void
xf86validationError (char *format,...)
{
va_list ap;
diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h
index a6829273c..89de97bbb 100644
--- a/hw/xfree86/parser/xf86Parser.h
+++ b/hw/xfree86/parser/xf86Parser.h
@@ -469,7 +469,6 @@ XF86ConfModeLinePtr xf86findModeLine(const char *ident, XF86ConfModeLinePtr p);
XF86ConfScreenPtr xf86findScreen(const char *ident, XF86ConfScreenPtr p);
XF86ConfInputPtr xf86findInput(const char *ident, XF86ConfInputPtr p);
XF86ConfInputPtr xf86findInputByDriver(const char *driver, XF86ConfInputPtr p);
-XF86ConfVendorPtr xf86findVendor(const char *name, XF86ConfVendorPtr list);
XF86ConfVideoAdaptorPtr xf86findVideoAdaptor(const char *ident,
XF86ConfVideoAdaptorPtr p);
diff --git a/hw/xfree86/ramdac/xf86RamDacMod.c b/hw/xfree86/ramdac/xf86RamDacMod.c
deleted file mode 100644
index b4187a953..000000000
--- a/hw/xfree86/ramdac/xf86RamDacMod.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 1998 by Alan Hourihane, Wigan, England.
- *
- * 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 Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE 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.
- *
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- *
- * Generic RAMDAC module.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Module.h"
-
-static XF86ModuleVersionInfo VersRec = {
- "ramdac",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- 0, 1, 0,
- ABI_CLASS_VIDEODRV,
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0, 0, 0, 0}
-};
-
-_X_EXPORT XF86ModuleData ramdacModuleData = { &VersRec, NULL, NULL };
diff --git a/hw/xfree86/xaa/Makefile.am b/hw/xfree86/xaa/Makefile.am
index 5d529b118..6ed8303a4 100644
--- a/hw/xfree86/xaa/Makefile.am
+++ b/hw/xfree86/xaa/Makefile.am
@@ -9,6 +9,7 @@ MSB_3_FIXED = mf3-xaaBitmap.c mf3-xaaStipple.c
POLYSEG = s-xaaLine.c s-xaaDashLine.c
libxaa_la_LDFLAGS = -avoid-version
+libxaa_la_LIBADD = $(top_builddir)/miext/cw/libcw.la
module_LTLIBRARIES = libxaa.la
libxaa_la_SOURCES = xaaInit.c xaaGC.c xaaInitAccel.c xaaFallback.c \
diff --git a/hw/xfree86/xaa/xaaDashLine.c b/hw/xfree86/xaa/xaaDashLine.c
index 2a94a9e6c..1a4732baa 100644
--- a/hw/xfree86/xaa/xaaDashLine.c
+++ b/hw/xfree86/xaa/xaaDashLine.c
@@ -35,7 +35,7 @@ XAAPolyLinesDashed(
#endif
){
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr;
+ XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGetGCIndex()].ptr;
BoxPtr pboxInit = REGION_RECTS(pGC->pCompositeClip);
int nboxInit = REGION_NUM_RECTS(pGC->pCompositeClip);
unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
diff --git a/hw/xfree86/xaa/xaaGC.c b/hw/xfree86/xaa/xaaGC.c
index e22081103..f3434c9f4 100644
--- a/hw/xfree86/xaa/xaaGC.c
+++ b/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);
diff --git a/hw/xfree86/xaa/xaaGCmisc.c b/hw/xfree86/xaa/xaaGCmisc.c
index f7bd576f1..a7a3f4081 100644
--- a/hw/xfree86/xaa/xaaGCmisc.c
+++ b/hw/xfree86/xaa/xaaGCmisc.c
@@ -305,7 +305,7 @@ XAAValidatePolylines(
DrawablePtr pDraw )
{
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr;
+ XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGetGCIndex()].ptr;
if(pGC->lineStyle == LineSolid) changes &= ~GCDashList;
if(!changes) return;
diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c
index 1542fc26e..529dbd151 100644
--- a/hw/xfree86/xaa/xaaInit.c
+++ b/hw/xfree86/xaa/xaaInit.c
@@ -42,14 +42,9 @@ static int XAASetDGAMode(int index, int num, DGADevicePtr devRet);
static void XAAEnableDisableFBAccess (int index, Bool enable);
static Bool XAAChangeWindowAttributes (WindowPtr pWin, unsigned long mask);
-/*
- * XXX These three should be static, but that breaks ABI compat with XF4.4
- * and Xorg 6.7.0 modules. DO NOT use them in new code, you should never
- * be setting them, and you've got Get functions below.
- */
-int XAAScreenIndex = -1;
-int XAAGCIndex = -1;
-int XAAPixmapIndex = -1;
+static int XAAScreenIndex = -1;
+static int XAAGCIndex = -1;
+static int XAAPixmapIndex = -1;
static unsigned long XAAGeneration = 0;
@@ -227,6 +222,14 @@ XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
if(infoRec->Flags & MICROSOFT_ZERO_LINE_BIAS)
miSetZeroLineBias(pScreen, OCTANT1 | OCTANT2 | OCTANT3 | OCTANT4);
+#ifdef COMPOSITE
+ /* Initialize the composite wrapper. This needs to happen after the
+ * wrapping above (so it comes before us), but before all other extensions,
+ * so it doesn't confuse them. (particularly damage).
+ */
+ miInitializeCompositeWrapper(pScreen);
+#endif
+
return TRUE;
}
diff --git a/hw/xfree86/xaa/xaaLineMisc.c b/hw/xfree86/xaa/xaaLineMisc.c
index d786737af..537b08b97 100644
--- a/hw/xfree86/xaa/xaaLineMisc.c
+++ b/hw/xfree86/xaa/xaaLineMisc.c
@@ -64,7 +64,7 @@ void
XAAComputeDash(GCPtr pGC)
{
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr;
+ XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGetGCIndex()].ptr;
Bool EvenDash = (pGC->numInDashList & 0x01) ? FALSE : TRUE;
int PatternLength = 0;
unsigned char* DashPtr = (unsigned char*)pGC->dash;
diff --git a/hw/xfree86/xaa/xaaWrapper.c b/hw/xfree86/xaa/xaaWrapper.c
index 5b525684a..6d8107b61 100644
--- a/hw/xfree86/xaa/xaaWrapper.c
+++ b/hw/xfree86/xaa/xaaWrapper.c
@@ -522,7 +522,7 @@ void
XAASync(ScreenPtr pScreen)
{
XAAScreenPtr pScreenPriv =
- (XAAScreenPtr) pScreen->devPrivates[XAAScreenIndex].ptr;
+ (XAAScreenPtr) pScreen->devPrivates[XAAGetScreenIndex()].ptr;
XAAInfoRecPtr infoRec = pScreenPriv->AccelInfoRec;
if(infoRec->NeedToSync) {
diff --git a/hw/xfree86/xaa/xaalocal.h b/hw/xfree86/xaa/xaalocal.h
index 7210d8492..c365a7de3 100644
--- a/hw/xfree86/xaa/xaalocal.h
+++ b/hw/xfree86/xaa/xaalocal.h
@@ -1640,9 +1640,6 @@ XAAGetPixelFromRGBA (
extern GCOps XAAFallbackOps;
extern GCOps *XAAGetFallbackOps(void);
extern GCFuncs XAAGCFuncs;
-extern int XAAScreenIndex; /* XXX DONTUSE */
-extern int XAAGCIndex; /* XXX DONTUSE */
-extern int XAAPixmapIndex; /* XXX DONTUSE */
extern int XAAGetScreenIndex(void);
extern int XAAGetGCIndex(void);
extern int XAAGetPixmapIndex(void);
diff --git a/hw/xfree86/xf4bpp/Makefile.am b/hw/xfree86/xf4bpp/Makefile.am
index 8fddb6b6a..5eab92f6f 100644
--- a/hw/xfree86/xf4bpp/Makefile.am
+++ b/hw/xfree86/xf4bpp/Makefile.am
@@ -20,7 +20,6 @@ libxf4bpp_la_SOURCES = \
ppcPixmap.c \
ppcPntWin.c \
ppcPolyPnt.c \
- ppcPolyRec.c \
ppcQuery.c \
ppcRslvC.c \
ppcSetSp.c \
diff --git a/hw/xfree86/xf4bpp/offscreen.c b/hw/xfree86/xf4bpp/offscreen.c
index f35bde7dd..654be829d 100644
--- a/hw/xfree86/xf4bpp/offscreen.c
+++ b/hw/xfree86/xf4bpp/offscreen.c
@@ -301,25 +301,6 @@ DoMono
}
void
-xf4bppOffDrawMonoImage( pWin, data, x, y, w, h, fg, alu, planes )
-WindowPtr pWin; /* GJA */
-unsigned char *data;
-int x, y, w, h ;
-unsigned long int fg ;
-int alu ;
-unsigned long int planes;
-{
-
- if ( ( alu == GXnoop ) || !( planes &= VGA_ALLPLANES ) )
- return ;
-
- DoMono( pWin, w, x, y, (const unsigned char *) data, h,
- w, ( ( w + 31 ) & ~31 ) >> 3, h, 0, 0, alu,
- (int)planes, (int)fg) ;
-
-}
-
-void
xf4bppOffFillStipple( pWin, pStipple, fg, alu, planes, x, y, w, h, xSrc, ySrc )
WindowPtr pWin; /* GJA */
register PixmapPtr const pStipple ;
diff --git a/hw/xfree86/xf4bpp/ppcGC.c b/hw/xfree86/xf4bpp/ppcGC.c
index 8153051f0..81441efd7 100644
--- a/hw/xfree86/xf4bpp/ppcGC.c
+++ b/hw/xfree86/xf4bpp/ppcGC.c
@@ -90,10 +90,9 @@ SOFTWARE.
| GCFunction | GCPlaneMask | GCFillStyle | GC_CALL_VALIDATE_BIT \
| GCClipXOrigin | GCClipYOrigin | GCClipMask | GCSubwindowMode )
+static void xf4bppValidateGC(GCPtr, unsigned long, DrawablePtr);
+static void xf4bppDestroyGC(GC *);
-/* GJA -- we modified the following function to get rid of
- * the records in file vgaData.c
- */
static GCFuncs vgaGCFuncs = {
xf4bppValidateGC,
(void (*)(GCPtr, unsigned long))NoopDDA,
@@ -196,7 +195,7 @@ register GCPtr pGC ;
return TRUE ;
}
-void
+static void
xf4bppDestroyGC( pGC )
register GC *pGC ;
@@ -292,7 +291,7 @@ return 0 ;
CT_other ==> pCompositeClip is the pixmap bounding box
*/
-void
+static void
xf4bppValidateGC( pGC, changes, pDrawable )
GCPtr pGC;
unsigned long changes;
diff --git a/hw/xfree86/xf4bpp/ppcPolyRec.c b/hw/xfree86/xf4bpp/ppcPolyRec.c
deleted file mode 100644
index d7f866232..000000000
--- a/hw/xfree86/xf4bpp/ppcPolyRec.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * 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 IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM 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.
- *
-*/
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-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 Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL 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.
-
-******************************************************************/
-/* $XConsortium: ppcPolyRec.c /main/4 1996/02/21 17:58:11 kaleb $ */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf4bpp.h"
-
-void
-xf4bppPolyRectangle(pDraw, pGC, nrects, pRects)
- DrawablePtr pDraw;
- GCPtr pGC;
- int nrects;
- xRectangle *pRects;
-{
- int i;
- xRectangle *pR = pRects;
- xRectangle *tmprects, *tmprectsinit;
- int lw, fs, ss;
-
- if ( ! ( tmprectsinit = tmprects = (xRectangle *)ALLOCATE_LOCAL( ( sizeof ( xRectangle ) * nrects ) << 2 ) ) )
- return;
-
- lw = pGC->lineWidth;
- ss = lw >> 1; /* skinny side of line */
- fs = ( lw + 1 ) >> 1; /* fat side of line */
-
- for (i=0; i<nrects; i++)
- {
- tmprects->x = pR->x - ss;
- tmprects->y = pR->y - ss;
- tmprects->width = pR->width + lw;
- tmprects->height = lw;
- tmprects++;
-
- tmprects->x = pR->x - ss;
- tmprects->y = pR->y + fs;
- tmprects->width = lw;
- tmprects->height = pR->height - lw;
- tmprects++;
-
- tmprects->x = pR->x + pR->width - ss;
- tmprects->y = pR->y + fs;
- tmprects->width = lw;
- tmprects->height = pR->height - lw;
- tmprects++;
-
- tmprects->x = pR->x - ss;
- tmprects->y = pR->y + pR->height - ss;
- tmprects->width = pR->width + lw;
- tmprects->height = lw;
- tmprects++;
-
- pR++;
- }
-
- (* pGC->ops->PolyFillRect)( pDraw, pGC, nrects << 2, tmprectsinit );
-
- DEALLOCATE_LOCAL( tmprectsinit );
- return ;
-}
diff --git a/hw/xfree86/xf4bpp/xf4bpp.h b/hw/xfree86/xf4bpp/xf4bpp.h
index 8d2da35a5..01512a8fb 100644
--- a/hw/xfree86/xf4bpp/xf4bpp.h
+++ b/hw/xfree86/xf4bpp/xf4bpp.h
@@ -149,14 +149,6 @@ void xf4bppTilePixmapFS(
Bool xf4bppCreateGC(
GCPtr
);
-void xf4bppDestroyGC(
- GC *
-);
-void xf4bppValidateGC(
- GCPtr,
- unsigned long,
- DrawablePtr
-);
/* ppcGetSp.c */
void xf4bppGetSpans(
diff --git a/hw/xgl/egl/kinput.c b/hw/xgl/egl/kinput.c
index b374bf580..5fd23f568 100644
--- a/hw/xgl/egl/kinput.c
+++ b/hw/xgl/egl/kinput.c
@@ -41,7 +41,7 @@
#ifdef XKB
#define XKB_IN_SERVER
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
static DeviceIntPtr pKdKeyboard, pKdPointer;
diff --git a/hw/xgl/glx/xglx.c b/hw/xgl/glx/xglx.c
index 57cb84702..92974f0d4 100644
--- a/hw/xgl/glx/xglx.c
+++ b/hw/xgl/glx/xglx.c
@@ -50,7 +50,7 @@
#ifdef XKB
#include <X11/extensions/XKB.h>
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XKBconfig.h>
extern Bool
diff --git a/hw/xnest/Display.c b/hw/xnest/Display.c
index 57f3a688f..1ec0609d9 100644
--- a/hw/xnest/Display.c
+++ b/hw/xnest/Display.c
@@ -39,7 +39,7 @@ XVisualInfo *xnestVisuals;
int xnestNumVisuals;
int xnestDefaultVisualIndex;
Colormap *xnestDefaultColormaps;
-int xnestNumDefaultColormaps;
+static int xnestNumDefaultColormaps;
int *xnestDepths;
int xnestNumDepths;
XPixmapFormatValues *xnestPixmapFormats;
diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c
index 0dacae70b..bb3cb1376 100644
--- a/hw/xnest/Keyboard.c
+++ b/hw/xnest/Keyboard.c
@@ -36,7 +36,7 @@ is" without express or implied warranty.
#ifdef XKB
#include <X11/extensions/XKB.h>
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XKBconfig.h>
extern Bool
diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c
index e6870e702..e66b4f743 100644
--- a/hw/xnest/Screen.c
+++ b/hw/xnest/Screen.c
@@ -49,7 +49,7 @@ Window xnestScreenSaverWindows[MAXSCREENS];
extern void GlxWrapInitVisuals(miInitVisualsProcPtr *);
#endif
-int xnestScreenGeneration = -1;
+static int xnestScreenGeneration = -1;
ScreenPtr
xnestScreen(Window window)
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 39a5eda7f..9457c9cc7 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -44,7 +44,7 @@ from The Open Group.
#include <mntent.h>
#endif
#if defined(XKB) && defined(WIN32)
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
#ifdef RELOCATE_PROJECTROOT
#include <shlobj.h>
diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c
index e3d18083e..2c1877172 100644
--- a/hw/xwin/winconfig.c
+++ b/hw/xwin/winconfig.c
@@ -40,7 +40,7 @@
#ifndef XKB_IN_SERVER
#define XKB_IN_SERVER
#endif
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
#ifdef XWIN_XF86CONFIG
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index 164e39160..d574f2053 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -44,7 +44,7 @@
#ifndef XKB_IN_SERVER
#define XKB_IN_SERVER
#endif
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
static Bool g_winKeyState[NUM_KEYCODES];