diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/darwin/Makefile.am | 6 | ||||
-rw-r--r-- | hw/dmx/Makefile.am | 7 | ||||
-rw-r--r-- | hw/dmx/dmxcursor.c | 133 | ||||
-rw-r--r-- | hw/dmx/dmxinput.c | 3 | ||||
-rw-r--r-- | hw/dmx/dmxinput.h | 2 | ||||
-rw-r--r-- | hw/dmx/input/dmxbackend.c | 20 | ||||
-rw-r--r-- | hw/dmx/input/dmxcommon.c | 16 | ||||
-rw-r--r-- | hw/dmx/input/dmxconsole.c | 9 | ||||
-rw-r--r-- | hw/dmx/input/dmxdummy.c | 2 | ||||
-rw-r--r-- | hw/dmx/input/dmxevents.c | 227 | ||||
-rw-r--r-- | hw/dmx/input/dmxinputinit.c | 102 | ||||
-rw-r--r-- | hw/dmx/input/dmxxinput.c | 6 | ||||
-rw-r--r-- | hw/dmx/input/lnx-keyboard.c | 12 | ||||
-rw-r--r-- | hw/kdrive/ati/ati_dma.c | 2 | ||||
-rw-r--r-- | hw/vfb/Makefile.am | 4 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Module.h | 2 | ||||
-rw-r--r-- | hw/xfree86/dixmods/Makefile.am | 8 | ||||
-rw-r--r-- | hw/xfree86/doc/man/xorg.conf.man.pre | 4 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 59 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.h | 7 | ||||
-rw-r--r-- | hw/xnest/Makefile.am | 4 | ||||
-rw-r--r-- | hw/xprint/Makefile.am | 2 | ||||
-rw-r--r-- | hw/xprint/ddxInit.c | 6 |
23 files changed, 487 insertions, 156 deletions
diff --git a/hw/darwin/Makefile.am b/hw/darwin/Makefile.am index 3e28d3212..b8641bbc8 100644 --- a/hw/darwin/Makefile.am +++ b/hw/darwin/Makefile.am @@ -26,12 +26,12 @@ libdarwinShared_a_SOURCES = darwin.c \ bin_PROGRAMS = XDarwin Xquartz XDarwin_SOURCES = \ - $(top_srcdir)/fb/fbcmap.c \ + $(top_srcdir)/fb/fbcmap_mi.c \ $(top_srcdir)/mi/miinitext.c \ $(top_srcdir)/Xi/stubs.c Xquartz_SOURCES = \ - $(top_srcdir)/fb/fbcmap.c \ + $(top_srcdir)/fb/fbcmap_mi.c \ $(top_srcdir)/mi/miinitext.c \ $(top_srcdir)/Xi/stubs.c \ apple/X11Application.m \ @@ -115,7 +115,7 @@ x11app: cd apple && xcodebuild CFLAGS="$(XSERVERCFLAGS_CFLAGS)" LDFLAGS="$(XSERVERCFLAGS_LIBS)" XDarwinApp_SOURCES = \ - $(top_srcdir)/fb/fbcmap.c \ + $(top_srcdir)/fb/fbcmap_mi.c \ $(top_srcdir)/mi/miinitext.c \ $(top_srcdir)/Xi/stubs.c diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am index 17d27ed39..002ea112a 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 @@ -26,11 +25,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 +73,7 @@ Xdmx_SOURCES = dmx.c \ dmxwindow.c \ dmxwindow.h \ $(top_srcdir)/mi/miinitext.c \ + $(top_srcdir)/fb/fbcmap_mi.c \ $(GLX_SRCS) @@ -89,7 +87,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/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..7aa8510cb 100644 --- a/hw/dmx/input/dmxbackend.c +++ b/hw/dmx/input/dmxbackend.c @@ -242,7 +242,7 @@ static int dmxBackendOffscreen(int screen, int x, int y) void dmxBackendUpdatePosition(pointer private, int x, int y) { GETPRIVFROMPRIVATE; - int screen = miPointerCurrentScreen()->myNum; + int screen = miPointerGetScreen(inputInfo.pointer)->myNum; DMXScreenInfo *dmxScreen = &dmxScreens[priv->myScreen]; int oldRelative = priv->relative; int topscreen = dmxBackendFindOverlapping(priv, screen, x, y); @@ -354,7 +354,8 @@ void dmxBackendCollectEvents(DevicePtr pDev, switch (X.type) { case EnterNotify: dmxCommonSaveState(priv); - if (entered++) continue; + if (entered++) + continue; priv->entered = 1; ignoreLeave = 1; DMXDBG5("dmxBackendCollectEvents: Enter %lu %d,%d; GRAB %s %p\n", @@ -378,7 +379,8 @@ void dmxBackendCollectEvents(DevicePtr pDev, continue; } dmxCommonRestoreState(priv); - if (left++) continue; + if (left++) + continue; DMXDBG7("dmxBackendCollectEvents: Leave %lu %d,%d %d %d %s %s\n", X.xcrossing.root, X.xcrossing.x, X.xcrossing.y, X.xcrossing.detail, X.xcrossing.focus, @@ -398,7 +400,8 @@ void dmxBackendCollectEvents(DevicePtr pDev, priv->newscreen, X.xmotion.x, X.xmotion.y, entered, priv->lastX, priv->lastY); - if (dmxBackendPendingMotionEvent(priv, TRUE)) continue; + if (dmxBackendPendingMotionEvent(priv, TRUE)) + continue; if (!(dmxScreen = dmxBackendFindWindow(priv, X.xmotion.window))) dmxLog(dmxFatal, " Event on non-existant window %lu\n", @@ -449,6 +452,9 @@ void dmxBackendCollectEvents(DevicePtr pDev, case KeyRelease: enqueue(priv->kbd, X.type, X.xkey.keycode, 0, NULL, block); break; + case ButtonPress: + case ButtonRelease: + /* fall-through */ default: /* Pass the whole event here, because * this may be an extension event. */ @@ -571,12 +577,16 @@ void dmxBackendInit(DevicePtr pDev) /** Get information about the backend pointer (for initialization). */ void dmxBackendMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info) { + const DMXScreenInfo *dmxScreen = dmxBackendInitPrivate(pDev); + info->buttonClass = 1; dmxCommonMouGetMap(pDev, info->map, &info->numButtons); info->valuatorClass = 1; info->numRelAxes = 2; info->minval[0] = 0; - info->maxval[0] = 0; + info->minval[1] = 0; + info->maxval[0] = dmxScreen->beWidth; + info->maxval[1] = dmxScreen->beHeight; info->res[0] = 1; info->minres[0] = 0; info->maxres[0] = 1; diff --git a/hw/dmx/input/dmxcommon.c b/hw/dmx/input/dmxcommon.c index 278a74e71..1dcc1e9e4 100644 --- a/hw/dmx/input/dmxcommon.c +++ b/hw/dmx/input/dmxcommon.c @@ -241,13 +241,15 @@ void dmxCommonKbdGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap) /* Compute pModMap */ modifier_mapping = XGetModifierMapping(priv->display); - for (i = 0; i < MAP_LENGTH; i++) pModMap[i] = 0; + for (i = 0; i < MAP_LENGTH; i++) + pModMap[i] = 0; for (j = 0; j < 8; j++) { int max_keypermod = modifier_mapping->max_keypermod; for (i = 0; i < max_keypermod; i++) { CARD8 keycode = modifier_mapping->modifiermap[j*max_keypermod + i]; - if (keycode) pModMap[keycode] |= 1 << j; + if (keycode) + pModMap[keycode] |= 1 << j; } } XFreeModifiermap(modifier_mapping); @@ -611,6 +613,7 @@ void dmxCommonSaveState(pointer private) &priv->dmxLocal->kctrl); priv->savedModMap = XGetModifierMapping(priv->display); + modmap = XNewModifiermap(0); XSetModifierMapping(priv->display, modmap); if (dmxInput->scrnIdx != -1) @@ -627,8 +630,10 @@ void dmxCommonRestoreState(pointer private) int retcode = -1; CARD32 start; - if (dmxInput->console) priv = dmxInput->devs[0]->private; - if (!priv->stateSaved) return; + if (dmxInput->console) + priv = dmxInput->devs[0]->private; + if (!priv->stateSaved) + return; priv->stateSaved = 0; DMXDBG0("dmxCommonRestoreState\n"); @@ -645,7 +650,8 @@ void dmxCommonRestoreState(pointer private) CARD32 tmp; retcode = XSetModifierMapping(priv->display, priv->savedModMap); - if (retcode == MappingSuccess) break; + if (retcode == MappingSuccess) + break; if (retcode == MappingBusy) dmxLogInput(dmxInput, "Keyboard busy, waiting\n"); else diff --git a/hw/dmx/input/dmxconsole.c b/hw/dmx/input/dmxconsole.c index 835909e6c..aac5e08dc 100644 --- a/hw/dmx/input/dmxconsole.c +++ b/hw/dmx/input/dmxconsole.c @@ -860,12 +860,17 @@ void dmxConsoleInit(DevicePtr pDev) * for pointers. */ void dmxConsoleMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info) { + GETPRIVFROMPDEV; + info->buttonClass = 1; dmxCommonMouGetMap(pDev, info->map, &info->numButtons); info->valuatorClass = 1; info->numRelAxes = 2; - info->minval[0] = 0; - info->maxval[0] = 0; + info->minval[0] = 0; + info->minval[1] = 0; + /* max possible console window size: */ + info->maxval[0] = DisplayWidth(priv->display, DefaultScreen(priv->display)); + info->maxval[1] = DisplayHeight(priv->display, DefaultScreen(priv->display)); info->res[0] = 1; info->minres[0] = 0; info->maxres[0] = 1; diff --git a/hw/dmx/input/dmxdummy.c b/hw/dmx/input/dmxdummy.c index d6e614e51..b9c72b015 100644 --- a/hw/dmx/input/dmxdummy.c +++ b/hw/dmx/input/dmxdummy.c @@ -79,7 +79,9 @@ void dmxDummyMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info) info->valuatorClass = 1; info->numRelAxes = 2; info->minval[0] = 0; + info->minval[1] = 0; info->maxval[0] = 0; + info->maxval[1] = 0; info->res[0] = 1; info->minres[0] = 0; info->maxres[0] = 1; diff --git a/hw/dmx/input/dmxevents.c b/hw/dmx/input/dmxevents.c index 5316f0fdc..4810b17bb 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" @@ -102,7 +103,25 @@ static int dmxCheckFunctionKeys(DMXLocalInputInfoPtr dmxLocal, { DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx]; unsigned short state = 0; - + +#if 1 /* hack to detect ctrl-alt-q, etc */ + static int ctrl = 0, alt = 0; + /* keep track of ctrl/alt key status */ + if (type == KeyPress && keySym == 0xffe3) { + ctrl = 1; + } + else if (type == KeyRelease && keySym == 0xffe3) { + ctrl = 0; + } + else if (type == KeyPress && keySym == 0xffe9) { + alt = 1; + } + else if (type == KeyRelease && keySym == 0xffe9) { + alt = 0; + } + if (!ctrl || !alt) + return 0; +#else if (dmxLocal->sendsCore) state = dmxLocalCoreKeyboard->pDevice->key->state; else if (dmxLocal->pDevice->key) @@ -111,7 +130,9 @@ static int dmxCheckFunctionKeys(DMXLocalInputInfoPtr dmxLocal, DMXDBG3("dmxCheckFunctionKeys: keySym=0x%04x %s state=0x%04x\n", keySym, type == KeyPress ? "press" : "release", state); - if ((state & (ControlMask|Mod1Mask)) != (ControlMask|Mod1Mask)) return 0; + if ((state & (ControlMask|Mod1Mask)) != (ControlMask|Mod1Mask)) + return 0; +#endif switch (keySym) { case XK_g: @@ -146,16 +167,25 @@ static void dmxEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, xEvent *e, int type = e->u.u.type; switch (e->u.u.type) { - case KeyPress: type = DeviceKeyPress; break; - case KeyRelease: type = DeviceKeyRelease; break; - case ButtonPress: type = DeviceButtonPress; break; - case ButtonRelease: type = DeviceButtonRelease; break; + case KeyPress: + type = DeviceKeyPress; + break; + case KeyRelease: + type = DeviceKeyRelease; + break; + case ButtonPress: + type = DeviceButtonPress; + break; + case ButtonRelease: + type = DeviceButtonRelease; + break; case MotionNotify: dmxLog(dmxError, "dmxEnqueueExtEvent: MotionNotify not allowed here\n"); return; default: - if (e->u.u.type == ProximityIn || e->u.u.type == ProximityOut) break; + if (e->u.u.type == ProximityIn || e->u.u.type == ProximityOut) + break; dmxLogInput(dmxInput, "dmxEnqueueExtEvent: Unhandled %s event (%d)\n", e->u.u.type >= LASTEvent ? "extension" : "non-extension", @@ -173,9 +203,11 @@ static void dmxEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, xEvent *e, xv->num_valuators = 0; xv->first_valuator = 0; - if (block) dmxSigioBlock(); + if (block) + dmxSigioBlock(); dmxeqEnqueue(xE); - if (block) dmxSigioUnblock(); + if (block) + dmxSigioUnblock(); } #endif @@ -185,12 +217,36 @@ DMXScreenInfo *dmxFindFirstScreen(int x, int y) for (i = 0; i < dmxNumScreens; i++) { DMXScreenInfo *dmxScreen = &dmxScreens[i]; - if (dmxOnScreen(x, y, dmxScreen)) return dmxScreen; + if (dmxOnScreen(x, y, dmxScreen)) + return dmxScreen; } return NULL; } -void dmxCoreMotion(int x, int y, int delta, DMXBlockType block) + +/** + * Enqueue a motion event. + */ +static void enqueueMotion(DevicePtr pDev, int x, int y) +{ + GETDMXLOCALFROMPDEV; + DeviceIntPtr p = dmxLocal->pDevice; + int i, nevents, valuators[3]; + xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum()); + int detail = 0; /* XXX should this be mask of pressed buttons? */ + valuators[0] = x; + valuators[1] = y; + nevents = GetPointerEvents(events, p, MotionNotify, detail, + POINTER_ABSOLUTE, 0, 2, valuators); + for (i = 0; i < nevents; i++) + mieqEnqueue(p, events + i); + xfree(events); + return; +} + + +void +dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block) { DMXScreenInfo *dmxScreen; DMXInputInfo *dmxInput; @@ -199,7 +255,8 @@ void dmxCoreMotion(int x, int y, int delta, DMXBlockType block) int localY; int i; - if (!dmxGlobalInvalid && dmxGlobalX == x && dmxGlobalY == y) return; + if (!dmxGlobalInvalid && dmxGlobalX == x && dmxGlobalY == y) + return; DMXDBG5("dmxCoreMotion(%d,%d,%d) dmxGlobalX=%d dmxGlobalY=%d\n", x, y, delta, dmxGlobalX, dmxGlobalY); @@ -208,47 +265,61 @@ void dmxCoreMotion(int x, int y, int delta, DMXBlockType block) 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; + if (dmxGlobalX < 0) + dmxGlobalX = 0; + if (dmxGlobalY < 0) + dmxGlobalY = 0; + if (dmxGlobalX >= dmxGlobalWidth) + dmxGlobalX = dmxGlobalWidth + delta -1; + if (dmxGlobalY >= dmxGlobalHeight) + dmxGlobalY = dmxGlobalHeight + delta -1; if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) { localX = dmxGlobalX - dmxScreen->rootXOrigin; localY = dmxGlobalY - dmxScreen->rootYOrigin; - if ((pScreen = miPointerCurrentScreen()) + if ((pScreen = miPointerGetScreen(inputInfo.pointer)) && pScreen->myNum == dmxScreen->index) { /* Screen is old screen */ - if (block) dmxSigioBlock(); - miPointerAbsoluteCursor(localX, localY, GetTimeInMillis()); - if (block) dmxSigioUnblock(); + if (block) + dmxSigioBlock(); + if (pDev) + enqueueMotion(pDev, localX, localY); + 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(); + if (block) + dmxSigioBlock(); dmxeqProcessInputEvents(); - miPointerSetNewScreen(dmxScreen->index, localX, localY); - miPointerAbsoluteCursor(localX, localY, GetTimeInMillis()); - if (block) dmxSigioUnblock(); + miPointerSetScreen(inputInfo.pointer, dmxScreen->index, + localX, localY); + if (pDev) + enqueueMotion(pDev, localX, localY); + if (block) + dmxSigioUnblock(); } - miPointerPosition(&localX, &localY); +#if 00 + miPointerGetPosition(inputInfo.pointer, &localX, &localY); - if ((pScreen = miPointerCurrentScreen())) { + 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 @@ -259,6 +330,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, @@ -349,10 +422,12 @@ static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal, } } - if (block) dmxSigioBlock(); + if (block) + dmxSigioBlock(); dmxPointerPutMotionEvent(pDevice, firstAxis, axesCount, v, xev->time); dmxeqEnqueue(xE); - if (block) dmxSigioUnblock(); + if (block) + dmxSigioUnblock(); } static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, @@ -366,7 +441,8 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, XDeviceKeyEvent *ke = (XDeviceKeyEvent *)e; XDeviceMotionEvent *me = (XDeviceMotionEvent *)e; - if (!e) return -1; /* No extended event passed, cannot handle */ + if (!e) + return -1; /* No extended event passed, cannot handle */ if ((XID)dmxLocal->deviceId != ke->deviceid) { /* Search for the correct dmxLocal, @@ -377,7 +453,8 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx]; for (i = 0; i < dmxInput->numDevs; i++) { dmxLocal = dmxInput->devs[i]; - if ((XID)dmxLocal->deviceId == ke->deviceid) break; + if ((XID)dmxLocal->deviceId == ke->deviceid) + break; } } @@ -426,9 +503,11 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, xv->valuator4 = ke->axis_data[4]; xv->valuator5 = ke->axis_data[5]; - if (block) dmxSigioBlock(); + if (block) + dmxSigioBlock(); dmxeqEnqueue(xE); - if (block) dmxSigioUnblock(); + if (block) + dmxSigioUnblock(); break; case XI_DeviceMotionNotify: @@ -508,12 +587,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; + } } } @@ -525,7 +610,8 @@ static KeySym dmxKeyCodeToKeySym(DMXLocalInputInfoPtr dmxLocal, if (!dmxLocal || !dmxLocal->pDevice || !dmxLocal->pDevice->key) return NoSymbol; pKeySyms = &dmxLocal->pDevice->key->curKeySyms; - if (!pKeySyms) return NoSymbol; + if (!pKeySyms) + return NoSymbol; if (keyCode > pKeySyms->minKeyCode && keyCode <= pKeySyms->maxKeyCode) { DMXDBG2("dmxKeyCodeToKeySym: Translated keyCode=%d to keySym=0x%04x\n", @@ -574,14 +660,16 @@ static int dmxFixup(DevicePtr pDev, int detail, KeySym keySym) dmxLocal->pDevice->name); return NoSymbol; } - if (!keySym) keySym = dmxKeyCodeToKeySym(dmxLocal, detail); - if (keySym == NoSymbol) return detail; + if (!keySym) + keySym = dmxKeyCodeToKeySym(dmxLocal, detail); + if (keySym == NoSymbol) + return detail; keyCode = dmxKeySymToKeyCode(dmxLocalCoreKeyboard, keySym, detail); return keyCode ? keyCode : detail; } -/** Enqueue a non-motion event from the \a pDev device with the +/** Enqueue an event from the \a pDev device with the * specified \a type and \a detail. If the event is a KeyPress or * KeyRelease event, then the \a keySym is also specified. * @@ -593,29 +681,56 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym, { GETDMXINPUTFROMPDEV; xEvent xE; + DeviceIntPtr p = dmxLocal->pDevice; + int i, nevents, valuators[3]; + xEvent *events; DMXDBG2("dmxEnqueue: Enqueuing type=%d detail=0x%0x\n", type, detail); switch (type) { case KeyPress: case KeyRelease: - if (!keySym) keySym = dmxKeyCodeToKeySym(dmxLocal, detail); + if (!keySym) + keySym = dmxKeyCodeToKeySym(dmxLocal, detail); if (dmxCheckFunctionKeys(dmxLocal, type, keySym)) return; if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard) xE.u.u.detail = dmxFixup(pDev, detail, keySym); - break; + + events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum()); + /*ErrorF("KEY %d sym %d\n", detail, (int) keySym);*/ + nevents = GetKeyboardEvents(events, p, type, detail); + for (i = 0; i < nevents; i++) + mieqEnqueue(p, events + i); + xfree(events); + return; + case ButtonPress: case ButtonRelease: detail = dmxGetButtonMapping(dmxLocal, detail); - break; + events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum()); + nevents = GetPointerEvents(events, p, type, detail, + POINTER_ABSOLUTE, + 0, /* first_valuator = 0 */ + 0, /* num_valuators = 0 */ + valuators); + for (i = 0; i < nevents; i++) + mieqEnqueue(p, events + i); + xfree(events); + return; + case MotionNotify: - /* All MotionNotify events should be sent via dmxCoreMotion and - * dmxExtMotion -- no input driver should build motion events by - * hand. */ - dmxLog(dmxError, "dmxEnqueueXEvent: MotionNotify not allowed here\n"); - break; - /* Always ignore these events */ + events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum()); + valuators[0] = e->xmotion.x; + valuators[1] = e->xmotion.y; + valuators[2] = e->xmotion.state; + nevents = GetPointerEvents(events, p, type, detail, + POINTER_ABSOLUTE, 0, 3, valuators); + for (i = 0; i < nevents; i++) + mieqEnqueue(p, events + i); + xfree(events); + return; + case EnterNotify: case LeaveNotify: case KeymapNotify: @@ -627,7 +742,8 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym, default: #ifdef XINPUT if (type == ProximityIn || type == ProximityOut) { - if (dmxLocal->sendsCore) return; /* Not a core event */ + if (dmxLocal->sendsCore) + return; /* Not a core event */ break; } #endif @@ -643,16 +759,19 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym, return; } +#if 00 /* dead code? */ memset(&xE, 0, sizeof(xE)); xE.u.u.type = type; xE.u.u.detail = detail; xE.u.keyButtonPointer.time = GetTimeInMillis(); #ifdef XINPUT - if (!dmxLocal->sendsCore) dmxEnqueueExtEvent(dmxLocal, &xE, block); + if (!dmxLocal->sendsCore) + dmxEnqueueExtEvent(dmxLocal, &xE, block); else #endif dmxeqEnqueue(&xE); +#endif /*00*/ } /** 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..a9d902ec2 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,8 +497,13 @@ 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); #ifdef XINPUT for (i = 0; i < info.numRelAxes; i++) @@ -521,11 +588,22 @@ static void dmxProcessInputEvents(DMXInputInfo *dmxInput) int i; 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 +631,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 +643,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 +741,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 +791,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/vfb/Makefile.am b/hw/vfb/Makefile.am index 40c385434..6842b45a5 100644 --- a/hw/vfb/Makefile.am +++ b/hw/vfb/Makefile.am @@ -14,8 +14,8 @@ SRCS = InitInput.c \ $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c -libfbcmap_a_CFLAGS = $(AM_CFLAGS) -DXFree86Server -libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap.c +libfbcmap_a_CFLAGS = $(AM_CFLAGS) +libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c Xvfb_SOURCES = $(SRCS) 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/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am index 58099bce9..1581019d1 100644 --- a/hw/xfree86/dixmods/Makefile.am +++ b/hw/xfree86/dixmods/Makefile.am @@ -75,13 +75,13 @@ libdbe_la_SOURCES = dbemodule.c libfb_la_LDFLAGS = -avoid-version libfb_la_LIBADD = $(top_builddir)/fb/libfb.la -libfb_la_SOURCES = $(top_builddir)/fb/fbcmap.c fbmodule.c -libfb_la_CFLAGS = -DXFree86Server $(AM_CFLAGS) +libfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c +libfb_la_CFLAGS = $(AM_CFLAGS) libwfb_la_LDFLAGS = -avoid-version libwfb_la_LIBADD = $(top_builddir)/fb/libwfb.la -libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap.c fbmodule.c -libwfb_la_CFLAGS = -DXFree86Server $(AM_CFLAGS) -DFB_ACCESS_WRAPPER +libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c +libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER libglx_la_LDFLAGS = -avoid-version if AIGLX diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre index cc60d0754..19315c024 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/doc/man/xorg.conf.man.pre @@ -958,6 +958,10 @@ the driver-specific documentation recommends it. This optional entry specifies the pixel clock frequency that is used for the regular text mode. The frequency is specified in MHz. This is rarely used. +.TP 7 +.BI "Option \*qModeDebug\*q \*q" boolean \*q +Enable printing of additional debugging information about modesetting to +the server log. .ig .TP 7 This optional entry allows an IRQ number to be specified. diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 7d86b6606..0fe03d372 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -377,6 +377,15 @@ static OptionInfoRec xf86OutputOptions[] = { {-1, NULL, OPTV_NONE, {0}, FALSE }, }; +enum { + OPTION_MODEDEBUG, +}; + +static OptionInfoRec xf86DeviceOptions[] = { + {OPTION_MODEDEBUG, "ModeDebug", OPTV_STRING, {0}, FALSE }, + {-1, NULL, OPTV_NONE, {0}, FALSE }, +}; + static void xf86OutputSetMonitor (xf86OutputPtr output) { @@ -589,7 +598,6 @@ xf86CrtcCloseScreen (int index, ScreenPtr screen) { xf86OutputPtr output = config->output[o]; - output->crtc = NULL; output->randr_output = NULL; } for (c = 0; c < config->num_crtc; c++) @@ -1160,8 +1168,6 @@ xf86SortModes (DisplayModePtr input) return output; } -#define DEBUG_REPROBE 1 - void xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) { @@ -1330,7 +1336,8 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) if (mode->status == MODE_OK) mode->status = (*output->funcs->mode_valid)(output, mode); - xf86PruneInvalidModes(scrn, &output->probed_modes, TRUE); + xf86PruneInvalidModes(scrn, &output->probed_modes, + config->debug_modes); output->probed_modes = xf86SortModes (output->probed_modes); @@ -1363,17 +1370,17 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) output->initial_rotation = xf86OutputInitialRotation (output); -#ifdef DEBUG_REPROBE - if (output->probed_modes != NULL) { - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "Printing probed modes for output %s\n", - output->name); - } else { - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "No remaining probed modes for output %s\n", - output->name); + if (config->debug_modes) { + if (output->probed_modes != NULL) { + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "Printing probed modes for output %s\n", + output->name); + } else { + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "No remaining probed modes for output %s\n", + output->name); + } } -#endif for (mode = output->probed_modes; mode != NULL; mode = mode->next) { /* The code to choose the best mode per pipe later on will require @@ -1382,9 +1389,8 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) mode->VRefresh = xf86ModeVRefresh(mode); xf86SetModeCrtc(mode, INTERLACE_HALVE_V); -#ifdef DEBUG_REPROBE - xf86PrintModeline(scrn->scrnIndex, mode); -#endif + if (config->debug_modes) + xf86PrintModeline(scrn->scrnIndex, mode); } } } @@ -1479,6 +1485,15 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) int width; int height; + /* Set up the device options */ + config->options = xnfalloc (sizeof (xf86DeviceOptions)); + memcpy (config->options, xf86DeviceOptions, sizeof (xf86DeviceOptions)); + xf86ProcessOptions (scrn->scrnIndex, + scrn->options, + config->options); + config->debug_modes = xf86ReturnOptValBool (config->options, + OPTION_MODEDEBUG, FALSE); + if (scrn->display->virtualX) width = scrn->display->virtualX; else @@ -1962,10 +1977,12 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) output->MonInfo = edid_mon; - /* Debug info for now, at least */ - xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n", output->name); - xf86PrintEDID(edid_mon); - + if (config->debug_modes) { + xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n", + output->name); + xf86PrintEDID(edid_mon); + } + /* Set the DDC properties for the 'compat' output */ if (output == config->output[config->compat_output]) xf86SetDDCproperties(scrn, edid_mon); diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index 42daf6079..030f6bf3a 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -552,6 +552,13 @@ typedef struct _xf86CrtcConfig { CARD8 *cursor_image; Bool cursor_on; CARD32 cursor_fg, cursor_bg; + + /** + * Options parsed from the related device section + */ + OptionInfoPtr options; + + Bool debug_modes; } xf86CrtcConfigRec, *xf86CrtcConfigPtr; extern int xf86CrtcConfigPrivateIndex; diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am index b89761651..e958c0eee 100644 --- a/hw/xnest/Makefile.am +++ b/hw/xnest/Makefile.am @@ -45,8 +45,8 @@ SRCS = Args.c \ $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c -libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap.c -libfbcmap_a_CFLAGS = $(AM_CFLAGS) -DXFree86Server +libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c +libfbcmap_a_CFLAGS = $(AM_CFLAGS) Xnest_SOURCES = $(SRCS) diff --git a/hw/xprint/Makefile.am b/hw/xprint/Makefile.am index d4f22d261..45168b11e 100644 --- a/hw/xprint/Makefile.am +++ b/hw/xprint/Makefile.am @@ -38,6 +38,6 @@ Xprt_SOURCES = \ Util.c \ miinitext-wrapper.c \ dpmsstubs-wrapper.c \ - $(top_srcdir)/fb/fbcmap.c + $(top_srcdir)/fb/fbcmap_mi.c EXTRA_DIST = ValTree.c diff --git a/hw/xprint/ddxInit.c b/hw/xprint/ddxInit.c index 8e7ec2e0a..a465c4c6d 100644 --- a/hw/xprint/ddxInit.c +++ b/hw/xprint/ddxInit.c @@ -89,6 +89,12 @@ InitOutput( } +void +DDXRingBell(int volume, int pitch, int duration) +{ + /* dummy func; link fails without */ +} + static void BellProc( int volume, |