xserver: Branch 'XACE-modular' - 21 commits
Alan Coopersmith
alanc at kemper.freedesktop.org
Mon Aug 21 13:08:23 PDT 2006
configure.ac | 6
dix/devices.c | 6
dix/events.c | 89 +--------
dix/globals.c | 1
dix/window.c | 21 +-
exa/exa_render.c | 93 ++++++++-
hw/xfree86/common/xf86Bus.c | 2
hw/xfree86/common/xf86Configure.c | 3
hw/xfree86/common/xf86Mode.c | 81 ++------
hw/xfree86/common/xf86str.h | 7
hw/xfree86/os-support/Makefile.am | 2
hw/xfree86/os-support/hurd/Makefile.am | 17 +
hw/xfree86/os-support/hurd/hurd_init.c | 90 +++++++++
hw/xfree86/os-support/hurd/hurd_mmap.c | 96 ++++++++++
hw/xfree86/os-support/hurd/hurd_mouse.c | 301 ++++++++++++++++++++++++++++++++
hw/xfree86/os-support/hurd/hurd_video.c | 191 ++++++++++++++++++++
hw/xfree86/os-support/linux/lnx_video.c | 16 -
hw/xfree86/vgahw/vgaHW.h | 2
hw/xwin/winclipboardwndproc.c | 104 +++++++----
hw/xwin/winmultiwindowwndproc.c | 9
include/opaque.h | 1
include/xorg-config.h.in | 3
os/access.c | 4
os/utils.c | 10 -
xkb/xkbPrKeyEv.c | 4
25 files changed, 946 insertions(+), 213 deletions(-)
New commits:
diff-tree 05541259bdb0dfaab015a01caa3722b7a1b782e2 (from parents)
Merge: c2535f67923bde0bfb0e72363467110806e2f40f a1ac0440bba690368aa4226468ce571be1a09d95
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date: Mon Aug 21 13:07:41 2006 -0700
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into XACE-modular
diff-tree a1ac0440bba690368aa4226468ce571be1a09d95 (from 19f673b7788d32c220e7e06734f1074b0e4a999c)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Fri Aug 18 17:30:00 2006 +0300
dix: fix whiteroot thinko
Note to self: run git update-index _after_ testing, not just before.
diff --git a/dix/window.c b/dix/window.c
index c16f514..0beeb3a 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -519,9 +519,9 @@ InitRootWindow(WindowPtr pWin)
}
else {
if (blackRoot)
- pWin->background.pixel = blackPixel;
+ pWin->background.pixel = pScreen->blackPixel;
else
- pWin->background.pixel = whitePixel;
+ pWin->background.pixel = pScreen->whitePixel;
backFlag |= CWBackPixel;
}
diff-tree 19f673b7788d32c220e7e06734f1074b0e4a999c (from parents)
Merge: cb0a565d2b2cf8823abbd77b4426cc2237731dc1 70ddd0f39d5118db72a1a4e473cbfb502f1ed9ec
Author: Daniel Stone <daniel at fooishbar.org>
Date: Fri Aug 18 17:05:41 2006 +0300
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver
diff-tree cb0a565d2b2cf8823abbd77b4426cc2237731dc1 (from 7da51447eaab34292e14077fb5a48e6b2e587781)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Fri Aug 18 17:04:48 2006 +0300
dix: add whiteroot flag
Add a -wr option to use a white root window, and use a BackPixel rather
than BackPixmap for both white and black root windows.
diff --git a/dix/globals.c b/dix/globals.c
index 5b854aa..fc77ca7 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -143,6 +143,7 @@ FontPtr defaultFont; /* not declared i
Bool loadableFonts = FALSE;
CursorPtr rootCursor;
Bool blackRoot=FALSE;
+Bool whiteRoot=FALSE;
ClientPtr requestingClient; /* XXX this should be obsolete now, remove? */
_X_EXPORT TimeStamp currentTime;
diff --git a/dix/window.c b/dix/window.c
index ebc6923..c16f514 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -343,9 +343,6 @@ MakeRootTile(WindowPtr pWin)
for (j = len; j > 0; j--)
*to++ = *from;
- if (blackRoot)
- bzero(back, sizeof(back));
-
(*pGC->ops->PutImage)((DrawablePtr)pWin->background.pixmap, pGC, 1,
0, 0, len, 4, 0, XYBitmap, (char *)back);
@@ -506,6 +503,7 @@ void
InitRootWindow(WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
+ int backFlag = CWBorderPixel | CWCursor | CWBackingStore;
if (!(*pScreen->CreateWindow)(pWin))
return; /* XXX */
@@ -514,12 +512,23 @@ InitRootWindow(WindowPtr pWin)
pWin->cursorIsNone = FALSE;
pWin->optional->cursor = rootCursor;
rootCursor->refcnt++;
- MakeRootTile(pWin);
+
+ if (!blackRoot && !whiteRoot) {
+ MakeRootTile(pWin);
+ backFlag |= CWBackPixmap;
+ }
+ else {
+ if (blackRoot)
+ pWin->background.pixel = blackPixel;
+ else
+ pWin->background.pixel = whitePixel;
+ backFlag |= CWBackPixel;
+ }
+
pWin->backingStore = defaultBackingStore;
pWin->forcedBS = (defaultBackingStore != NotUseful);
/* We SHOULD check for an error value here XXX */
- (*pScreen->ChangeWindowAttributes)(pWin,
- CWBackPixmap|CWBorderPixel|CWCursor|CWBackingStore);
+ (*pScreen->ChangeWindowAttributes)(pWin, backFlag);
MapWindow(pWin, serverClient);
}
diff --git a/include/opaque.h b/include/opaque.h
index 4ccccd0..3d19d27 100644
--- a/include/opaque.h
+++ b/include/opaque.h
@@ -73,6 +73,7 @@ extern int limitNoFile;
extern Bool defeatAccessControl;
extern long maxBigRequestSize;
extern Bool blackRoot;
+extern Bool whiteRoot;
extern Bool CoreDump;
diff --git a/os/utils.c b/os/utils.c
index 6bf8624..31ae26a 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -642,6 +642,7 @@ void UseMsg(void)
ErrorF("v video blanking for screen-saver\n");
ErrorF("-v screen-saver without video blanking\n");
ErrorF("-wm WhenMapped default backing-store\n");
+ ErrorF("-wr create root window with white background\n");
ErrorF("-x string loads named extension at init time \n");
ErrorF("-maxbigreqsize set maximal bigrequest size \n");
#ifdef PANORAMIX
@@ -983,6 +984,8 @@ ProcessCommandLine(int argc, char *argv[
defaultScreenSaverBlanking = DontPreferBlanking;
else if ( strcmp( argv[i], "-wm") == 0)
defaultBackingStore = WhenMapped;
+ else if ( strcmp( argv[i], "-wr") == 0)
+ whiteRoot = TRUE;
else if ( strcmp( argv[i], "-maxbigreqsize") == 0) {
if(++i < argc) {
long reqSizeArg = atol(argv[i]);
diff-tree 70ddd0f39d5118db72a1a4e473cbfb502f1ed9ec (from 708b225689b5a4ba9ffe3372b584b715ef9eacdc)
Author: Alan Hourihane <alanh at fairlite.demon.co.uk>
Date: Fri Aug 18 14:43:10 2006 +0100
Fix bug #5735, Serious flaw in CygwinX clipboard
integration prevents paste from X to Windows apps
(Brett Stahlman & Colin Harrison)
diff --git a/hw/xwin/winclipboardwndproc.c b/hw/xwin/winclipboardwndproc.c
index 09a01d3..802a740 100644
--- a/hw/xwin/winclipboardwndproc.c
+++ b/hw/xwin/winclipboardwndproc.c
@@ -56,6 +56,8 @@ extern void *g_pClipboardDisplay;
extern Window g_iClipboardWindow;
extern Atom g_atomLastOwnedSelection;
+/* BPS - g_hwndClipboard needed for X app->Windows paste fix */
+extern HWND g_hwndClipboard;
/*
* Local function prototypes
@@ -141,6 +143,12 @@ winProcessXEventsTimeout (HWND hwnd, int
* Process a given Windows message
*/
+/* BPS - Define our own message, which we'll post to ourselves to facilitate
+ * resetting the delayed rendering mechanism after each paste from X app to
+ * Windows app. TODO - Perhaps move to win.h with the other WM_USER messages.
+ */
+#define WM_USER_PASTE_COMPLETE (WM_USER + 1003)
+
LRESULT CALLBACK
winClipboardWindowProc (HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
@@ -327,8 +335,6 @@ winClipboardWindowProc (HWND hwnd, UINT
* previous XSetSelectionOwner messages.
*/
XSync (pDisplay, FALSE);
-
- winDebug("winClipboardWindowProc - XSync done.\n");
/* Release PRIMARY selection if owned */
iReturn = XGetSelectionOwner (pDisplay, XA_PRIMARY);
@@ -527,6 +533,13 @@ winClipboardWindowProc (HWND hwnd, UINT
SetClipboardData (CF_TEXT, NULL);
}
+ /* BPS - Post ourselves a user message whose handler will reset the
+ * delayed rendering mechanism after the paste is complete. This is
+ * necessary because calling SetClipboardData() with a NULL argument
+ * here will cause the data we just put on the clipboard to be lost!
+ */
+ PostMessage(g_hwndClipboard, WM_USER_PASTE_COMPLETE, 0, 0);
+
/* Special handling for WM_RENDERALLFORMATS */
if (message == WM_RENDERALLFORMATS)
{
@@ -544,6 +557,37 @@ winClipboardWindowProc (HWND hwnd, UINT
winDebug ("winClipboardWindowProc - WM_RENDER*FORMAT - Returning.\n");
return 0;
}
+ /* BPS - This WM_USER message is posted by us. It gives us the opportunity
+ * to reset the delayed rendering mechanism after each and every paste
+ * from an X app to a Windows app. Without such a mechanism, subsequent
+ * changes of selection in the X app owning the selection are not
+ * reflected in pastes into Windows apps, since Windows won't send us the
+ * WM_RENDERFORMAT message unless someone has set changed data (or NULL)
+ * on the clipboard. */
+ case WM_USER_PASTE_COMPLETE:
+ {
+ if (hwnd != GetClipboardOwner ())
+ /* In case we've lost the selection since posting the message */
+ return 0;
+ winDebug ("winClipboardWindowProc - WM_USER_PASTE_COMPLETE\n");
+
+ /* Set up for another delayed rendering callback */
+ OpenClipboard (g_hwndClipboard);
+
+ /* Take ownership of the Windows clipboard */
+ EmptyClipboard ();
+
+ /* Advertise Unicode if we support it */
+ if (g_fUnicodeSupport)
+ SetClipboardData (CF_UNICODETEXT, NULL);
+
+ /* Always advertise regular text */
+ SetClipboardData (CF_TEXT, NULL);
+
+ /* Release the clipboard */
+ CloseClipboard ();
+ }
+ return 0;
}
/* Let Windows perform default processing for unhandled messages */
diff-tree 708b225689b5a4ba9ffe3372b584b715ef9eacdc (from parents)
Merge: e1f4565be5ce80be4655e81f77f4073fa3fbf8d0 ee5e2cbd2bee610a95facc6b486c4a5070973099
Author: Alan Hourihane <alanh at fairlite.demon.co.uk>
Date: Fri Aug 18 09:13:52 2006 +0100
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver
diff-tree e1f4565be5ce80be4655e81f77f4073fa3fbf8d0 (from 1880defe4eaba02f9585b154d0883235eabc6d11)
Author: Alan Hourihane <alanh at fairlite.demon.co.uk>
Date: Fri Aug 18 09:11:48 2006 +0100
Fix bug #7302, make Xn.hosts work from the
Microsoft Windows install directory on Xming.
(Colin Harrison)
diff --git a/os/access.c b/os/access.c
index 81f5b74..69e3051 100644
--- a/os/access.c
+++ b/os/access.c
@@ -1188,7 +1188,11 @@ ResetHosts (char *display)
FreeHost (host);
}
+#if defined WIN32 && defined __MINGW32__
+#define ETC_HOST_PREFIX "X"
+#else
#define ETC_HOST_PREFIX "/etc/X"
+#endif
#define ETC_HOST_SUFFIX ".hosts"
fnamelen = strlen(ETC_HOST_PREFIX) + strlen(ETC_HOST_SUFFIX) +
strlen(display) + 1;
diff-tree 1880defe4eaba02f9585b154d0883235eabc6d11 (from a1a8e4f7f5917f537eb3dd51d3d6fa3e129236ce)
Author: Alan Hourihane <alanh at fairlite.demon.co.uk>
Date: Fri Aug 18 09:09:53 2006 +0100
Fix bug #7281, clipboard viewer should not
call SetClipboard viewer when bogus in Xming/CygwinX
(Colin Harrison)
diff --git a/hw/xwin/winclipboardwndproc.c b/hw/xwin/winclipboardwndproc.c
index 369aac5..09a01d3 100644
--- a/hw/xwin/winclipboardwndproc.c
+++ b/hw/xwin/winclipboardwndproc.c
@@ -167,16 +167,19 @@ winClipboardWindowProc (HWND hwnd, UINT
case WM_CREATE:
{
+ HWND first, next;
+ DWORD error_code = 0;
winDebug ("winClipboardWindowProc - WM_CREATE\n");
+ first = GetClipboardViewer(); /* Get handle to first viewer in chain. */
+ if (first == hwnd) return 0; /* Make sure it's not us! */
/* Add ourselves to the clipboard viewer chain */
- s_hwndNextViewer = SetClipboardViewer (hwnd);
- if (s_hwndNextViewer == hwnd)
- {
- s_hwndNextViewer = NULL;
- winErrorFVerb (1, "winClipboardWindowProc - WM_CREATE: "
- "attempted to set next window to ourselves.");
- }
+ next = SetClipboardViewer (hwnd);
+ error_code = GetLastError();
+ if (SUCCEEDED(error_code) && (next == first)) /* SetClipboardViewer must have succeeded, and the handle */
+ s_hwndNextViewer = next; /* it returned must have been the first window in the chain */
+ else
+ s_fCBCInitialized = FALSE;
}
return 0;
@@ -220,28 +223,27 @@ winClipboardWindowProc (HWND hwnd, UINT
* expensive than just putting ourselves back into the chain.
*/
+ HWND first, next;
+ DWORD error_code = 0;
winDebug ("winClipboardWindowProc - WM_WM_REINIT: Enter\n");
- if (hwnd != GetClipboardViewer ())
- {
- winDebug (" WM_WM_REINIT: Replacing us(%x) with %x at head "
- "of chain\n", hwnd, s_hwndNextViewer);
- s_fCBCInitialized = FALSE;
- ChangeClipboardChain (hwnd, s_hwndNextViewer);
- s_hwndNextViewer = NULL;
- s_fCBCInitialized = FALSE;
- winDebug (" WM_WM_REINIT: Putting us back at head of chain.\n");
- s_hwndNextViewer = SetClipboardViewer (hwnd);
- if (s_hwndNextViewer == hwnd)
- {
- s_hwndNextViewer = NULL;
- winErrorFVerb (1, "winClipboardWindowProc - WM_WM_REINIT: "
- "attempted to set next window to ourselves.\n");
- }
- }
+
+ first = GetClipboardViewer(); /* Get handle to first viewer in chain. */
+ if (first == hwnd) return 0; /* Make sure it's not us! */
+ winDebug (" WM_WM_REINIT: Replacing us(%x) with %x at head "
+ "of chain\n", hwnd, s_hwndNextViewer);
+ s_fCBCInitialized = FALSE;
+ ChangeClipboardChain (hwnd, s_hwndNextViewer);
+ s_hwndNextViewer = NULL;
+ s_fCBCInitialized = FALSE;
+ winDebug (" WM_WM_REINIT: Putting us back at head of chain.\n");
+ first = GetClipboardViewer(); /* Get handle to first viewer in chain. */
+ if (first == hwnd) return 0; /* Make sure it's not us! */
+ next = SetClipboardViewer (hwnd);
+ error_code = GetLastError();
+ if (SUCCEEDED(error_code) && (next == first)) /* SetClipboardViewer must have succeeded, and the handle */
+ s_hwndNextViewer = next; /* it returned must have been the first window in the chain */
else
- {
- winDebug (" WM_WM_REINIT: already at head of viewer chain.\n");
- }
+ s_fCBCInitialized = FALSE;
}
winDebug ("winClipboardWindowProc - WM_WM_REINIT: Exit\n");
return 0;
diff-tree a1a8e4f7f5917f537eb3dd51d3d6fa3e129236ce (from a815b9b990e068f02d9cbba2b17f2cc3a30a9310)
Author: Alan Hourihane <alanh at fairlite.demon.co.uk>
Date: Fri Aug 18 09:08:12 2006 +0100
Fix bug #7280, round title corner background
should be transparent not black in Xming/CygwinX
(Colin Harrison)
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index 045adba..e359744 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -394,6 +394,15 @@ winTopLevelWindowProc (HWND hwnd, UINT m
* currently being created.
*/
winReorderWindowsMultiWindow ();
+
+ /* Fix a 'round title bar corner background should be transparent not black' problem when first painted */
+ RECT rWindow;
+ HRGN hRgnWindow;
+ GetWindowRect(hwnd, &rWindow);
+ hRgnWindow = CreateRectRgnIndirect(&rWindow);
+ SetWindowRgn (hwnd, hRgnWindow, TRUE);
+ DeleteObject(hRgnWindow);
+
return 0;
case WM_INIT_SYS_MENU:
diff-tree ee5e2cbd2bee610a95facc6b486c4a5070973099 (from 43e42eef1f5a22703eb64fc9cffecde036ea38e0)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Thu Aug 17 17:29:32 2006 -0400
Un-cut-and-paste the mode rejection message.
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index 72dd1ca..cd57e99 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -47,6 +47,22 @@
#include "xf86Priv.h"
#include "xf86DDC.h"
+static void
+printModeRejectMessage(int index, DisplayModePtr p, int status)
+{
+ char *type;
+
+ if (p->type & M_T_BUILTIN)
+ type = "built-in ";
+ else if (p->type & M_T_DEFAULT)
+ type = "default ";
+ else
+ type = "";
+
+ xf86DrvMsg(index, X_INFO, "Not using %smode \"%s\" (%s)\n", type, p->name,
+ xf86ModeStatusToString(status));
+}
+
/*
* xf86GetNearestClock --
* Find closest clock to given frequency (in kHz). This assumes the
@@ -1644,18 +1660,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, Disp
q->name = xnfstrdup(p->name);
q->status = MODE_OK;
} else {
- if (p->type & M_T_BUILTIN)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using built-in mode \"%s\" (%s)\n",
- p->name, xf86ModeStatusToString(status));
- else if (p->type & M_T_DEFAULT)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using default mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(status));
- else
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(status));
+ printModeRejectMessage(scrp->scrnIndex, p, status);
}
}
@@ -1796,39 +1801,14 @@ xf86ValidateModes(ScrnInfoPtr scrp, Disp
repeat = FALSE;
lookupNext:
- if (repeat && ((status = p->status) != MODE_OK)) {
- if (p->type & M_T_BUILTIN)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using built-in mode \"%s\" (%s)\n",
- p->name, xf86ModeStatusToString(status));
- else if (p->type & M_T_DEFAULT)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using default mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(status));
- else
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(status));
- }
+ if (repeat && ((status = p->status) != MODE_OK))
+ printModeRejectMessage(scrp->scrnIndex, p, status);
saveType = p->type;
status = xf86LookupMode(scrp, p, clockRanges, strategy);
- if (repeat && status == MODE_NOMODE) {
+ if (repeat && status == MODE_NOMODE)
continue;
- }
- if (status != MODE_OK) {
- if (p->type & M_T_BUILTIN)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using built-in mode \"%s\" (%s)\n",
- p->name, xf86ModeStatusToString(status));
- else if (p->type & M_T_DEFAULT)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using default mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(status));
- else
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(status));
- }
+ if (status != MODE_OK)
+ printModeRejectMessage(scrp->scrnIndex, p, status);
if (status == MODE_ERROR) {
ErrorF("xf86ValidateModes: "
"unexpected result from xf86LookupMode()\n");
@@ -2023,20 +2003,6 @@ xf86PruneDriverModes(ScrnInfoPtr scrp)
return;
n = p->next;
if (p->status != MODE_OK) {
-#if 0
- if (p->type & M_T_BUILTIN)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using built-in mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(p->status));
- else if (p->type & M_T_DEFAULT)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using default mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(p->status));
- else
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(p->status));
-#endif
xf86DeleteMode(&(scrp->modes), p);
}
p = n;
diff-tree 43e42eef1f5a22703eb64fc9cffecde036ea38e0 (from 7da51447eaab34292e14077fb5a48e6b2e587781)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Thu Aug 17 16:22:07 2006 -0400
Fix default mouse device on Linux, again.
It would be really nice if we only did this in one place instead of 40.
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index f0efa62..cb09108 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -87,6 +87,9 @@ static char *DFLT_MOUSE_DEV = "/dev/devi
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
static char *DFLT_MOUSE_DEV = "/dev/sysmouse";
static char *DFLT_MOUSE_PROTO = "auto";
+#elif defined(linux)
+static char DFLT_MOUSE_DEV[] = "/dev/input/mice";
+static char DFLT_MOUSE_PROTO[] = "auto";
#else
static char *DFLT_MOUSE_DEV = "/dev/mouse";
static char *DFLT_MOUSE_PROTO = "auto";
diff-tree 7da51447eaab34292e14077fb5a48e6b2e587781 (from 5d082f05632906c29296a44ef5c3a4962c0cbe62)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Thu Aug 17 21:24:07 2006 +0300
events.c: fix tiny XEvIE thinko
Make sure xeviehot gets updated after the ConfineToShape() call.
diff --git a/dix/events.c b/dix/events.c
index 7437bb4..7225543 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2016,14 +2016,14 @@ CheckMotion(xEvent *xE)
sprite.hot.y = sprite.physLimits.y1;
else if (sprite.hot.y >= sprite.physLimits.y2)
sprite.hot.y = sprite.physLimits.y2 - 1;
-#ifdef XEVIE
- xeviehot.x = sprite.hot.x;
- xeviehot.y = sprite.hot.y;
-#endif
#ifdef SHAPE
if (sprite.hotShape)
ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y);
#endif
+#ifdef XEVIE
+ xeviehot.x = sprite.hot.x;
+ xeviehot.y = sprite.hot.y;
+#endif
sprite.hotPhys = sprite.hot;
if ((sprite.hotPhys.x != XE_KBPTR.rootX) ||
(sprite.hotPhys.y != XE_KBPTR.rootY))
diff-tree 5d082f05632906c29296a44ef5c3a4962c0cbe62 (from a815b9b990e068f02d9cbba2b17f2cc3a30a9310)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Thu Aug 17 21:18:18 2006 +0300
events.c: make XEvIE a little less verbose
Change a lot of:
#ifdef XEVIE
xeviehot.x =
#endif
sprite.hot.x = ...
#ifdef XEVIE
xeviehot.y =
#endif
sprite.hot.y = ...
to one single
#ifdef XEVIE
xeviehot.x = sprite.hot.x;
xeviehot.y = sprite.hot.y;
#endif
at the end of the functions.
diff --git a/dix/events.c b/dix/events.c
index 20da048..7437bb4 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -458,13 +458,7 @@ XineramaCheckVirtualMotion(
if (qe)
{
sprite.hot.pScreen = qe->pScreen; /* should always be Screen 0 */
-#ifdef XEVIE
- xeviehot.x =
-#endif
sprite.hot.x = qe->event->u.keyButtonPointer.rootX;
-#ifdef XEVIE
- xeviehot.y =
-#endif
sprite.hot.y = qe->event->u.keyButtonPointer.rootY;
pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo :
NullWindow;
@@ -501,24 +495,12 @@ XineramaCheckVirtualMotion(
lims = *REGION_EXTENTS(sprite.screen, &sprite.Reg2);
if (sprite.hot.x < lims.x1)
-#ifdef XEVIE
- xeviehot.x =
-#endif
sprite.hot.x = lims.x1;
else if (sprite.hot.x >= lims.x2)
-#ifdef XEVIE
- xeviehot.x =
-#endif
sprite.hot.x = lims.x2 - 1;
if (sprite.hot.y < lims.y1)
-#ifdef XEVIE
- xeviehot.y =
-#endif
sprite.hot.y = lims.y1;
else if (sprite.hot.y >= lims.y2)
-#ifdef XEVIE
- xeviehot.y =
-#endif
sprite.hot.y = lims.y2 - 1;
if (REGION_NUM_RECTS(&sprite.Reg2) > 1)
@@ -531,6 +513,10 @@ XineramaCheckVirtualMotion(
qe->event->u.keyButtonPointer.rootY = sprite.hot.y;
}
}
+#ifdef XEVIE
+ xeviehot.x = sprite.hot.x;
+ xeviehot.y = sprite.hot.y;
+#endif
}
@@ -548,33 +534,15 @@ XineramaCheckMotion(xEvent *xE)
panoramiXdataPtr[0].x;
XE_KBPTR.rootY += panoramiXdataPtr[sprite.screen->myNum].y -
panoramiXdataPtr[0].y;
-#ifdef XEVIE
- xeviehot.x =
-#endif
sprite.hot.x = XE_KBPTR.rootX;
-#ifdef XEVIE
- xeviehot.y =
-#endif
sprite.hot.y = XE_KBPTR.rootY;
if (sprite.hot.x < sprite.physLimits.x1)
-#ifdef XEVIE
- xeviehot.x =
-#endif
sprite.hot.x = sprite.physLimits.x1;
else if (sprite.hot.x >= sprite.physLimits.x2)
-#ifdef XEVIE
- xeviehot.x =
-#endif
sprite.hot.x = sprite.physLimits.x2 - 1;
if (sprite.hot.y < sprite.physLimits.y1)
-#ifdef XEVIE
- xeviehot.y =
-#endif
sprite.hot.y = sprite.physLimits.y1;
else if (sprite.hot.y >= sprite.physLimits.y2)
-#ifdef XEVIE
- xeviehot.y =
-#endif
sprite.hot.y = sprite.physLimits.y2 - 1;
if (sprite.hotShape)
@@ -592,6 +560,8 @@ XineramaCheckMotion(xEvent *xE)
}
#ifdef XEVIE
+ xeviehot.x = sprite.hot.x;
+ xeviehot.y = sprite.hot.y;
xeviewin =
#endif
sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y);
@@ -817,13 +787,7 @@ CheckVirtualMotion(
if (qe)
{
sprite.hot.pScreen = qe->pScreen;
-#ifdef XEVIE
- xeviehot.x =
-#endif
sprite.hot.x = qe->event->u.keyButtonPointer.rootX;
-#ifdef XEVIE
- xeviehot.y =
-#endif
sprite.hot.y = qe->event->u.keyButtonPointer.rootY;
pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo :
NullWindow;
@@ -835,31 +799,16 @@ CheckVirtualMotion(
if (sprite.hot.pScreen != pWin->drawable.pScreen)
{
sprite.hot.pScreen = pWin->drawable.pScreen;
-#ifdef XEVIE
- xeviehot.x = xeviehot.y = 0;
-#endif
sprite.hot.x = sprite.hot.y = 0;
}
lims = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin->borderSize);
if (sprite.hot.x < lims.x1)
-#ifdef XEVIE
- xeviehot.x =
-#endif
sprite.hot.x = lims.x1;
else if (sprite.hot.x >= lims.x2)
-#ifdef XEVIE
- xeviehot.x =
-#endif
sprite.hot.x = lims.x2 - 1;
if (sprite.hot.y < lims.y1)
-#ifdef XEVIE
- xeviehot.y =
-#endif
sprite.hot.y = lims.y1;
else if (sprite.hot.y >= lims.y2)
-#ifdef XEVIE
- xeviehot.y =
-#endif
sprite.hot.y = lims.y2 - 1;
#ifdef SHAPE
if (wBoundingShape(pWin))
@@ -872,6 +821,10 @@ CheckVirtualMotion(
qe->event->u.keyButtonPointer.rootY = sprite.hot.y;
}
}
+#ifdef XEVIE
+ xeviehot.x = sprite.hot.x;
+ xeviehot.y = sprite.hot.y;
+#endif
ROOT = WindowTable[sprite.hot.pScreen->myNum];
}
@@ -2053,34 +2006,20 @@ CheckMotion(xEvent *xE)
sprite.hot.pScreen = sprite.hotPhys.pScreen;
ROOT = WindowTable[sprite.hot.pScreen->myNum];
}
-#ifdef XEVIE
- xeviehot.x =
-#endif
sprite.hot.x = XE_KBPTR.rootX;
-#ifdef XEVIE
- xeviehot.y =
-#endif
sprite.hot.y = XE_KBPTR.rootY;
if (sprite.hot.x < sprite.physLimits.x1)
-#ifdef XEVIE
- xeviehot.x =
-#endif
sprite.hot.x = sprite.physLimits.x1;
else if (sprite.hot.x >= sprite.physLimits.x2)
-#ifdef XEVIE
- xeviehot.x =
-#endif
sprite.hot.x = sprite.physLimits.x2 - 1;
if (sprite.hot.y < sprite.physLimits.y1)
-#ifdef XEVIE
- xeviehot.y =
-#endif
sprite.hot.y = sprite.physLimits.y1;
else if (sprite.hot.y >= sprite.physLimits.y2)
+ sprite.hot.y = sprite.physLimits.y2 - 1;
#ifdef XEVIE
- xeviehot.y =
+ xeviehot.x = sprite.hot.x;
+ xeviehot.y = sprite.hot.y;
#endif
- sprite.hot.y = sprite.physLimits.y2 - 1;
#ifdef SHAPE
if (sprite.hotShape)
ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y);
diff-tree a815b9b990e068f02d9cbba2b17f2cc3a30a9310 (from parents)
Merge: 37943e2f1abc6709ff739000372b0394d5cd18c5 984babe86bf82002b4d6589b2750c7b5a5489bd5
Author: George Sapountzis <gsap7 at yahoo.gr>
Date: Sat Aug 12 21:58:33 2006 +0300
Merge branch 'master' of git+ssh://gsap7@git.freedesktop.org/git/xorg/xserver
diff-tree 984babe86bf82002b4d6589b2750c7b5a5489bd5 (from f7919c287936f55569c2301ebb1b5f52358e70fa)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Sat Aug 12 21:43:38 2006 +0300
remove obsolete vendor defines
Remove random behaviour changes for SGI and MetroLink.
diff --git a/dix/devices.c b/dix/devices.c
index 15b32c6..bcf8f4f 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -667,13 +667,7 @@ InitPtrFeedbackClassDeviceStruct(DeviceI
if (!feedc)
return FALSE;
feedc->CtrlProc = controlProc;
-#ifdef sgi
- feedc->ctrl.num = 1;
- feedc->ctrl.den = 1;
- feedc->ctrl.threshold = 1;
-#else
feedc->ctrl = defaultPointerControl;
-#endif
feedc->ctrl.id = 0;
if ( (feedc->next = dev->ptrfeed) )
feedc->ctrl.id = dev->ptrfeed->ctrl.id + 1;
diff --git a/os/utils.c b/os/utils.c
index b15700f..6bf8624 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -271,10 +271,6 @@ long Memory_fail = 0;
#include <stdlib.h> /* for random() */
#endif
-#ifdef sgi
-int userdefinedfontpath = 0;
-#endif /* sgi */
-
char *dev_tty_from_init = NULL; /* since we need to parse it anyway */
OsSigHandlerPtr
@@ -843,9 +839,6 @@ ProcessCommandLine(int argc, char *argv[
{
if(++i < argc)
{
-#ifdef sgi
- userdefinedfontpath = 1;
-#endif /* sgi */
defaultFontPath = argv[i];
}
else
diff --git a/xkb/xkbPrKeyEv.c b/xkb/xkbPrKeyEv.c
index b2a7ab2..9944c88 100644
--- a/xkb/xkbPrKeyEv.c
+++ b/xkb/xkbPrKeyEv.c
@@ -150,11 +150,7 @@ unsigned ndx;
break;
default:
ErrorF("unknown key behavior 0x%04x\n",behavior.type);
-#if defined(MetroLink)
- return;
-#else
break;
-#endif
}
}
XkbHandleActions(keybd,keybd,xE,count);
diff-tree 37943e2f1abc6709ff739000372b0394d5cd18c5 (from e641000b98e7c2e92e3c801eaa42aa15d5c16ad0)
Author: George Sapountzis <gsap7 at yahoo.gr>
Date: Sat Aug 12 20:54:33 2006 +0300
Call exaTryComponentAlphaHelper() for solid src also.
Also, rename to exaTryMagicTwoPassCompositeHelper() as it is now called for
non-component-alpha masks also, and add function description from
http://anholt.livejournal.com/32058.html.
diff --git a/exa/exa_render.c b/exa/exa_render.c
index 2187af8..9affb9f 100644
--- a/exa/exa_render.c
+++ b/exa/exa_render.c
@@ -452,24 +452,72 @@ exaTryDriverComposite(CARD8 op,
return 1;
}
+/**
+ * exaTryMagicTwoPassCompositeHelper implements PictOpOver using two passes of
+ * simpler operations PictOpOutReverse and PictOpAdd. Mainly used for component
+ * alpha and limited 1-tmu cards.
+ *
+ * From http://anholt.livejournal.com/32058.html:
+ *
+ * The trouble is that component-alpha rendering requires two different sources
+ * for blending: one for the source value to the blender, which is the
+ * per-channel multiplication of source and mask, and one for the source alpha
+ * for multiplying with the destination channels, which is the multiplication
+ * of the source channels by the mask alpha. So the equation for Over is:
+ *
+ * dst.A = src.A * mask.A + (1 - (src.A * mask.A)) * dst.A
+ * dst.R = src.R * mask.R + (1 - (src.A * mask.R)) * dst.R
+ * dst.G = src.G * mask.G + (1 - (src.A * mask.G)) * dst.G
+ * dst.B = src.B * mask.B + (1 - (src.A * mask.B)) * dst.B
+ *
+ * But we can do some simpler operations, right? How about PictOpOutReverse,
+ * which has a source factor of 0 and dest factor of (1 - source alpha). We
+ * can get the source alpha value (srca.X = src.A * mask.X) out of the texture
+ * blenders pretty easily. So we can do a component-alpha OutReverse, which
+ * gets us:
+ *
+ * dst.A = 0 + (1 - (src.A * mask.A)) * dst.A
+ * dst.R = 0 + (1 - (src.A * mask.R)) * dst.R
+ * dst.G = 0 + (1 - (src.A * mask.G)) * dst.G
+ * dst.B = 0 + (1 - (src.A * mask.B)) * dst.B
+ *
+ * OK. And if an op doesn't use the source alpha value for the destination
+ * factor, then we can do the channel multiplication in the texture blenders
+ * to get the source value, and ignore the source alpha that we wouldn't use.
+ * We've supported this in the Radeon driver for a long time. An example would
+ * be PictOpAdd, which does:
+ *
+ * dst.A = src.A * mask.A + dst.A
+ * dst.R = src.R * mask.R + dst.R
+ * dst.G = src.G * mask.G + dst.G
+ * dst.B = src.B * mask.B + dst.B
+ *
+ * Hey, this looks good! If we do a PictOpOutReverse and then a PictOpAdd right
+ * after it, we get:
+ *
+ * dst.A = src.A * mask.A + ((1 - (src.A * mask.A)) * dst.A)
+ * dst.R = src.R * mask.R + ((1 - (src.A * mask.R)) * dst.R)
+ * dst.G = src.G * mask.G + ((1 - (src.A * mask.G)) * dst.G)
+ * dst.B = src.B * mask.B + ((1 - (src.A * mask.B)) * dst.B)
+ */
+
static int
-exaTryComponentAlphaHelper(CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
+exaTryMagicTwoPassCompositeHelper(CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height)
{
ExaScreenPriv (pDst->pDrawable->pScreen);
assert(op == PictOpOver);
- assert(pMask->componentAlpha == TRUE);
if (pExaScr->info->CheckComposite &&
(!(*pExaScr->info->CheckComposite)(PictOpOutReverse, pSrc, pMask,
@@ -580,19 +628,30 @@ exaComposite(CARD8 op,
(!pMask || !pMask->repeat || pMask->repeat == RepeatNormal) &&
!pSrc->alphaMap && (!pMask || !pMask->alphaMap) && !pDst->alphaMap)
{
+ Bool isSrcSolid;
+
ret = exaTryDriverComposite(op, pSrc, pMask, pDst, xSrc, ySrc, xMask,
yMask, xDst, yDst, width, height);
if (ret == 1)
goto done;
+ /* For generic masks and solid src pictures, mach64 can do Over in two
+ * passes, similar to the component-alpha case.
+ */
+ isSrcSolid = pSrc->pDrawable->width == 1 &&
+ pSrc->pDrawable->height == 1 &&
+ pSrc->repeat;
+
/* If we couldn't do the Composite in a single pass, and it was a
* component-alpha Over, see if we can do it in two passes with
* an OutReverse and then an Add.
*/
- if (ret == -1 && pMask && pMask->componentAlpha && op == PictOpOver) {
- ret = exaTryComponentAlphaHelper(op, pSrc, pMask, pDst, xSrc, ySrc,
- xMask, yMask, xDst, yDst,
- width, height);
+ if (ret == -1 && op == PictOpOver && pMask &&
+ (pMask->componentAlpha || isSrcSolid)) {
+ ret = exaTryMagicTwoPassCompositeHelper(op, pSrc, pMask, pDst,
+ xSrc, ySrc,
+ xMask, yMask, xDst, yDst,
+ width, height);
if (ret == 1)
goto done;
}
diff-tree f7919c287936f55569c2301ebb1b5f52358e70fa (from e641000b98e7c2e92e3c801eaa42aa15d5c16ad0)
Author: Bastian Blank <waldi at debian.org>
Date: Sat Aug 12 20:43:25 2006 +0300
xfree86: don't do legacy IO on ARM or S/390 (Debian #362641)
Don't attempt to poke legacy IO ranges on ARM or S/390.
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index e5c9615..e208378 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -3018,7 +3018,7 @@ static void
CheckGenericGA()
{
/* This needs to be changed for multiple domains */
-#if !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) && !defined(__ia64__)
+#if !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__arm__) && !defined(__s390__)
IOADDRESS GenericIOBase = VGAHW_GET_IOBASE();
CARD8 CurrentValue, TestValue;
diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
index 051970b..4b58046 100644
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ b/hw/xfree86/os-support/linux/lnx_video.c
@@ -464,7 +464,7 @@ mapVidMem(int ScreenNum, unsigned long B
Base,realBase,alignOff);
#endif
-#if defined(__ia64__)
+#if defined(__ia64__) || defined(__arm__) || defined(__s390__)
#ifndef MAP_WRITECOMBINED
#define MAP_WRITECOMBINED 0x00010000
#endif
@@ -594,7 +594,7 @@ xf86DisableIO(void)
#if defined(__powerpc__)
munmap(ioBase, 0x20000);
ioBase = NULL;
-#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__)
+#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)
iopl(0);
ioperm(0, 1024, 0);
#endif
@@ -613,12 +613,12 @@ xf86DisableIO(void)
_X_EXPORT Bool
xf86DisableInterrupts()
{
-#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__sh__) && !defined(__hppa__)
+#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)
if (!ExtendedEnabled)
if (iopl(3) || ioperm(0, 1024, 1))
return (FALSE);
#endif
-#if defined(__alpha__) || defined(__mc68000__) || defined(__powerpc__) || defined(__sparc__) || defined(__mips__) || defined(__arm__) || defined(__sh__) || defined(__ia64__) || defined(__hppa__)
+#if defined(__alpha__) || defined(__mc68000__) || defined(__powerpc__) || defined(__sparc__) || defined(__mips__) || defined(__arm__) || defined(__sh__) || defined(__ia64__) || defined(__hppa__) || defined(__s390__)
#else
# ifdef __GNUC__
# if defined(__ia64__)
@@ -632,7 +632,7 @@ xf86DisableInterrupts()
asm("cli");
# endif
#endif
-#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__ia64__) && !defined(__hppa__)
+#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__ia64__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)
if (!ExtendedEnabled) {
iopl(0);
ioperm(0, 1024, 0);
@@ -645,12 +645,12 @@ xf86DisableInterrupts()
_X_EXPORT void
xf86EnableInterrupts()
{
-#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__sh__) && !defined(__hppa__)
+#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)
if (!ExtendedEnabled)
if (iopl(3) || ioperm(0, 1024, 1))
return;
#endif
-#if defined(__alpha__) || defined(__mc68000__) || defined(__powerpc__) || defined(__sparc__) || defined(__mips__) || defined(__arm__) || defined(__sh__) || defined(__ia64__) || defined(__hppa__)
+#if defined(__alpha__) || defined(__mc68000__) || defined(__powerpc__) || defined(__sparc__) || defined(__mips__) || defined(__arm__) || defined(__sh__) || defined(__ia64__) || defined(__hppa__) || defined(__s390__)
#else
# ifdef __GNUC__
# if defined(__ia64__)
@@ -664,7 +664,7 @@ xf86EnableInterrupts()
asm("sti");
# endif
#endif
-#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__ia64__) && !defined(__hppa__)
+#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__ia64__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)
if (!ExtendedEnabled) {
iopl(0);
ioperm(0, 1024, 0);
diff --git a/hw/xfree86/vgahw/vgaHW.h b/hw/xfree86/vgahw/vgaHW.h
index 0879f96..ff7d1e5 100644
--- a/hw/xfree86/vgahw/vgaHW.h
+++ b/hw/xfree86/vgahw/vgaHW.h
@@ -175,7 +175,7 @@ typedef struct _vgaHWRec {
#define BITS_PER_GUN 6
#define COLORMAP_SIZE 256
-#if defined(__powerpc__)
+#if defined(__powerpc__) || defined(__arm__) || defined(__s390__)
#define DACDelay(hw) /* No legacy VGA support */
#else
#define DACDelay(hw) \
diff-tree e641000b98e7c2e92e3c801eaa42aa15d5c16ad0 (from 5a3488ccac8e5dabd9fc98bc41ef178ead1b2faf)
Author: Samuel Thibault <samuel.thibault at ens-lyon.org>
Date: Sat Aug 12 19:41:59 2006 +0300
xfree86: add Hurd support (#5613)
Add support for GNU/Hurd.
diff --git a/configure.ac b/configure.ac
index dce4f32..da3e55d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1162,6 +1162,10 @@ int main () {
fi
AC_SUBST([SOLARIS_ASM_CFLAGS])
;;
+ gnu*)
+ XORG_OS="gnu"
+ XORG_OS_SUBDIR="hurd"
+ ;;
*)
XORG_OS="unknown"
XORG_OS_SUBDIR="unknown"
@@ -1667,6 +1671,7 @@ hw/xfree86/os-support/Makefile
hw/xfree86/os-support/bsd/Makefile
hw/xfree86/os-support/bus/Makefile
hw/xfree86/os-support/drm/Makefile
+hw/xfree86/os-support/hurd/Makefile
hw/xfree86/os-support/misc/Makefile
hw/xfree86/os-support/linux/Makefile
hw/xfree86/os-support/lynxos/Makefile
diff --git a/hw/xfree86/os-support/Makefile.am b/hw/xfree86/os-support/Makefile.am
index 7897674..e64703a 100644
--- a/hw/xfree86/os-support/Makefile.am
+++ b/hw/xfree86/os-support/Makefile.am
@@ -3,7 +3,7 @@ DRI_SUBDIRS=drm
endif
SUBDIRS = bus @XORG_OS_SUBDIR@ misc $(DRI_SUBDIRS)
-DIST_SUBDIRS = bsd bus drm misc linux lynxos solaris sysv sco usl
+DIST_SUBDIRS = bsd bus drm misc linux lynxos solaris sysv sco usl hurd
sdk_HEADERS = xf86_OSproc.h xf86_OSlib.h xf86_ansic.h xf86_libc.h \
assyntax.h xf86OSKbd.h xf86OSmouse.h
diff --git a/hw/xfree86/os-support/hurd/Makefile.am b/hw/xfree86/os-support/hurd/Makefile.am
new file mode 100644
index 0000000..a050876
--- /dev/null
+++ b/hw/xfree86/os-support/hurd/Makefile.am
@@ -0,0 +1,17 @@
+noinst_LTLIBRARIES = libhurd.la
+
+libhurd_la_SOURCES = hurd_init.c hurd_mmap.c \
+ hurd_mouse.c hurd_video.c \
+ $(srcdir)/../shared/VTsw_noop.c \
+ $(srcdir)/../shared/posix_tty.c \
+ $(srcdir)/../shared/libc_wrapper.c \
+ $(srcdir)/../shared/stdResource.c \
+ $(srcdir)/../shared/stdPci.c \
+ $(srcdir)/../shared/sigiostubs.c \
+ $(srcdir)/../shared/pm_noop.c \
+ $(srcdir)/../shared/kmod_noop.c \
+ $(srcdir)/../shared/agp_noop.c
+
+AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) @SERVER_DEFINES@ @LOADER_DEFINES@
+
+INCLUDES = $(XORG_INCS)
diff --git a/hw/xfree86/os-support/hurd/hurd_init.c b/hw/xfree86/os-support/hurd/hurd_init.c
new file mode 100644
index 0000000..aec5b3d
--- /dev/null
+++ b/hw/xfree86/os-support/hurd/hurd_init.c
@@ -0,0 +1,90 @@
+/*
+ * Copyright 1997,1998 by UCHIYAMA Yasushi
+ *
+ * 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 UCHIYAMA Yasushi not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. UCHIYAMA Yasushi makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * UCHIYAMA YASUSHI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL UCHIYAMA YASUSHI 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.
+ *
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/hurd/hurd_init.c,v 1.1 1998/08/16 10:25:48 dawes Exp $ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+
+#include "input.h"
+#include "scrnintstr.h"
+
+#include "compiler.h"
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#include <stdio.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <sys/file.h>
+#include <assert.h>
+#include <mach.h>
+
+int
+xf86ProcessArgument( int argc,char **argv, int i )
+{
+ return 0;
+}
+void
+xf86UseMsg()
+{
+ return;
+}
+
+
+void
+xf86OpenConsole()
+{
+ if( serverGeneration == 1 )
+ {
+ kern_return_t err;
+ mach_port_t device;
+ int fd;
+ err = get_privileged_ports( NULL, &device );
+ if( err )
+ {
+ errno = err;
+ FatalError( "xf86KbdInit can't get_privileged_ports. (%s)\n" , strerror(errno) );
+ }
+ mach_port_deallocate (mach_task_self (), device);
+
+ if( ( fd = open( "/dev/kbd" , O_RDONLY|O_NONBLOCK ) ) < 0 )
+ {
+ fprintf( stderr , "Cannot open keyboard (%s)\n",strerror(errno) );
+ exit(1);
+ }
+ xf86Info.consoleFd = fd;
+ }
+ return;
+}
+
+void
+xf86CloseConsole()
+{
+ close( xf86Info.consoleFd );
+ return;
+}
diff --git a/hw/xfree86/os-support/hurd/hurd_mmap.c b/hw/xfree86/os-support/hurd/hurd_mmap.c
new file mode 100644
index 0000000..5e800d2
--- /dev/null
+++ b/hw/xfree86/os-support/hurd/hurd_mmap.c
@@ -0,0 +1,96 @@
+/*
+ * Copyright 1997 by UCHIYAMA Yasushi
+ *
+ * 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 UCHIYAMA Yasushi not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. UCHIYAMA Yasushi makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * UCHIYAMA YASUSHI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL UCHIYAMA YASUSHI 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.
+ *
+ */
+/* $XFree86$ */
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include<mach.h>
+#include<device/device.h>
+#include<mach/machine/mach_i386.h>
+
+#include <X11/X.h>
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#define BIOS_SIZE 0x20000
+
+int
+xf86ReadBIOS(unsigned long Base,unsigned long Offset,unsigned char *Buf,int Len)
+{
+ mach_port_t device,iopl_dev;
+ memory_object_t iopl_mem;
+ vm_address_t addr = (vm_address_t)0; /* serach starting address */
+ kern_return_t err;
+
+
+ err = get_privileged_ports (NULL, &device);
+ if( err )
+ {
+ errno = err;
+ FatalError("xf86ReadBIOS() can't get_privileged_ports. (%s)\n",strerror(errno));
+ }
+ err = device_open(device,D_READ|D_WRITE,"iopl",&iopl_dev);
+ mach_port_deallocate (mach_task_self (), device);
+ if( err )
+ {
+ errno = err;
+ FatalError("xf86ReadBIOS() can't device_open. (%s)\n",strerror(errno));
+ }
+ err = device_map(iopl_dev,VM_PROT_READ|VM_PROT_WRITE, Base , BIOS_SIZE ,&iopl_mem,0);
+ if( err )
+ {
+ errno = err;
+ FatalError("xf86ReadBIOS() can't device_map. (%s)\n",strerror(errno));
+ }
+ err = vm_map(mach_task_self(),
+ &addr,
+ BIOS_SIZE,
+ 0,
+ TRUE,
+ iopl_mem,
+ Base,
+ FALSE,
+ VM_PROT_READ|VM_PROT_WRITE,
+ VM_PROT_READ|VM_PROT_WRITE,
+ VM_INHERIT_SHARE);
+ mach_port_deallocate(mach_task_self(),iopl_mem);
+ if( err )
+ {
+ errno = err;
+ FatalError("xf86ReadBIOS() can't vm_map. (%s)\n",strerror(errno));
+ }
+
+ memcpy(Buf,(void*)((int)addr + Offset), Len);
+
+ err = vm_deallocate(mach_task_self(), addr, BIOS_SIZE);
+ if( err )
+ {
+ errno = err;
+ FatalError("xf86ReadBIOS() can't vm_deallocate. (%s)\n",strerror(errno));
+ }
+
+ return Len;
+}
diff --git a/hw/xfree86/os-support/hurd/hurd_mouse.c b/hw/xfree86/os-support/hurd/hurd_mouse.c
new file mode 100644
index 0000000..e7a2da8
--- /dev/null
+++ b/hw/xfree86/os-support/hurd/hurd_mouse.c
@@ -0,0 +1,301 @@
+/*
+ * Copyright 1997,1998 by UCHIYAMA Yasushi
+ *
+ * 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 UCHIYAMA Yasushi not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. UCHIYAMA Yasushi makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * UCHIYAMA YASUSHI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL UCHIYAMA YASUSHI 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.
+ *
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/hurd/hurd_mouse.c,v 1.7 2000/02/10 22:33:44 dawes Exp $ */
+
+#define NEED_EVENTS
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "inputstr.h"
+#include "scrnintstr.h"
+#include "mipointer.h"
+
+#include "xf86.h"
+#include "xf86Xinput.h"
+#include "xf86OSmouse.h"
+#include "xf86_OSlib.h"
+#include "xisb.h"
+
+#include <stdio.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <sys/file.h>
+#include <assert.h>
+#include <mach.h>
+#include <sys/ioctl.h>
+
+typedef unsigned short kev_type; /* kd event type */
+typedef unsigned char Scancode;
+
+struct mouse_motion {
+ short mm_deltaX; /* units? */
+ short mm_deltaY;
+};
+
+typedef struct {
+ kev_type type; /* see below */
+ struct timeval time; /* timestamp */
+ union { /* value associated with event */
+ boolean_t up; /* MOUSE_LEFT .. MOUSE_RIGHT */
+ Scancode sc; /* KEYBD_EVENT */
+ struct mouse_motion mmotion; /* MOUSE_MOTION */
+ } value;
+} kd_event;
+
+/*
+ * kd_event ID's.
+ */
+#define MOUSE_LEFT 1 /* mouse left button up/down */
+#define MOUSE_MIDDLE 2
+#define MOUSE_RIGHT 3
+#define MOUSE_MOTION 4 /* mouse motion */
+#define KEYBD_EVENT 5 /* key up/down */
+
+#define NUMEVENTS 64
+
+/*
+ * OsMouseProc --
+ * Handle the initialization, etc. of a mouse
+ */
+static int
+OsMouseProc(DeviceIntPtr pPointer, int what)
+{
+ InputInfoPtr pInfo;
+ MouseDevPtr pMse;
+ unsigned char map[MSE_MAXBUTTONS + 1];
+ int nbuttons;
+
+ pInfo = pPointer->public.devicePrivate;
+ pMse = pInfo->private;
+ pMse->device = pPointer;
+
+ switch (what) {
+ case DEVICE_INIT:
+ pPointer->public.on = FALSE;
+
+ for (nbuttons = 0; nbuttons < MSE_MAXBUTTONS; ++nbuttons)
+ map[nbuttons + 1] = nbuttons + 1;
+
+ InitPointerDeviceStruct((DevicePtr)pPointer,
+ map,
+ min(pMse->buttons, MSE_MAXBUTTONS),
+ miPointerGetMotionEvents,
+ pMse->Ctrl,
+ miPointerGetMotionBufferSize());
+
+ /* X valuator */
+ xf86InitValuatorAxisStruct(pPointer, 0, 0, -1, 1, 0, 1);
+ xf86InitValuatorDefaults(pPointer, 0);
+ /* Y valuator */
+ xf86InitValuatorAxisStruct(pPointer, 1, 0, -1, 1, 0, 1);
+ xf86InitValuatorDefaults(pPointer, 1);
+ xf86MotionHistoryAllocate(pInfo);
+ break;
+
+ case DEVICE_ON:
+ pInfo->fd = xf86OpenSerial(pInfo->options);
+ if (pInfo->fd == -1)
+ xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
+ else {
+ pMse->buffer = XisbNew(pInfo->fd,
+ NUMEVENTS * sizeof(kd_event));
+ if (!pMse->buffer) {
+ xfree(pMse);
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+ } else {
+ xf86FlushInput(pInfo->fd);
+ AddEnabledDevice(pInfo->fd);
+ }
+ }
+ pMse->lastButtons = 0;
+ pMse->lastMappedButtons = 0;
+ pMse->emulateState = 0;
+ pPointer->public.on = TRUE;
+ break;
+
+ case DEVICE_OFF:
+ case DEVICE_CLOSE:
+ if (pInfo->fd != -1) {
+ RemoveEnabledDevice(pInfo->fd);
+ if (pMse->buffer) {
+ XisbFree(pMse->buffer);
+ pMse->buffer = NULL;
+ }
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+ }
+ pPointer->public.on = FALSE;
+ usleep(300000);
+ break;
+ }
+ return Success;
+}
+
+/*
+ * OsMouseReadInput --
+ * Get some events from our queue. Process all outstanding events now.
+ */
+static void
+OsMouseReadInput(InputInfoPtr pInfo)
+{
+ MouseDevPtr pMse;
+ static kd_event eventList[NUMEVENTS];
+ int n, c;
+ kd_event *event = eventList;
+ unsigned char *pBuf;
+
+ pMse = pInfo->private;
+
+ XisbBlockDuration(pMse->buffer, -1);
+ pBuf = (unsigned char *)eventList;
+ n = 0;
+ while ((c = XisbRead(pMse->buffer)) >= 0 && n < sizeof(eventList))
+ pBuf[n++] = (unsigned char)c;
+
+ if (n == 0)
+ return;
+
+ n /= sizeof(kd_event);
+ while( n-- ) {
+ int buttons = pMse->lastButtons;
+ int dx = 0, dy = 0;
+ switch (event->type) {
+ case MOUSE_RIGHT:
+ buttons = buttons & 6 |(event->value.up ? 0 : 1);
+ break;
+ case MOUSE_MIDDLE:
+ buttons = buttons & 5 |(event->value.up ? 0 : 2);
+ break;
+ case MOUSE_LEFT:
+ buttons = buttons & 3 |(event->value.up ? 0 : 4) ;
+ break;
+ case MOUSE_MOTION:
+ dx = event->value.mmotion.mm_deltaX;
+ dy = - event->value.mmotion.mm_deltaY;
+ break;
+ default:
+ ErrorF("Bad mouse event (%d)\n",event->type);
+ continue;
+ }
+ pMse->PostEvent(pInfo, buttons, dx, dy, 0, 0);
+ ++event;
+ }
+ return;
+}
+
+static Bool
+OsMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags)
+{
+ MouseDevPtr pMse;
+
+ /* This is called when the protocol is "OSMouse". */
+
+ pMse = pInfo->private;
+ pMse->protocol = protocol;
+ xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
+
+ /* Collect the options, and process the common options. */
+ xf86CollectInputOptions(pInfo, NULL, NULL);
+ xf86ProcessCommonOptions(pInfo, pInfo->options);
+
+ /* Check if the device can be opened. */
+ pInfo->fd = xf86OpenSerial(pInfo->options);
+ if (pInfo->fd == -1) {
+ if (xf86GetAllowMouseOpenFail())
+ xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
+ else {
+ xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
+ xfree(pMse);
+ return FALSE;
+ }
+ }
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+
+ /* Process common mouse options (like Emulate3Buttons, etc). */
+ pMse->CommonOptions(pInfo);
+
+ /* Setup the local procs. */
+ pInfo->device_control = OsMouseProc;
+ pInfo->read_input = OsMouseReadInput;
+
+ pInfo->flags |= XI86_CONFIGURED;
+ return TRUE;
+}
+
+static int
+SupportedInterfaces(void)
+{
+ /* XXX Need to check this. */
+ return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO;
+}
+
+static const char *internalNames[] = {
+ "OSMouse",
+ NULL
+};
+
+static const char **
+BuiltinNames(void)
+{
+ return internalNames;
+}
+
+static Bool
+CheckProtocol(const char *protocol)
+{
+ int i;
+
+ for (i = 0; internalNames[i]; i++)
+ if (xf86NameCmp(protocol, internalNames[i]) == 0)
+ return TRUE;
+ return FALSE;
+}
+
+/* XXX Is this appropriate? If not, this function should be removed. */
+static const char *
+DefaultProtocol(void)
+{
+ return "OSMouse";
+}
+
+OSMouseInfoPtr
+xf86OSMouseInit(int flags)
+{
+ OSMouseInfoPtr p;
+
+ p = xcalloc(sizeof(OSMouseInfoRec), 1);
+ if (!p)
+ return NULL;
+ p->SupportedInterfaces = SupportedInterfaces;
+ p->BuiltinNames = BuiltinNames;
+ p->DefaultProtocol = DefaultProtocol;
+ p->CheckProtocol = CheckProtocol;
+ p->PreInit = OsMousePreInit;
+ return p;
+}
+
diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c
new file mode 100644
index 0000000..45e9a09
--- /dev/null
+++ b/hw/xfree86/os-support/hurd/hurd_video.c
@@ -0,0 +1,191 @@
+/*
+ * Copyright 1997, 1998 by UCHIYAMA Yasushi
+ *
+ * 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 UCHIYAMA Yasushi not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. UCHIYAMA Yasushi makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * UCHIYAMA YASUSHI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL UCHIYAMA YASUSHI 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.
+ *
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/hurd/hurd_video.c,v 1.3 1999/04/29 12:24:52 dawes Exp $ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <mach.h>
+#include <device/device.h>
+#include <mach/machine/mach_i386.h>
+
+#include <X11/X.h>
+#include "input.h"
+#include "scrnintstr.h"
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+/**************************************************************************
+ * Video Memory Mapping section
+ ***************************************************************************/
+pointer
+xf86MapVidMem(int ScreenNum,int Flags, unsigned long Base, unsigned long Size)
+{
+ mach_port_t device,iopl_dev;
+ memory_object_t iopl_mem;
+ kern_return_t err;
+ vm_address_t addr=(vm_address_t)0;
+
+ err = get_privileged_ports (NULL, &device);
+ if( err )
+ {
+ errno = err;
+ FatalError("xf86MapVidMem() can't get_privileged_ports. (%s)\n",strerror(errno));
+ }
+ err = device_open(device,D_READ|D_WRITE,"iopl",&iopl_dev);
+ mach_port_deallocate (mach_task_self(), device);
+ if( err )
+ {
+ errno = err;
+ FatalError("xf86MapVidMem() can't device_open. (%s)\n",strerror(errno));
+ }
+
+ err = device_map(iopl_dev,VM_PROT_READ|VM_PROT_WRITE, Base , Size ,&iopl_mem,0);
+ if( err )
+ {
+ errno = err;
+ FatalError("xf86MapVidMem() can't device_map. (%s)\n",strerror(errno));
+ }
+ err = vm_map(mach_task_self(),
+ &addr,
+ Size,
+ 0, /* mask */
+ TRUE, /* anywhere */
+ iopl_mem,
+ (vm_offset_t)Base,
+ FALSE, /* copy on write */
+ VM_PROT_READ|VM_PROT_WRITE,
+ VM_PROT_READ|VM_PROT_WRITE,
+ VM_INHERIT_SHARE);
+ mach_port_deallocate(mach_task_self(),iopl_mem);
+ if( err )
+ {
+ errno = err;
+ FatalError("xf86MapVidMem() can't vm_map.(iopl_mem) (%s)\n",strerror(errno));
+ }
+ mach_port_deallocate(mach_task_self(),iopl_dev);
+ if( err )
+ {
+ errno = err;
+ FatalError("xf86MapVidMem() can't mach_port_deallocate.(iopl_dev) (%s)\n",strerror(errno));
+ }
+ return (pointer)addr;
+}
+
+void
+xf86UnMapVidMem(int ScreenNum,pointer Base,unsigned long Size)
+{
+ kern_return_t err = vm_deallocate(mach_task_self(), (int)Base, Size);
+ if( err )
+ {
+ errno = err;
+ ErrorF("xf86UnMapVidMem: can't dealloc framebuffer space (%s)\n",strerror(errno));
+ }
+ return;
+}
+
+Bool
+xf86LinearVidMem()
+{
+ return(TRUE);
+}
+
+/**************************************************************************
+ * I/O Permissions section
+ ***************************************************************************/
+mach_port_t io_port;
+
+Bool
+xf86EnableIO()
+{
+ mach_port_t device;
+ kern_return_t err;
+
+ err = get_privileged_ports(NULL, &device);
+ if( err )
+ {
+ errno = err;
+ FatalError("xf86EnableIO() can't get_privileged_ports. (%s)\n",strerror(errno));
+ }
+ err = device_open(device,D_READ|D_WRITE,"io",&io_port);
+ mach_port_deallocate(mach_task_self(), device);
+ if( err )
+ {
+ errno = err;
+ FatalError("xf86EnableIO() can't device_open. (%s)\n",strerror(errno));
+ }
+
+ err = i386_io_port_add(mach_thread_self (), io_port);
+ if( err )
+ {
+ errno = err;
+ FatalError("xf86EnableIO() can't i386_io_port_add.(io_port) (%s)\n",strerror(errno));
+ }
+ return TRUE;
+}
+
+void
+xf86DisableIO()
+{
+ kern_return_t err;
+
+ err = i386_io_port_remove(mach_thread_self (), io_port);
+ if( err )
+ {
+ errno = err;
+ FatalError("xf86DisableIO() can't i386_io_port_remove.(io_port) (%s)\n",strerror(errno));
+ }
+ mach_port_deallocate(mach_task_self(), io_port);
+ return;
+}
+
+/**************************************************************************
+ * Interrupt Handling section
+ **************************************************************************/
+Bool
+xf86DisableInterrupts()
+{
+ return TRUE;
+}
+void
+xf86EnableInterrupts()
+{
+ return;
+}
+
+void
+xf86MapReadSideEffects(int ScreenNum, int Flags, pointer Base,
+ unsigned long Size)
+{
+}
+
+Bool
+xf86CheckMTRR(int s)
+{
+ return FALSE;
+}
+
diff-tree 5a3488ccac8e5dabd9fc98bc41ef178ead1b2faf (from c4951e0a6b6cf3eeee710cc5cda1d9bc929ee3d7)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Sat Aug 12 19:25:06 2006 +0300
configure.ac: fix execinfo.h test (Debian #363218)
Define HAVE_EXECINFO_H as well as HAVE_BACKTRACE, when we find execinfo.h.
diff --git a/configure.ac b/configure.ac
index 46b1280..dce4f32 100644
--- a/configure.ac
+++ b/configure.ac
@@ -174,6 +174,7 @@ dnl glibc backtrace support check (hw/xf
AC_CHECK_HEADER([execinfo.h],[
AC_CHECK_LIB(c, backtrace, [
AC_DEFINE(HAVE_BACKTRACE, 1, [Has backtrace support])
+ AC_DEFINE(HAVE_EXECINFO_H, 1, [Have execinfo.h])
])]
)
diff --git a/include/xorg-config.h.in b/include/xorg-config.h.in
index e43d1d1..4a64522 100644
--- a/include/xorg-config.h.in
+++ b/include/xorg-config.h.in
@@ -109,4 +109,7 @@
/* Name of the period field in struct kbd_repeat */
#undef LNX_KBD_PERIOD_NAME
+/* Have execinfo.h */
+#undef HAVE_EXECINFO_H
+
#endif /* _XORG_CONFIG_H_ */
diff-tree c4951e0a6b6cf3eeee710cc5cda1d9bc929ee3d7 (from e1921f014b102e3eecf3b41972f8672cf23264d6)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Thu Aug 10 20:49:06 2006 -0400
Fix a mode sanity check to not break reduced-blanking setups (LCDs).
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index b892e3e..72dd1ca 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -1758,7 +1758,8 @@ xf86ValidateModes(ScrnInfoPtr scrp, Disp
* horizontal timing parameters that CRTs may have
* problems with.
*/
- if ((q->type & M_T_DEFAULT) &&
+ if (!scrp->monitor->reducedblanking &&
+ (q->type & M_T_DEFAULT) &&
((double)q->HTotal / (double)q->HDisplay) < 1.15)
continue;
diff-tree e1921f014b102e3eecf3b41972f8672cf23264d6 (from db82e12fac5eaa16a39fc1bd0bc31ad95089dc95)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Thu Aug 10 20:43:15 2006 -0400
Rename some mode tokens to better reflect their use.
Per #5386, M_T_EDID -> M_T_DRIVER, since it's really for any driver-detected
mode. Also add M_T_PREFERRED bit, to select a 'best' mode out of a set.
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index 0c33afb..ae9d9ae 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -119,14 +119,19 @@ typedef enum {
MODE_ERROR = -1 /* error condition */
} ModeStatus;
+/*
+ * The mode sets are, from best to worst: USERDEF, DRIVER, and DEFAULT/BUILTIN.
+ * Preferred will bubble a mode to the top within a set.
+ */
# define M_T_BUILTIN 0x01 /* built-in mode */
# define M_T_CLOCK_C (0x02 | M_T_BUILTIN) /* built-in mode - configure clock */
# define M_T_CRTC_C (0x04 | M_T_BUILTIN) /* built-in mode - configure CRTC */
# define M_T_CLOCK_CRTC_C (M_T_CLOCK_C | M_T_CRTC_C)
/* built-in mode - configure CRTC and clock */
+# define M_T_PREFERRED 0x08 /* preferred mode within a set */
# define M_T_DEFAULT 0x10 /* (VESA) default modes */
# define M_T_USERDEF 0x20 /* One of the modes from the config file */
-# define M_T_EDID 0x40 /* Mode from the EDID info from the monitor */
+# define M_T_DRIVER 0x40 /* Supplied by the driver (EDID, etc) */
/* Video mode */
typedef struct _DisplayModeRec {
More information about the xorg-commit
mailing list