xorg-server:

- update to xorg-server-1.8.0.902
- add some patches from meego
This commit is contained in:
Stephan Raue 2010-05-07 03:51:49 +02:00
parent b1c20356c7
commit ccc781a3d7
15 changed files with 419 additions and 488 deletions

View File

@ -27,8 +27,8 @@ $SCRIPTS/build Mesa
$SCRIPTS/build openssl
$SCRIPTS/build freetype
$SCRIPTS/build pixman
$SCRIPTS/build dbus
$SCRIPTS/build hal
$SCRIPTS/build fontsproto
$SCRIPTS/build udev
if [ "$XINERAMA_SUPPORT" = "yes" ]; then
$SCRIPTS/build libXinerama
@ -58,7 +58,6 @@ autoconf
--enable-registry \
--disable-composite \
$XORG_XINERAMA \
--enable-null-root-cursor \
--enable-mitshm \
--disable-xres \
--disable-record \
@ -80,8 +79,9 @@ autoconf
--enable-dbe \
--disable-xf86bigfont \
--enable-dpms \
--enable-config-dbus \
--enable-config-hal \
--enable-config-udev \
--disable-config-dbus \
--disable-config-hal \
--enable-xfree86-utils \
--enable-xorg \
--disable-dmx \
@ -92,7 +92,6 @@ autoconf
--disable-xwin \
--disable-kdrive \
--disable-xephyr \
--disable-xsdl \
--disable-xfake \
--enable-xfbdev \
--disable-install-setuid \
@ -100,14 +99,15 @@ autoconf
--with-int10=x86emu \
--disable-ipv6 \
--with-gnu-ld \
--with-sha1=libcrypto \
--with-os-vendor="OpenELEC" \
--with-module-dir=$XORG_PATH_MODULES \
--with-xkb-path=$XORG_PATH_XKB \
--with-xkb-output=/var/cache/xkb \
--with-log-dir=/var/log \
--with-dri-driver-path=$XORG_PATH_DRI \
--with-fontdir=$XORG_PATH_FONTS \
--with-default-font-path="$XORG_PATH_FONTS/liberation,$XORG_PATH_FONTS/misc,built-ins" \
--with-fontrootdir=$XORG_PATH_FONTS \
--with-default-font-path="$XORG_PATH_FONTS/misc,built-ins"
make

View File

@ -0,0 +1,10 @@
# Collection of quirks and blacklist/whitelists for specific devices.
# Accelerometer device, posts data through ABS_X/ABS_Y, making X unusable
# http://bugs.freedesktop.org/show_bug.cgi?id=22442
Section "InputClass"
Identifier "ThinkPad HDAPS accelerometer blacklist"
MatchProduct "ThinkPad HDAPS accelerometer data"
Option "Ignore" "on"
EndSection

View File

@ -12,8 +12,7 @@ $SCRIPTS/install libXfont
$SCRIPTS/install libdrm
$SCRIPTS/install Mesa
$SCRIPTS/install pixman
$SCRIPTS/install dbus
$SCRIPTS/install hal
$SCRIPTS/install udev
[ "$XINERAMA_SUPPORT" = "yes" ] && $SCRIPTS/install libXinerama
@ -53,11 +52,11 @@ mkdir -p $XORG_DST/multimedia
mkdir -p $INSTALL/usr/lib/xorg
cp -P $PKG_BUILD/dix/protocol.txt $INSTALL/usr/lib/xorg
mkdir -p $INSTALL/etc/dbus-1/system.d
cp -P $PKG_BUILD/config/xorg-server.conf $INSTALL/etc/dbus-1/system.d
#mkdir -p $INSTALL/etc/X11/xorg.conf.d
# cp -P $PKG_DIR/config/*.conf $INSTALL/etc/X11/xorg.conf.d
mkdir -p $INSTALL/usr/share/hal/fdi/policy/10osvendor/
cp -P $PKG_BUILD/config/x11-input.fdi $INSTALL/usr/share/hal/fdi/policy/10osvendor/10-x11-input.fdi
mkdir -p $INSTALL/usr/share/X11/xorg.conf.d
cp -P $PKG_BUILD/config/10-evdev.conf $INSTALL/usr/share/X11/xorg.conf.d
#Fonts
$SCRIPTS/install encodings
@ -73,7 +72,7 @@ mkdir -p $INSTALL/usr/share/hal/fdi/policy/10osvendor/
#Drivers
$SCRIPTS/install xf86-input-evdev
$SCRIPTS/install xf86-input-synaptics
# $SCRIPTS/install xf86-input-wacom
$SCRIPTS/install xf86-input-wacom
for drv in $XORG_DRIVERS; do
$SCRIPTS/install xf86-video-$drv

View File

@ -1,233 +0,0 @@
From 3ef4be8129f78afd5566a9e5d0fb901449dcb771 Mon Sep 17 00:00:00 2001
From: Ian Romanick <ian.d.romanick@intel.com>
Date: Tue, 29 Sep 2009 16:43:43 -0700
Subject: [PATCH] GLX: Enable GLX 1.4 on DRI2
this squashes 4 commits
(cherry picked from commit ad5c0d9efa47476ed5cf75c82265c73919e468b4)
(cherry picked from commit cb54cf1b3e8c4109541cfb698542c00f2473e731)
(cherry picked from commit 4c6bfa2c09ae2b0cffdf9211a6dfbcaefe0366b5)
(cherry picked from commit 9bf2ff4faf730913de3073f346646a8727be41d4)
---
glx/glxcmds.c | 12 ++++++++----
glx/glxdri2.c | 12 ++++++++++++
glx/glxext.c | 8 +++++++-
glx/glxscreens.c | 15 ++++++++++++---
glx/glxscreens.h | 11 +++++++++++
glx/glxserver.h | 3 +++
glx/indirect_texture_compression.c | 4 ++--
include/protocol-versions.h | 2 +-
8 files changed, 56 insertions(+), 11 deletions(-)
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index b1061a8..ba4c123 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -50,7 +50,6 @@
#include "indirect_dispatch.h"
#include "indirect_table.h"
#include "indirect_util.h"
-#include "protocol-versions.h"
static int
validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err)
@@ -739,8 +738,8 @@ int __glXDisp_QueryVersion(__GLXclientState *cl, GLbyte *pc)
** client if it wants to work with older clients; however, in this
** implementation the server just returns its version number.
*/
- reply.majorVersion = SERVER_GLX_MAJOR_VERSION;
- reply.minorVersion = SERVER_GLX_MINOR_VERSION;
+ reply.majorVersion = glxMajorVersion;
+ reply.minorVersion = glxMinorVersion;
reply.length = 0;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
@@ -2360,6 +2359,7 @@ int __glXDisp_QueryServerString(__GLXclientState *cl, GLbyte *pc)
char *buf;
__GLXscreen *pGlxScreen;
int err;
+ char ver_str[16];
if (!validGlxScreen(client, req->screen, &pGlxScreen, &err))
return err;
@@ -2369,7 +2369,11 @@ int __glXDisp_QueryServerString(__GLXclientState *cl, GLbyte *pc)
ptr = pGlxScreen->GLXvendor;
break;
case GLX_VERSION:
- ptr = pGlxScreen->GLXversion;
+ /* Return to the server version rather than the screen version
+ * to prevent confusion when they do not match.
+ */
+ snprintf(ver_str, 16, "%d.%d", glxMajorVersion, glxMinorVersion);
+ ptr = ver_str;
break;
case GLX_EXTENSIONS:
ptr = pGlxScreen->GLXextensions;
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index ed7fb4c..ed7dc80 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -685,6 +685,18 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
screen->base.GLXextensions);
}
+ /* We're going to assume (perhaps incorrectly?) that all DRI2-enabled
+ * drivers support the required extensions for GLX 1.4. The extensions
+ * we're assuming are:
+ *
+ * - GLX_SGI_make_current_read (1.3)
+ * - GLX_SGIX_fbconfig (1.3)
+ * - GLX_SGIX_pbuffer (1.3)
+ * - GLX_ARB_multisample (1.4)
+ */
+ screen->base.GLXmajor = 1;
+ screen->base.GLXminor = 4;
+
screen->enterVT = pScrn->EnterVT;
pScrn->EnterVT = glxDRIEnterVT;
screen->leaveVT = pScrn->LeaveVT;
diff --git a/glx/glxext.c b/glx/glxext.c
index 19d70d4..9f9c0ed 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -360,12 +360,18 @@ void GlxExtensionInit(void)
pScreen = screenInfo.screens[i];
for (p = __glXProviderStack; p != NULL; p = p->next) {
- if (p->screenProbe(pScreen) != NULL) {
+ __GLXscreen *glxScreen;
+
+ glxScreen = p->screenProbe(pScreen);
+ if (glxScreen != NULL) {
+ if (glxScreen->GLXminor < glxMinorVersion)
+ glxMinorVersion = glxScreen->GLXminor;
LogMessage(X_INFO,
"GLX: Initialized %s GL provider for screen %d\n",
p->name, i);
break;
}
+
}
if (!p)
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 7d29d31..674e2c6 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -42,6 +42,7 @@
#include "glxserver.h"
#include "glxutil.h"
#include "glxext.h"
+#include "protocol-versions.h"
static int glxScreenPrivateKeyIndex;
static DevPrivateKey glxScreenPrivateKey = &glxScreenPrivateKeyIndex;
@@ -162,7 +163,8 @@ static const char GLServerExtensions[] =
** supported across all screens in a multi-screen system.
*/
static char GLXServerVendorName[] = "SGI";
-static char GLXServerVersion[] = "1.2";
+unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION;
+unsigned glxMinorVersion = SERVER_GLX_MINOR_VERSION;
static char GLXServerExtensions[] =
"GLX_ARB_multisample "
"GLX_EXT_visual_info "
@@ -378,9 +380,17 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
pGlxScreen->pScreen = pScreen;
pGlxScreen->GLextensions = xstrdup(GLServerExtensions);
pGlxScreen->GLXvendor = xstrdup(GLXServerVendorName);
- pGlxScreen->GLXversion = xstrdup(GLXServerVersion);
pGlxScreen->GLXextensions = xstrdup(GLXServerExtensions);
+ /* All GLX providers must support all of the functionality required for at
+ * least GLX 1.2. If the provider supports a higher version, the GLXminor
+ * version can be changed in the provider's screen-probe routine. For
+ * most providers, the screen-probe routine is the caller of this
+ * function.
+ */
+ pGlxScreen->GLXmajor = 1;
+ pGlxScreen->GLXminor = 2;
+
pGlxScreen->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = glxCloseScreen;
pGlxScreen->DestroyWindow = pScreen->DestroyWindow;
@@ -454,7 +464,6 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
void __glXScreenDestroy(__GLXscreen *screen)
{
xfree(screen->GLXvendor);
- xfree(screen->GLXversion);
xfree(screen->GLXextensions);
xfree(screen->GLextensions);
}
diff --git a/glx/glxscreens.h b/glx/glxscreens.h
index 3c1bdd4..bff4363 100644
--- a/glx/glxscreens.h
+++ b/glx/glxscreens.h
@@ -161,6 +161,17 @@ struct __GLXscreen {
char *GLXversion;
char *GLXextensions;
+ /**
+ * \name GLX version supported by this screen.
+ *
+ * Since the GLX version advertised by the server is for the whole server,
+ * the GLX protocol code uses the minimum version supported on all screens.
+ */
+ /*@{*/
+ unsigned GLXmajor;
+ unsigned GLXminor;
+ /*@}*/
+
Bool (*CloseScreen)(int index, ScreenPtr pScreen);
Bool (*DestroyWindow)(WindowPtr pWindow);
};
diff --git a/glx/glxserver.h b/glx/glxserver.h
index 4aa8c2e..80f1b28 100644
--- a/glx/glxserver.h
+++ b/glx/glxserver.h
@@ -248,4 +248,7 @@ extern int __glXImageSize(GLenum format, GLenum type,
GLint imageHeight, GLint rowLength, GLint skipImages, GLint skipRows,
GLint alignment);
+extern unsigned glxMajorVersion;
+extern unsigned glxMinorVersion;
+
#endif /* !__GLX_server_h__ */
diff --git a/glx/indirect_texture_compression.c b/glx/indirect_texture_compression.c
index 25c6eb3..5f44d7b 100644
--- a/glx/indirect_texture_compression.c
+++ b/glx/indirect_texture_compression.c
@@ -52,7 +52,7 @@ int __glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte *p
const GLenum target = *(GLenum *)(pc + 0);
const GLint level = *(GLint *)(pc + 4);
GLint compsize = 0;
- char *answer, answerBuffer[200];
+ char *answer = NULL, answerBuffer[200];
CALL_GetTexLevelParameteriv(GET_DISPATCH(), (target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize));
@@ -92,7 +92,7 @@ int __glXDispSwap_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyt
const GLenum target = (GLenum) bswap_32( *(int *)(pc + 0) );
const GLint level = (GLint ) bswap_32( *(int *)(pc + 4) );
GLint compsize = 0;
- char *answer, answerBuffer[200];
+ char *answer = NULL, answerBuffer[200];
CALL_GetTexLevelParameteriv(GET_DISPATCH(), (target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize));
diff --git a/include/protocol-versions.h b/include/protocol-versions.h
index da9770c..d688c66 100644
--- a/include/protocol-versions.h
+++ b/include/protocol-versions.h
@@ -61,7 +61,7 @@
/* GLX */
#define SERVER_GLX_MAJOR_VERSION 1
-#define SERVER_GLX_MINOR_VERSION 2
+#define SERVER_GLX_MINOR_VERSION 4
/* Xinerama */
#define SERVER_PANORAMIX_MAJOR_VERSION 1
--
1.6.5.rc2

View File

@ -1,26 +0,0 @@
From 25a0107768c9f25e8edc5e423ca8b1d0813f2d04 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 24 Nov 2009 13:38:46 -0500
Subject: [PATCH] Enable GLX 1.4 for swrast
---
glx/glxdriswrast.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index 44f658f..20f9f90 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -510,6 +510,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
__glXScreenInit(&screen->base, pScreen);
+ screen->base.GLXmajor = 1;
+ screen->base.GLXminor = 4;
+
LogMessage(X_INFO,
"AIGLX: Loaded and initialized %s\n", filename);
--
1.6.5.2

View File

@ -1,25 +0,0 @@
Bug#564203
From 8ca4233017e9f441303088e7054b6a7c4f171d80 Mon Sep 17 00:00:00 2001
From: Michael Vogt <mvo@ubuntu.com>
Date: Wed, 6 Jan 2010 14:40:34 +0100
Subject: [PATCH] * hw/xfree86/modes/xf86Crtc.c:
- only call gamma_set if its non NULL
---
hw/xfree86/modes/xf86Crtc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index d015c6a..573fe96 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -354,7 +354,7 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati
}
/* Only upload when needed, to avoid unneeded delays. */
- if (!crtc->active)
+ if (!crtc->active && crtc->funcs->gamma_set)
crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green,
crtc->gamma_blue, crtc->gamma_size);

View File

@ -1,22 +0,0 @@
[PATCH] Do not trap access to timer and keyboard
Some VESA BIOSes need to access to them.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
hw/xfree86/os-support/hurd/hurd_video.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c
index 4a99db3..e049ceb 100644
--- a/hw/xfree86/os-support/hurd/hurd_video.c
+++ b/hw/xfree86/os-support/hurd/hurd_video.c
@@ -124,8 +124,6 @@ xf86EnableIO()
FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno));
return FALSE;
}
- ioperm(0x40,4,0); /* trap access to the timer chip */
- ioperm(0x60,4,0); /* trap access to the keyboard controller */
return TRUE;
}

View File

@ -1,34 +0,0 @@
From 4ae407a5a308febf63de27a62f8c301c73b37d3e Mon Sep 17 00:00:00 2001
From: Julien Cristau <jcristau@debian.org>
Date: Tue, 6 Oct 2009 17:44:33 +0200
Subject: [PATCH 1/5] Move config_init() after CreateWellKnownSockets() and InitCoreDevices()
config_init() can now add devices directly instead of scheduling a
timer.
Signed-off-by: Julien Cristau <jcristau@debian.org>
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
---
dix/main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Index: xorg-server/dix/main.c
===================================================================
--- xorg-server.orig/dix/main.c
+++ xorg-server/dix/main.c
@@ -168,7 +168,6 @@
InitBlockAndWakeupHandlers();
/* Perform any operating system dependent initializations you'd like */
OsInit();
- config_init();
if(serverGeneration == 1)
{
CreateWellKnownSockets();
@@ -256,6 +255,7 @@
InitCoreDevices();
InitInput(argc, argv);
InitAndStartDevices();
+ config_init();
dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);

View File

@ -1,53 +0,0 @@
From fe7575e929d65e8c798104ec2f72b879051694d3 Mon Sep 17 00:00:00 2001
From: Julien Cristau <jcristau@debian.org>
Date: Mon, 8 Feb 2010 02:04:33 +0100
Subject: [PATCH] xfree86: fix build with xv disabled
---
hw/xfree86/modes/xf86Crtc.c | 2 ++
hw/xfree86/modes/xf86Crtc.h | 2 ++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 30b49af..62f8737 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -3009,6 +3009,7 @@ xf86_crtc_box_area(BoxPtr box)
return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1);
}
+#ifdef XV
/*
* Return the crtc covering 'box'. If two crtcs cover a portion of
* 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc
@@ -3097,6 +3098,7 @@ xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn,
return ret;
}
+#endif
xf86_crtc_notify_proc_ptr
xf86_wrap_crtc_notify (ScreenPtr screen, xf86_crtc_notify_proc_ptr new)
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 9baa956..2fb32c1 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -908,6 +908,7 @@ xf86_hide_cursors (ScrnInfoPtr scrn);
extern _X_EXPORT void
xf86_cursors_fini (ScreenPtr screen);
+#ifdef XV
/*
* For overlay video, compute the relevant CRTC and
* clip video to that.
@@ -926,6 +927,7 @@ xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn,
RegionPtr reg,
INT32 width,
INT32 height);
+#endif
extern _X_EXPORT xf86_crtc_notify_proc_ptr
xf86_wrap_crtc_notify (ScreenPtr pScreen, xf86_crtc_notify_proc_ptr new);
--
1.6.6.1

View File

@ -0,0 +1,358 @@
From d2d3bcc9e23b9a4bea9f67a06cd23aa3ce7f4b59 Mon Sep 17 00:00:00 2001
Message-Id: <d2d3bcc9e23b9a4bea9f67a06cd23aa3ce7f4b59.1268201183.git.yan.i.li@intel.com>
From: Yan Li <yan.i.li@intel.com>
Date: Wed, 10 Mar 2010 14:06:17 +0800
Subject: [PATCH] XKB: cache xkbcomp output for fast start-up v6 for 1.7.99.901
xkbcomp outputs will be cached in files with hashed keymap as
names. This saves boot time for around 1s on commodity netbooks.
v6: rebased to v1.7.99.901
v5: now using a much bigger xkbKeyMapBuf (100k) since the XKB to be
complied may be very large (as seen with
gnome-keyboard-properties), rebased to v1.6.1
Signed-off-by: Yan Li <yan.i.li@intel.com>
---
configure.ac | 6 +-
xkb/README.compiled | 8 +-
xkb/ddxLoad.c | 187 +++++++++++++++++++++++++++++++++++++++++----------
3 files changed, 159 insertions(+), 42 deletions(-)
diff --git a/configure.ac b/configure.ac
index de252f3..54a0327 100644
--- a/configure.ac
+++ b/configure.ac
@@ -527,9 +527,9 @@ AC_MSG_RESULT([$FONTPATH])
AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: ${datadir}/X11/xkb)]),
[ XKBPATH="$withval" ],
[ XKBPATH="${datadir}/X11/xkb" ])
-AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]),
+AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${localstatedir}/cache/xkb)]),
[ XKBOUTPUT="$withval" ],
- [ XKBOUTPUT="compiled" ])
+ [ XKBOUTPUT="${localstatedir}/cache/xkb" ])
AC_ARG_WITH(default-xkb-rules, AS_HELP_STRING([--with-default-xkb-rules=RULES],
[Keyboard ruleset (default: base/evdev)]),
[ XKB_DFLT_RULES="$withval" ],
@@ -1148,7 +1148,7 @@ AC_DEFINE_DIR(XKB_BIN_DIRECTORY, XKB_BIN_DIRECTORY, [Path to XKB bin dir])
dnl Make sure XKM_OUTPUT_DIR is an absolute path
XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1`
if [[ x$XKBOUTPUT_FIRSTCHAR != x/ -a x$XKBOUTPUT_FIRSTCHAR != 'x$' ]] ; then
- XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT"
+ AC_MSG_ERROR([xkb-output must be an absolute path.])
fi
dnl XKM_OUTPUT_DIR (used in code) must end in / or file names get hosed
diff --git a/xkb/README.compiled b/xkb/README.compiled
index 71caa2f..a4a2ae0 100644
--- a/xkb/README.compiled
+++ b/xkb/README.compiled
@@ -4,10 +4,10 @@ current keymap and/or any scratch keymaps used by clients. The X server
or some other tool might destroy or replace the files in this directory,
so it is not a safe place to store compiled keymaps for long periods of
time. The default keymap for any server is usually stored in:
- X<num>-default.xkm
-where <num> is the display number of the server in question, which makes
-it possible for several servers *on the same host* to share the same
-directory.
+ server-<SHA1>.xkm
+
+where <SHA1> is the SHA1 hash of keymap source, so that compiled
+keymap of different keymap sources are stored in different files.
Unless the X server is modified, sharing this directory between servers on
different hosts could cause problems.
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
index 4ccddda..63b9f97 100644
--- a/xkb/ddxLoad.c
+++ b/xkb/ddxLoad.c
@@ -30,6 +30,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <xkb-config.h>
+#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */
+# include <sha1.h>
+#else /* Use OpenSSL's libcrypto */
+# include <stddef.h> /* buggy openssl/sha.h wants size_t */
+# include <openssl/sha.h>
+#endif
#include <stdio.h>
#include <ctype.h>
#include <X11/X.h>
@@ -43,24 +49,13 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define XKBSRV_NEED_FILE_FUNCS
#include <xkbsrv.h>
#include <X11/extensions/XI.h>
+#include <errno.h>
#include "xkb.h"
#if defined(CSRG_BASED) || defined(linux) || defined(__GNU__)
#include <paths.h>
#endif
- /*
- * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is
- * relative to the top-level XKB configuration directory.
- * Making the server write to a subdirectory of that directory
- * requires some work in the general case (install procedure
- * has to create links to /var or somesuch on many machines),
- * so we just compile into /usr/tmp for now.
- */
-#ifndef XKM_OUTPUT_DIR
-#define XKM_OUTPUT_DIR "compiled/"
-#endif
-
#define PRE_ERROR_MSG "\"The XKEYBOARD keymap compiler (xkbcomp) reports:\""
#define ERROR_PREFIX "\"> \""
#define POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\""
@@ -175,6 +170,45 @@ OutputDirectory(
}
static Bool
+Sha1Asc(char sha1Asc[SHA_DIGEST_LENGTH*2+1], const char * input)
+{
+ int i;
+ unsigned char sha1[SHA_DIGEST_LENGTH];
+
+#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */
+ SHA1_CTX ctx;
+
+ SHA1Init (&ctx);
+ SHA1Update (&ctx, input, strlen(input));
+ SHA1Final (sha1, &ctx);
+#else /* Use OpenSSL's libcrypto */
+ SHA_CTX ctx;
+ int success;
+
+ success = SHA1_Init (&ctx);
+ if (! success)
+ return BadAlloc;
+
+ success = SHA1_Update (&ctx, input, strlen(input));
+ if (! success)
+ return BadAlloc;
+
+ success = SHA1_Final (sha1, &ctx);
+ if (! success)
+ return BadAlloc;
+#endif
+
+ /* convert sha1 to sha1_asc */
+ for(i=0; i<SHA_DIGEST_LENGTH; ++i) {
+ sprintf(sha1Asc+i*2, "%02X", sha1[i]);
+ }
+
+ return Success;
+}
+
+/* call xkbcomp and compile XKB keymap, return xkm file name in
+ nameRtrn */
+static Bool
XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
XkbComponentNamesPtr names,
unsigned want,
@@ -183,7 +217,11 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
int nameRtrnLen)
{
FILE * out;
- char *buf = NULL, keymap[PATH_MAX], xkm_output_dir[PATH_MAX];
+ char * buf = NULL, xkmfile[PATH_MAX], xkm_output_dir[PATH_MAX];
+ char * tmpXkmFile = NULL;
+ char * canonicalXkmFileName = NULL;
+ char sha1Asc[SHA_DIGEST_LENGTH*2+1], xkbKeyMapBuf[100*1024];
+ int ret, result;
const char *emptystring = "";
const char *xkbbasedirflag = emptystring;
@@ -194,15 +232,67 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
/* WIN32 has no popen. The input must be stored in a file which is
used as input for xkbcomp. xkbcomp does not read from stdin. */
char tmpname[PATH_MAX];
- const char *xkmfile = tmpname;
+ const char *xkbfile = tmpname;
#else
- const char *xkmfile = "-";
+ const char *xkbfile = "-";
+#endif
+
+ /* Write keymap source (xkbfile) to memory buffer `xkbKeyMapBuf',
+ of which SHA1 is generated and used as result xkm file name */
+ memset(xkbKeyMapBuf, 0, sizeof(xkbKeyMapBuf));
+ out = fmemopen(xkbKeyMapBuf, sizeof(xkbKeyMapBuf), "w");
+ if (NULL == out) {
+ ErrorF("[xkb] Open xkbKeyMapBuf for writing failed\n");
+ return FALSE;
+ }
+ ret = XkbWriteXKBKeymapForNames(out, names, xkb, want, need);
+ if (fclose(out) !=0) {
+ ErrorF("[xkb] XkbWriteXKBKeymapForNames error, perhaps xkbKeyMapBuf is too small\n");
+ return FALSE;
+ }
+#ifdef DEBUG
+ if (xkbDebugFlags) {
+ ErrorF("[xkb] XkbDDXCompileKeymapByNames compiling keymap:\n");
+ fputs(xkbKeyMapBuf, stderr);
+ }
#endif
+ if (!ret) {
+ ErrorF("[xkb] Generating XKB Keymap failed, giving up compiling keymap\n");
+ return FALSE;
+ }
- snprintf(keymap, sizeof(keymap), "server-%s", display);
+ DebugF("[xkb] computing SHA1 of keymap\n");
+ if (Success == Sha1Asc(sha1Asc, xkbKeyMapBuf)) {
+ snprintf(xkmfile, sizeof(xkmfile), "server-%s", sha1Asc);
+ } else {
+ ErrorF("[xkb] Computing SHA1 of keymap failed, "
+ "using display name instead as xkm file name\n");
+ snprintf(xkmfile, sizeof(xkmfile), "server-%s", display);
+ }
OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir));
+ /* set nameRtrn, fail if it's too small */
+ if ((strlen(xkmfile)+1 > nameRtrnLen) && nameRtrn) {
+ ErrorF("[xkb] nameRtrn too small to hold xkmfile name\n");
+ return FALSE;
+ }
+ strncpy(nameRtrn, xkmfile, nameRtrnLen);
+
+ /* if the xkm file already exists, reuse it */
+ canonicalXkmFileName = Xprintf("%s%s.xkm", xkm_output_dir, xkmfile);
+ if (access(canonicalXkmFileName, R_OK) == 0) {
+ /* yes, we can reuse the old xkm file */
+ LogMessage(X_INFO, "XKB: reuse xkmfile %s\n", canonicalXkmFileName);
+ result = TRUE;
+ goto _ret;
+ }
+ LogMessage(X_INFO, "XKB: generating xkmfile %s\n", canonicalXkmFileName);
+
+ /* continue to call xkbcomp to compile the keymap. to avoid race
+ condition, we compile it to a tmpfile then rename it to
+ xkmfile */
+
#ifdef WIN32
strcpy(tmpname, Win32TempDir());
strcat(tmpname, "\\xkb_XXXXXX");
@@ -225,19 +315,30 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
}
}
+ if ( (tmpXkmFile = tempnam(xkm_output_dir, NULL)) == NULL ) {
+ ErrorF("[xkb] Can't generate temp xkm file name");
+ result = FALSE;
+ goto _ret;
+ }
+
buf = Xprintf("\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" "
- "-em1 %s -emp %s -eml %s \"%s%s.xkm\"",
+ "-em1 %s -emp %s -eml %s \"%s\"",
xkbbindir, xkbbindirsep,
( (xkbDebugFlags < 2) ? 1 :
((xkbDebugFlags > 10) ? 10 : (int)xkbDebugFlags) ),
- xkbbasedirflag, xkmfile,
+ xkbbasedirflag, xkbfile,
PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1,
- xkm_output_dir, keymap);
+ tmpXkmFile);
if (xkbbasedirflag != emptystring) {
xfree(xkbbasedirflag);
}
+ /* there's a potential race condition between calling tempnam()
+ and invoking xkbcomp to write the result file (potential temp
+ file name conflicts), but since xkbcomp is a standalone
+ program, we have to live with this */
+
#ifndef WIN32
out= Popen(buf,"w");
#else
@@ -245,31 +346,41 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
#endif
if (out!=NULL) {
-#ifdef DEBUG
- if (xkbDebugFlags) {
- ErrorF("[xkb] XkbDDXCompileKeymapByNames compiling keymap:\n");
- XkbWriteXKBKeymapForNames(stderr,names,xkb,want,need);
- }
-#endif
- XkbWriteXKBKeymapForNames(out,names,xkb,want,need);
+ /* write XKBKeyMapBuf to xkbcomp */
+ if (EOF==fputs(xkbKeyMapBuf, out))
+ {
+ ErrorF("[xkb] Sending keymap to xkbcomp failed\n");
+ result = FALSE;
+ goto _ret;
+ }
#ifndef WIN32
if (Pclose(out)==0)
#else
if (fclose(out)==0 && System(buf) >= 0)
#endif
{
+ /* xkbcomp success */
if (xkbDebugFlags)
DebugF("[xkb] xkb executes: %s\n",buf);
- if (nameRtrn) {
- strncpy(nameRtrn,keymap,nameRtrnLen);
- nameRtrn[nameRtrnLen-1]= '\0';
+ /* if canonicalXkmFileName already exists now, we simply
+ overwrite it, this is OK */
+ ret = rename(tmpXkmFile, canonicalXkmFileName);
+ if (0 != ret) {
+ ErrorF("[xkb] Can't rename %s to %s, error: %s\n",
+ tmpXkmFile, canonicalXkmFileName,
+ strerror(errno));
+
+ /* in case of error, don't unlink tmpXkmFile, leave it
+ for debugging */
+
+ result = FALSE;
+ goto _ret;
}
- if (buf != NULL)
- xfree (buf);
- return TRUE;
+ result = TRUE;
+ goto _ret;
}
else
- LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap);
+ LogMessage(X_ERROR, "Error compiling keymap (%s)\n", xkbfile);
#ifdef WIN32
/* remove the temporary file */
unlink(tmpname);
@@ -284,9 +395,16 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
}
if (nameRtrn)
nameRtrn[0]= '\0';
+ result = FALSE;
+
+_ret:
+ if (tmpXkmFile)
+ free(tmpXkmFile);
+ if (canonicalXkmFileName)
+ xfree(canonicalXkmFileName);
if (buf != NULL)
xfree (buf);
- return FALSE;
+ return result;
}
static FILE *
@@ -370,7 +488,6 @@ unsigned missing;
DebugF("Loaded XKB keymap %s, defined=0x%x\n",fileName,(*xkbRtrn)->defined);
}
fclose(file);
- (void) unlink (fileName);
return (need|want)&(~missing);
}
--
1.5.6.5

View File

@ -0,0 +1,12 @@
--- xorg-server-1.6.1.901/hw/xfree86/common/xf86AutoConfig.c~ 2009-07-03 11:59:30.000000000 -0700
+++ xorg-server-1.6.1.901/hw/xfree86/common/xf86AutoConfig.c 2009-07-03 11:59:30.000000000 -0700
@@ -516,7 +516,8 @@
/* Fallback to platform default hardware */
if (i < (nmatches - 1)) {
#if defined(__i386__) || defined(__amd64__) || defined(__hurd__)
- matches[i++] = xnfstrdup("vesa");
+ if (geteuid() == 0)
+ matches[i++] = xnfstrdup("vesa");
#elif defined(__sparc__) && !defined(sun)
matches[i++] = xnfstrdup("sunffb");
#endif

View File

@ -1,17 +1,3 @@
From b4e4b980663692a3af5787eeaf2d48eb6c0188ed Mon Sep 17 00:00:00 2001
From: Fedora X Ninjas <airlied@redhat.com>
Date: Tue, 4 Aug 2009 14:45:58 +1000
Subject: [PATCH] Add nr for background=none root
---
dix/globals.c | 1 +
dix/window.c | 12 +++++++-----
hw/xfree86/common/xf86Init.c | 11 +++++++++++
hw/xfree86/common/xf86str.h | 5 ++++-
include/opaque.h | 1 +
os/utils.c | 3 +++
6 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/dix/globals.c b/dix/globals.c
index c24a94f..907a5e8 100644
--- a/dix/globals.c
@ -25,10 +11,10 @@ index c24a94f..907a5e8 100644
int cursorScreenDevPriv[MAXSCREENS];
diff --git a/dix/window.c b/dix/window.c
index 32e26d9..0bf1d52 100644
index caff1cb..f343d25 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -466,22 +466,24 @@ InitRootWindow(WindowPtr pWin)
@@ -466,23 +466,24 @@ InitRootWindow(WindowPtr pWin)
pWin->optional->cursor = rootCursor;
rootCursor->refcnt++;
@ -38,7 +24,7 @@ index 32e26d9..0bf1d52 100644
if (party_like_its_1989) {
MakeRootTile(pWin);
backFlag |= CWBackPixmap;
+ pScreen->ChangeWindowAttributes(pWin, backFlag);
+ (*pScreen->ChangeWindowAttributes)(pWin, backFlag);
+ } else if (bgNoneRoot) {
+ /* nothing, handled in xf86CreateRootWindow */
} else {
@ -47,19 +33,19 @@ index 32e26d9..0bf1d52 100644
else
pWin->background.pixel = pScreen->blackPixel;
backFlag |= CWBackPixel;
- }
+ (*pScreen->ChangeWindowAttributes)(pWin, backFlag);
}
- pWin->backingStore = defaultBackingStore;
- pWin->forcedBS = (defaultBackingStore != NotUseful);
- /* We SHOULD check for an error value here XXX */
- (*pScreen->ChangeWindowAttributes)(pWin, backFlag);
+ pScreen->ChangeWindowAttributes(pWin, backFlag);
+ }
-
MapWindow(pWin, serverClient);
}
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index e84da4e..2a0f47a 100644
index c9baff3..81c62f2 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -77,6 +77,7 @@
@ -70,7 +56,7 @@ index e84da4e..2a0f47a 100644
#include "xf86VGAarbiter.h"
#include "globals.h"
@@ -234,6 +235,7 @@ xf86CreateRootWindow(WindowPtr pWin)
@@ -249,6 +250,7 @@ xf86CreateRootWindow(WindowPtr pWin)
int ret = TRUE;
int err = Success;
ScreenPtr pScreen = pWin->drawable.pScreen;
@ -78,11 +64,11 @@ index e84da4e..2a0f47a 100644
RootWinPropPtr pProp;
CreateWindowProcPtr CreateWindow = (CreateWindowProcPtr)
dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey);
@@ -285,6 +287,15 @@ xf86CreateRootWindow(WindowPtr pWin)
@@ -300,6 +302,15 @@ xf86CreateRootWindow(WindowPtr pWin)
}
}
+ if (bgNoneRoot && pScrn->canDoBGNoneRoot) {
+ if (bgNoneRoot && pScrn->canDoBGNoneRoot || 1) {
+ pWin->backgroundState = XaceBackgroundNoneState(pWin);
+ pWin->background.pixel = pScreen->whitePixel;
+ pScreen->ChangeWindowAttributes(pWin, CWBackPixmap | CWBorderPixel | CWCursor | CWBackingStore);
@ -95,7 +81,7 @@ index e84da4e..2a0f47a 100644
return (ret);
}
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index 5c3ee44..e3c7841 100644
index b9a2e06..fd28664 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -516,7 +516,7 @@ typedef struct _confdrirec {
@ -107,7 +93,7 @@ index 5c3ee44..e3c7841 100644
#define NUM_RESERVED_POINTERS 14
#define NUM_RESERVED_FUNCS 11
@@ -800,6 +800,9 @@ typedef struct _ScrnInfoRec {
@@ -788,6 +788,9 @@ typedef struct _ScrnInfoRec {
ClockRangesPtr clockRanges;
int adjustFlags;
@ -130,10 +116,10 @@ index b3c7c70..fcc8c95 100644
extern _X_EXPORT Bool CoreDump;
diff --git a/os/utils.c b/os/utils.c
index 00abd63..7bfdf8b 100644
index 3718b17..52e30d3 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -514,6 +514,7 @@ void UseMsg(void)
@@ -513,6 +513,7 @@ void UseMsg(void)
#endif
ErrorF("-nolisten string don't listen on protocol\n");
ErrorF("-noreset don't reset after last client exists\n");
@ -141,7 +127,7 @@ index 00abd63..7bfdf8b 100644
ErrorF("-reset reset after last client exists\n");
ErrorF("-p # screen-saver pattern duration (minutes)\n");
ErrorF("-pn accept failure to listen on all ports\n");
@@ -861,6 +862,8 @@ ProcessCommandLine(int argc, char *argv[])
@@ -856,6 +857,8 @@ ProcessCommandLine(int argc, char *argv[])
defaultBackingStore = WhenMapped;
else if ( strcmp( argv[i], "-wr") == 0)
whiteRoot = TRUE;
@ -150,6 +136,3 @@ index 00abd63..7bfdf8b 100644
else if ( strcmp( argv[i], "-maxbigreqsize") == 0) {
if(++i < argc) {
long reqSizeArg = atol(argv[i]);
--
1.6.0.6

View File

@ -1,38 +0,0 @@
diff --git a/os/log.c b/os/log.c
index 0860847..2c46f1a 100644
--- a/os/log.c
+++ b/os/log.c
@@ -255,6 +255,33 @@ LogVWrite(int verb, const char *f, va_list args)
static char tmpBuffer[1024];
int len = 0;
+ struct timeval time;
+ time_t tv_sec;
+ suseconds_t tv_usec;
+ static Bool first = TRUE;
+ static time_t start_tv_sec;
+ static suseconds_t start_usec;
+ int diff_sec, diff_usec;
+
+ gettimeofday(&time, NULL);
+ tv_sec = time.tv_sec;
+ tv_usec = time.tv_usec;
+ if (first == TRUE) {
+ start_tv_sec = tv_sec;
+ start_usec = tv_usec;
+ first = FALSE;
+ }
+ diff_sec = (int)difftime(tv_sec, start_tv_sec);
+ diff_usec = (tv_usec - start_usec);
+ if (diff_usec < 0) {
+ diff_sec--;
+ diff_usec += 1000000;
+ }
+ sprintf(tmpBuffer, "[%d sec: %06d usec]", diff_sec , diff_usec);
+ len = strlen(tmpBuffer);
+ if (logFile)
+ fwrite(tmpBuffer, len, 1, logFile);
+
/*
* Since a va_list can only be processed once, write the string to a
* buffer, and then write the buffer out to the appropriate output

View File

@ -1 +1 @@
http://xorg.freedesktop.org/archive/individual/xserver/xorg-server-1.7.6.902.tar.bz2
http://xorg.freedesktop.org/archive/individual/xserver/xorg-server-1.8.0.902.tar.bz2