[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'ubuntu'



 debian/changelog                                                |   17 
 debian/patches/189_xserver_1.5.0_bg_none_root.patch             |  156 +++
 debian/patches/190_cache-xkbcomp_output_for_fast_start_up.patch |  430 ++++++++++
 debian/patches/series                                           |    2 
 4 files changed, 605 insertions(+)

New commits:
commit c40da945923f60f297cc7c1b6c9537edf9125c7b
Author: Bryce Harrington <bryce@bryceharrington.org>
Date:   Mon Nov 23 14:08:37 2009 -0800

    Add two moblin patches to improve boot

diff --git a/debian/changelog b/debian/changelog
index db86085..7f77953 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,20 @@
+xorg-server (2:1.6.4-2ubuntu5) karmic; urgency=low
+
+  * 189_xserver_1.5.0_bg_none_root.patch: Moblin patch to allow X to
+    create a root window with no background by passing the -nr
+    argument.  This will make X no longer clear the framebuffer when it
+    starts, thus eliminating a flicker between bootsplash and gdm.  -nr
+    is ignored if this feature is not supported by the driver.  This patch
+    is not upstream yet.
+    TESTERS:  Watch for screen corruption issues during X or app start.
+  * 190_cache-xkbcomp_output_for_fast_start_up.patch: Causes the X
+    Keyboard Compiler (xkbcomp) to create a cache file of the keyboard
+    settings.  This will make the 2nd and later boots slightly faster.
+    TESTERS:  Watch for issues relating to keyboard customizations not
+    taking effect properly following boot.
+
+ -- Bryce Harrington <bryce@ubuntu.com>  Mon, 23 Nov 2009 13:59:44 -0800
+
 xorg-server (2:1.6.4-2ubuntu4) karmic; urgency=low
 
   * Add 188_default_primary_to_first_busid.patch: X can abort if multiple
diff --git a/debian/patches/189_xserver_1.5.0_bg_none_root.patch b/debian/patches/189_xserver_1.5.0_bg_none_root.patch
new file mode 100644
index 0000000..ef53689
--- /dev/null
+++ b/debian/patches/189_xserver_1.5.0_bg_none_root.patch
@@ -0,0 +1,156 @@
+From a3e15680da24cb8259f6a83dee0c930dab024290 Mon Sep 17 00:00:00 2001
+From: Kristian <krh@redhat.com>
+Date: Fri, 15 Aug 2008 15:15:14 +1000
+Subject: [PATCH] Add nr for background=none root
+
+---
+ dix/globals.c                |    1 +
+ dix/window.c                 |   22 ++++++++++++----------
+ hw/xfree86/common/xf86Init.c |   11 +++++++++++
+ hw/xfree86/common/xf86str.h  |    5 ++++-
+ include/opaque.h             |    1 +
+ os/utils.c                   |    3 +++
+ 6 files changed, 32 insertions(+), 11 deletions(-)
+
+diff --git a/dix/globals.c b/dix/globals.c
+index 973dc43..dbd76bb 100644
+--- a/dix/globals.c
++++ b/dix/globals.c
+@@ -141,6 +141,7 @@ FontPtr defaultFont;   /* not declared in dix.h to avoid including font.h in
+ CursorPtr rootCursor;
+ Bool party_like_its_1989 = FALSE;
+ Bool whiteRoot = FALSE;
++Bool bgNoneRoot = FALSE;
+ 
+ int cursorScreenDevPriv[MAXSCREENS];
+ 
+diff --git a/dix/window.c b/dix/window.c
+index c31fa87..8bb178d 100644
+--- a/dix/window.c
++++ b/dix/window.c
+@@ -482,23 +482,24 @@ InitRootWindow(WindowPtr pWin)
+     pWin->cursorIsNone = FALSE;
+     pWin->optional->cursor = rootCursor;
+     rootCursor->refcnt++;
+-
++    pWin->backingStore = defaultBackingStore;
++    pWin->forcedBS = (defaultBackingStore != NotUseful);
+ 
+     if (party_like_its_1989) {
+         MakeRootTile(pWin);
+         backFlag |= CWBackPixmap;
++        pScreen->ChangeWindowAttributes(pWin, backFlag);
++    } else if (bgNoneRoot) {
++	/* nothing, handled in xf86CreateRootWindow */
+     } else {
+ 	if (whiteRoot)
+             pWin->background.pixel = pScreen->whitePixel;
+         else
+             pWin->background.pixel = pScreen->blackPixel;
+         backFlag |= CWBackPixel;
+-    } 
+ 
+-    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 236c00b..083a6ac 100644
+--- a/hw/xfree86/common/xf86Init.c
++++ b/hw/xfree86/common/xf86Init.c
+@@ -79,6 +79,7 @@
+ #ifdef RENDER
+ #include "picturestr.h"
+ #endif
++#include "xace.h"
+ 
+ #include "globals.h"
+ 
+@@ -328,6 +329,7 @@ xf86CreateRootWindow(WindowPtr pWin)
+   int ret = TRUE;
+   int err = Success;
+   ScreenPtr pScreen = pWin->drawable.pScreen;
++  ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+   RootWinPropPtr pProp;
+   CreateWindowProcPtr CreateWindow = (CreateWindowProcPtr)
+       dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey);
+@@ -381,6 +383,15 @@ xf86CreateRootWindow(WindowPtr pWin)
+     }
+   }
+ 
++  if (bgNoneRoot && pScrn->canDoBGNoneRoot || 1) {
++      pWin->backgroundState = XaceBackgroundNoneState(pWin);
++      pWin->background.pixel = pScreen->whitePixel;
++      pScreen->ChangeWindowAttributes(pWin, CWBackPixmap | CWBorderPixel | CWCursor | CWBackingStore);
++  } else {
++      pWin->background.pixel = pScreen->blackPixel;
++      pScreen->ChangeWindowAttributes(pWin, CWBackPixel | CWBorderPixel | CWCursor | CWBackingStore);
++  }
++
+ #ifdef DEBUG
+   ErrorF("xf86CreateRootWindow() returns %d\n", ret);
+ #endif
+diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
+index 904c369..8c38f69 100644
+--- a/hw/xfree86/common/xf86str.h
++++ b/hw/xfree86/common/xf86str.h
+@@ -531,7 +531,7 @@ typedef struct _confdrirec {
+ } confDRIRec, *confDRIPtr;
+ 
+ /* These values should be adjusted when new fields are added to ScrnInfoRec */
+-#define NUM_RESERVED_INTS		16
++#define NUM_RESERVED_INTS		15
+ #define NUM_RESERVED_POINTERS		15
+ #define NUM_RESERVED_FUNCS		11
+ 
+@@ -959,6 +959,9 @@ typedef struct _ScrnInfoRec {
+     ClockRangesPtr	clockRanges;
+     int			adjustFlags;
+ 
++    /* -nr support */
++    int			canDoBGNoneRoot;
++
+     /*
+      * These can be used when the minor ABI version is incremented.
+      * The NUM_* parameters must be reduced appropriately to keep the
+diff --git a/include/opaque.h b/include/opaque.h
+index 07a0715..be1577b 100644
+--- a/include/opaque.h
++++ b/include/opaque.h
+@@ -71,6 +71,7 @@ extern Bool defeatAccessControl;
+ extern long maxBigRequestSize;
+ extern Bool party_like_its_1989;
+ extern Bool whiteRoot;
++extern Bool bgNoneRoot;
+ 
+ extern Bool CoreDump;
+ 
+diff --git a/os/utils.c b/os/utils.c
+index b100949..c41b45b 100644
+--- a/os/utils.c
++++ b/os/utils.c
+@@ -515,6 +515,7 @@ void UseMsg(void)
+ #endif
+     ErrorF("-nolisten string       don't listen on protocol\n");
+     ErrorF("-noreset               don't reset after last client exists\n");
++    ErrorF("-nr                    create root window with no background\n");
+     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");
+@@ -859,6 +860,8 @@ ProcessCommandLine(int argc, char *argv[])
+ 	    defaultBackingStore = WhenMapped;
+         else if ( strcmp( argv[i], "-wr") == 0)
+             whiteRoot = TRUE;
++        else if ( strcmp( argv[i], "-nr") == 0)
++            bgNoneRoot = TRUE;
+         else if ( strcmp( argv[i], "-maxbigreqsize") == 0) {
+              if(++i < argc) {
+                  long reqSizeArg = atol(argv[i]);
+-- 
+1.5.3.4
+
diff --git a/debian/patches/190_cache-xkbcomp_output_for_fast_start_up.patch b/debian/patches/190_cache-xkbcomp_output_for_fast_start_up.patch
new file mode 100644
index 0000000..7624022
--- /dev/null
+++ b/debian/patches/190_cache-xkbcomp_output_for_fast_start_up.patch
@@ -0,0 +1,430 @@
+diff -Naur xorg-server-20090727/configure.ac xorg-server-20090727.patch/configure.ac
+--- xorg-server-20090727/configure.ac	2009-07-26 16:15:37.000000000 +0200
++++ xorg-server-20090727.patch/configure.ac	2009-08-08 20:28:07.100479376 +0200
+@@ -476,9 +476,9 @@
+ 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(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH],
+ 				   [Directory where ancillary server config files are installed (default: ${libdir}/xorg)]),
+ 				[ SERVERCONFIG="$withval" ],
+@@ -1757,7 +1757,7 @@
+ XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1`
+ 
+ if [[ x$XKBOUTPUT_FIRSTCHAR != x/ ]] ; then
+-   XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT"
++   AC_MSG_ERROR([xkb-output must be an absolute path.])
+ fi
+ 
+ # XKM_OUTPUT_DIR (used in code) must end in / or file names get hosed
+diff -Naur xorg-server-20090727/xkb/ddxLoad.c xorg-server-20090727.patch/xkb/ddxLoad.c
+--- xorg-server-20090727/xkb/ddxLoad.c	2009-07-26 16:15:37.000000000 +0200
++++ xorg-server-20090727.patch/xkb/ddxLoad.c	2009-08-08 20:48:46.504353541 +0200
+@@ -32,6 +32,13 @@
+ #include <xkb-config.h>
+ #endif
+ 
++#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>
+ #define	NEED_EVENTS 1
+@@ -46,24 +53,13 @@
+ #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\""
+@@ -178,6 +174,45 @@
+     }
+ }
+ 
++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,
+@@ -187,7 +222,11 @@
+ 				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;
+@@ -198,16 +237,70 @@
+     /* 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
+ 
+-    snprintf(keymap, sizeof(keymap), "server-%s", display);
++    /* 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;
++    }
++
++    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);
++    }
+ 
+-    XkbEnsureSafeMapName(keymap);
++    // XkbEnsureSafeMapName(keymap);
+     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");
+@@ -230,19 +323,30 @@
+ 	}
+     }
+ 
++    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
+@@ -250,31 +354,43 @@
+ #endif
+     
+     if (out!=NULL) {
+-#ifdef DEBUG
+-    if (xkbDebugFlags) {
+-       ErrorF("[xkb] XkbDDXCompileKeymapByNames compiling keymap:\n");
+-       XkbWriteXKBKeymapForNames(stderr,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;
+     }
+-#endif
+-	XkbWriteXKBKeymapForNames(out,names,xkb,want,need);
+ #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);
+@@ -289,9 +405,17 @@
+     }
+     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 *
+@@ -375,7 +499,6 @@
+ 	DebugF("Loaded XKB keymap %s, defined=0x%x\n",fileName,(*xkbRtrn)->defined);
+     }
+     fclose(file);
+-    (void) unlink (fileName);
+     return (need|want)&(~missing);
+ }
+ 
+diff -Naur xorg-server-20090727/xkb/README.compiled xorg-server-20090727.patch/xkb/README.compiled
+--- xorg-server-20090727/xkb/README.compiled	2009-07-26 16:15:37.000000000 +0200
++++ xorg-server-20090727.patch/xkb/README.compiled	2009-08-08 20:29:17.059354234 +0200
+@@ -4,10 +4,10 @@
+ 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.
+--- xorg-server-20090727/xkb/ddxLoad.c	2009-07-26 16:15:37.000000000 +0200
++++ xorg-server-20090727.patch/xkb/ddxLoad.c	2009-08-08 20:48:46.504353541 +0200
+@@ -32,11 +32,10 @@
+ #include <xkb-config.h>
+ #endif
+ 
+-#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */
+-# include <sha1.h>
++#ifdef HAVE_SHA1_IN_LIBGCRYPT /* Use libgcrypt for SHA1 */
++# include <gcrypt.h>
+ #else /* Use OpenSSL's libcrypto */
+-# include <stddef.h>  /* buggy openssl/sha.h wants size_t */
+-# include <openssl/sha.h>
++#warning "xkbcomp caching support disabled"
+ #endif
+ 
+ #include <stdio.h>
+@@ -174,40 +173,37 @@
+     }
+ }
+ 
++#ifndef SHA_DIGEST_LENGTH
++#define SHA_DIGEST_LENGTH 20
++#endif
++
+ 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;
++#ifdef HAVE_SHA1_IN_LIBGCRYPT /* Use libgcrypt for SHA1 */
++    static int init;
++    gcry_md_hd_t h;
++    gcry_error_t err;
++
++    if (!init) {
++	if (!gcry_check_version(NULL))
++	    return BadAlloc;
++	gcry_control(GCRYCTL_DISABLE_SECMEM, 0);
++	gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
++	init = 1;
++    }
+ 
+-    success = SHA1_Final (sha1, &ctx);
+-    if (! success)
++    err = gcry_md_open(&h, GCRY_MD_SHA1, 0);
++    if (err)
+ 	return BadAlloc;
++    gcry_md_write(h, input, strlen(input));
++    memcpy(sha1, gcry_md_read(h, GCRY_MD_SHA1), 20);
++    gcry_md_close(h);
+ #endif
+ 
+-    /* convert sha1 to sha1_asc */
+-    for(i=0; i<SHA_DIGEST_LENGTH; ++i) {
+-        sprintf(sha1Asc+i*2, "%02X", sha1[i]);
+-    }
+-
+     return Success;
+ }
+ 
+--- xorg-server-20090727/xkb/ddxLoad.c
++++ xorg-server-20090727.patch/xkb/ddxLoad.c
+@@ -204,6 +204,11 @@
+     gcry_md_close(h);
+ #endif
+ 
++    /* convert sha1 to sha1_asc */
++    for(i=0; i<SHA_DIGEST_LENGTH; ++i) {
++        sprintf(sha1Asc+i*2, "%02X", sha1[i]);
++    }
++
+     return Success;
+ }
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 5287a1b..3a600d0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -41,3 +41,5 @@ fix-dga-removal.patch
 186_autoconfig_geode.patch
 187_edid_quirk_hp_nc8430.patch
 188_default_primary_to_first_busid.patch
+189_xserver_1.5.0_bg_none_root.patch
+190_cache-xkbcomp_output_for_fast_start_up.patch


Reply to: