summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:14:24 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:29:45 +0100
commit29d6678fd546377459ef75cf54abeef5b969b5cf (patch)
tree8edd65790e37a00d01c3f203f773fe4b5012db18 /meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite
parentda49de6885ee1bc424e70bc02f21f6ab920efb55 (diff)
downloadpoky-29d6678fd546377459ef75cf54abeef5b969b5cf.tar.gz
Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things and is generally overwhelming. This commit splits it into several logical sections roughly based on function, recipes.txt gives more information about the classifications used. The opportunity is also used to switch from "packages" to "recipes" as used in OpenEmbedded as the term "packages" can be confusing to people and has many different meanings. Not all recipes have been classified yet, this is just a first pass at separating things out. Some packages are moved to meta-extras as they're no longer actively used or maintained. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite')
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/cache-xkbcomp-output-for-fast-start-up.patch358
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/crosscompile.patch20
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/doublefix.patch13
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/drmfix.patch13
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/fix_macros.patch21
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/fix_macros1.patch22
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/fix_open_max_preprocessor_error.patch13
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/libdri-xinerama-symbol.patch50
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/macro_tweak.patch28
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/nodolt.patch12
-rwxr-xr-xmeta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xorg-server-disable-dri_sarea.patch12
-rwxr-xr-xmeta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xorg-server-enable-dri2.patch23
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-1.5.0-bg-none-root.patch156
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-DRI2Swapbuffer.patch179
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-boottime.patch38
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-no-root-2.patch105
16 files changed, 1063 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/cache-xkbcomp-output-for-fast-start-up.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/cache-xkbcomp-output-for-fast-start-up.patch
new file mode 100644
index 0000000000..b121bba655
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/cache-xkbcomp-output-for-fast-start-up.patch
@@ -0,0 +1,358 @@
1From 0f70ba9d3412b17ac4e08e33e1be3c226c06ea54 Mon Sep 17 00:00:00 2001
2From: Yan Li <yan.i.li@intel.com>
3Date: Tue, 12 May 2009 17:49:07 +0800
4Subject: [PATCH] XKB: cache xkbcomp output for fast start-up v5 for 1.6.1
5Organization: Intel
6
7xkbcomp outputs will be cached in files with hashed keymap as
8names. This saves boot time for around 1s on commodity netbooks.
9
10Signed-off-by: Yan Li <yan.i.li@intel.com>
11---
12 configure.ac | 6 +-
13 xkb/README.compiled | 8 +-
14 xkb/ddxLoad.c | 192 +++++++++++++++++++++++++++++++++++++++++---------
15 3 files changed, 164 insertions(+), 42 deletions(-)
16
17diff --git a/configure.ac b/configure.ac
18index 4c4c797..7a5020a 100644
19--- a/configure.ac
20+++ b/configure.ac
21@@ -476,9 +476,9 @@ AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [
22 AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: ${datadir}/X11/xkb)]),
23 [ XKBPATH="$withval" ],
24 [ XKBPATH="${datadir}/X11/xkb" ])
25-AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]),
26+AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${localstatedir}/cache/xkb)]),
27 [ XKBOUTPUT="$withval" ],
28- [ XKBOUTPUT="compiled" ])
29+ [ XKBOUTPUT="${localstatedir}/cache/xkb" ])
30 AC_ARG_WITH(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH],
31 [Directory where ancillary server config files are installed (default: ${libdir}/xorg)]),
32 [ SERVERCONFIG="$withval" ],
33@@ -1757,7 +1757,7 @@ AC_DEFINE_DIR(XKB_BIN_DIRECTORY, bindir, [Path to XKB bin dir])
34 XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1`
35
36 if [[ x$XKBOUTPUT_FIRSTCHAR != x/ ]] ; then
37- XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT"
38+ AC_MSG_ERROR([xkb-output must be an absolute path.])
39 fi
40
41 # XKM_OUTPUT_DIR (used in code) must end in / or file names get hosed
42diff --git a/xkb/README.compiled b/xkb/README.compiled
43index 71caa2f..a4a2ae0 100644
44--- a/xkb/README.compiled
45+++ b/xkb/README.compiled
46@@ -4,10 +4,10 @@ current keymap and/or any scratch keymaps used by clients. The X server
47 or some other tool might destroy or replace the files in this directory,
48 so it is not a safe place to store compiled keymaps for long periods of
49 time. The default keymap for any server is usually stored in:
50- X<num>-default.xkm
51-where <num> is the display number of the server in question, which makes
52-it possible for several servers *on the same host* to share the same
53-directory.
54+ server-<SHA1>.xkm
55+
56+where <SHA1> is the SHA1 hash of keymap source, so that compiled
57+keymap of different keymap sources are stored in different files.
58
59 Unless the X server is modified, sharing this directory between servers on
60 different hosts could cause problems.
61diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
62index 4d5dfb6..60a68af 100644
63--- a/xkb/ddxLoad.c
64+++ b/xkb/ddxLoad.c
65@@ -32,6 +32,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
66 #include <xkb-config.h>
67 #endif
68
69+#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */
70+# include <sha1.h>
71+#else /* Use OpenSSL's libcrypto */
72+# include <stddef.h> /* buggy openssl/sha.h wants size_t */
73+# include <openssl/sha.h>
74+#endif
75 #include <stdio.h>
76 #include <ctype.h>
77 #define NEED_EVENTS 1
78@@ -46,24 +52,13 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
79 #define XKBSRV_NEED_FILE_FUNCS
80 #include <xkbsrv.h>
81 #include <X11/extensions/XI.h>
82+#include <errno.h>
83 #include "xkb.h"
84
85 #if defined(CSRG_BASED) || defined(linux) || defined(__GNU__)
86 #include <paths.h>
87 #endif
88
89- /*
90- * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is
91- * relative to the top-level XKB configuration directory.
92- * Making the server write to a subdirectory of that directory
93- * requires some work in the general case (install procedure
94- * has to create links to /var or somesuch on many machines),
95- * so we just compile into /usr/tmp for now.
96- */
97-#ifndef XKM_OUTPUT_DIR
98-#define XKM_OUTPUT_DIR "compiled/"
99-#endif
100-
101 #define PRE_ERROR_MSG "\"The XKEYBOARD keymap compiler (xkbcomp) reports:\""
102 #define ERROR_PREFIX "\"> \""
103 #define POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\""
104@@ -179,6 +174,45 @@ OutputDirectory(
105 }
106
107 static Bool
108+Sha1Asc(char sha1Asc[SHA_DIGEST_LENGTH*2+1], const char * input)
109+{
110+ int i;
111+ unsigned char sha1[SHA_DIGEST_LENGTH];
112+
113+#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */
114+ SHA1_CTX ctx;
115+
116+ SHA1Init (&ctx);
117+ SHA1Update (&ctx, input, strlen(input));
118+ SHA1Final (sha1, &ctx);
119+#else /* Use OpenSSL's libcrypto */
120+ SHA_CTX ctx;
121+ int success;
122+
123+ success = SHA1_Init (&ctx);
124+ if (! success)
125+ return BadAlloc;
126+
127+ success = SHA1_Update (&ctx, input, strlen(input));
128+ if (! success)
129+ return BadAlloc;
130+
131+ success = SHA1_Final (sha1, &ctx);
132+ if (! success)
133+ return BadAlloc;
134+#endif
135+
136+ /* convert sha1 to sha1_asc */
137+ for(i=0; i<SHA_DIGEST_LENGTH; ++i) {
138+ sprintf(sha1Asc+i*2, "%02X", sha1[i]);
139+ }
140+
141+ return Success;
142+}
143+
144+/* call xkbcomp and compile XKB keymap, return xkm file name in
145+ nameRtrn */
146+static Bool
147 XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
148 XkbComponentNamesPtr names,
149 unsigned want,
150@@ -187,7 +221,11 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
151 int nameRtrnLen)
152 {
153 FILE * out;
154- char *buf = NULL, keymap[PATH_MAX], xkm_output_dir[PATH_MAX];
155+ char * buf = NULL, xkmfile[PATH_MAX], xkm_output_dir[PATH_MAX];
156+ char * tmpXkmFile = NULL;
157+ char * canonicalXkmFileName = NULL;
158+ char sha1Asc[SHA_DIGEST_LENGTH*2+1], xkbKeyMapBuf[100*1024];
159+ int ret, result;
160
161 const char *emptystring = "";
162 const char *xkbbasedirflag = emptystring;
163@@ -198,16 +236,70 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
164 /* WIN32 has no popen. The input must be stored in a file which is
165 used as input for xkbcomp. xkbcomp does not read from stdin. */
166 char tmpname[PATH_MAX];
167- const char *xkmfile = tmpname;
168+ const char *xkbfile = tmpname;
169 #else
170- const char *xkmfile = "-";
171+ const char *xkbfile = "-";
172 #endif
173
174- snprintf(keymap, sizeof(keymap), "server-%s", display);
175+ /* Write keymap source (xkbfile) to memory buffer `xkbKeyMapBuf',
176+ of which SHA1 is generated and used as result xkm file name */
177+ memset(xkbKeyMapBuf, 0, sizeof(xkbKeyMapBuf));
178+ out = fmemopen(xkbKeyMapBuf, sizeof(xkbKeyMapBuf), "w");
179+ if (NULL == out) {
180+ ErrorF("[xkb] Open xkbKeyMapBuf for writing failed\n");
181+ return False;
182+ }
183+ ret = XkbWriteXKBKeymapForNames(out, names, xkb, want, need);
184+ if (fclose(out) !=0)
185+ {
186+ ErrorF("[xkb] XkbWriteXKBKeymapForNames error, perhaps xkbKeyMapBuf is too small\n");
187+ return False;
188+ }
189+#ifdef DEBUG
190+ if (xkbDebugFlags) {
191+ ErrorF("[xkb] XkbDDXCompileKeymapByNames compiling keymap:\n");
192+ fputs(xkbKeyMapBuf, stderr);
193+ }
194+#endif
195+ if (!ret) {
196+ ErrorF("[xkb] Generating XKB Keymap failed, giving up compiling keymap\n");
197+ return False;
198+ }
199+
200+ DebugF("[xkb] computing SHA1 of keymap\n");
201+ if (Success == Sha1Asc(sha1Asc, xkbKeyMapBuf)) {
202+ snprintf(xkmfile, sizeof(xkmfile), "server-%s", sha1Asc);
203+ }
204+ else {
205+ ErrorF("[xkb] Computing SHA1 of keymap failed, "
206+ "using display name instead as xkm file name\n");
207+ snprintf(xkmfile, sizeof(xkmfile), "server-%s", display);
208+ }
209
210- XkbEnsureSafeMapName(keymap);
211+ XkbEnsureSafeMapName(xkmfile);
212 OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir));
213
214+ /* set nameRtrn, fail if it's too small */
215+ if ((strlen(xkmfile)+1 > nameRtrnLen) && nameRtrn) {
216+ ErrorF("[xkb] nameRtrn too small to hold xkmfile name\n");
217+ return False;
218+ }
219+ strncpy(nameRtrn, xkmfile, nameRtrnLen);
220+
221+ /* if the xkm file already exists, reuse it */
222+ canonicalXkmFileName = Xprintf("%s%s.xkm", xkm_output_dir, xkmfile);
223+ if (access(canonicalXkmFileName, R_OK) == 0) {
224+ /* yes, we can reuse the old xkm file */
225+ LogMessage(X_INFO, "XKB: reuse xkmfile %s\n", canonicalXkmFileName);
226+ result = True;
227+ goto _ret;
228+ }
229+ LogMessage(X_INFO, "XKB: generating xkmfile %s\n", canonicalXkmFileName);
230+
231+ /* continue to call xkbcomp to compile the keymap. to avoid race
232+ condition, we compile it to a tmpfile then rename it to
233+ xkmfile */
234+
235 #ifdef WIN32
236 strcpy(tmpname, Win32TempDir());
237 strcat(tmpname, "\\xkb_XXXXXX");
238@@ -230,19 +322,30 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
239 }
240 }
241
242+ if ( (tmpXkmFile = tempnam(xkm_output_dir, NULL)) == NULL ) {
243+ ErrorF("[xkb] Can't generate temp xkm file name");
244+ result = False;
245+ goto _ret;
246+ }
247+
248 buf = Xprintf("\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" "
249- "-em1 %s -emp %s -eml %s \"%s%s.xkm\"",
250+ "-em1 %s -emp %s -eml %s \"%s\"",
251 xkbbindir, xkbbindirsep,
252 ( (xkbDebugFlags < 2) ? 1 :
253 ((xkbDebugFlags > 10) ? 10 : (int)xkbDebugFlags) ),
254- xkbbasedirflag, xkmfile,
255+ xkbbasedirflag, xkbfile,
256 PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1,
257- xkm_output_dir, keymap);
258+ tmpXkmFile);
259
260 if (xkbbasedirflag != emptystring) {
261 xfree(xkbbasedirflag);
262 }
263
264+ /* there's a potential race condition between calling tempnam()
265+ and invoking xkbcomp to write the result file (potential temp
266+ file name conflicts), but since xkbcomp is a standalone
267+ program, we have to live with this */
268+
269 #ifndef WIN32
270 out= Popen(buf,"w");
271 #else
272@@ -250,31 +353,43 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
273 #endif
274
275 if (out!=NULL) {
276-#ifdef DEBUG
277- if (xkbDebugFlags) {
278- ErrorF("[xkb] XkbDDXCompileKeymapByNames compiling keymap:\n");
279- XkbWriteXKBKeymapForNames(stderr,names,xkb,want,need);
280+ /* write XKBKeyMapBuf to xkbcomp */
281+ if (EOF==fputs(xkbKeyMapBuf, out))
282+ {
283+ ErrorF("[xkb] Sending keymap to xkbcomp failed\n");
284+ result = False;
285+ goto _ret;
286 }
287-#endif
288- XkbWriteXKBKeymapForNames(out,names,xkb,want,need);
289 #ifndef WIN32
290 if (Pclose(out)==0)
291 #else
292 if (fclose(out)==0 && System(buf) >= 0)
293 #endif
294 {
295+ /* xkbcomp success */
296 if (xkbDebugFlags)
297 DebugF("[xkb] xkb executes: %s\n",buf);
298- if (nameRtrn) {
299- strncpy(nameRtrn,keymap,nameRtrnLen);
300- nameRtrn[nameRtrnLen-1]= '\0';
301+
302+ /* if canonicalXkmFileName already exists now, we simply
303+ overwrite it, this is OK */
304+ ret = rename(tmpXkmFile, canonicalXkmFileName);
305+ if (0 != ret) {
306+ ErrorF("[xkb] Can't rename %s to %s, error: %s\n",
307+ tmpXkmFile, canonicalXkmFileName,
308+ strerror(errno));
309+
310+ /* in case of error, don't unlink tmpXkmFile, leave it
311+ for debugging */
312+
313+ result = False;
314+ goto _ret;
315 }
316- if (buf != NULL)
317- xfree (buf);
318- return True;
319+
320+ result = True;
321+ goto _ret;
322 }
323 else
324- LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap);
325+ LogMessage(X_ERROR, "Error compiling keymap (%s)\n", xkbfile);
326 #ifdef WIN32
327 /* remove the temporary file */
328 unlink(tmpname);
329@@ -289,9 +404,17 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
330 }
331 if (nameRtrn)
332 nameRtrn[0]= '\0';
333+ result = False;
334+
335+_ret:
336+ if (tmpXkmFile)
337+ free(tmpXkmFile);
338+ if (canonicalXkmFileName)
339+ xfree(canonicalXkmFileName);
340 if (buf != NULL)
341 xfree (buf);
342- return False;
343+
344+ return result;
345 }
346
347 static FILE *
348@@ -375,7 +498,6 @@ unsigned missing;
349 DebugF("Loaded XKB keymap %s, defined=0x%x\n",fileName,(*xkbRtrn)->defined);
350 }
351 fclose(file);
352- (void) unlink (fileName);
353 return (need|want)&(~missing);
354 }
355
356--
3571.5.6.5
358
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/crosscompile.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/crosscompile.patch
new file mode 100644
index 0000000000..8b82de2223
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/crosscompile.patch
@@ -0,0 +1,20 @@
1diff --git a/configure.ac b/configure.ac
2index b3b752c..600500b 100644
3--- a/configure.ac
4+++ b/configure.ac
5@@ -523,13 +523,9 @@ dnl Uses --default-font-path if set, otherwise checks for /etc/X11/fontpath.d,
6 dnl otherwise uses standard subdirectories of FONTROOTDIR. When cross
7 dnl compiling, assume default font path uses standard FONTROOTDIR directories.
8 DEFAULT_FONT_PATH="${FONTMISCDIR}/,${FONTTTFDIR}/,${FONTOTFDIR}/,${FONTTYPE1DIR}/,${FONT100DPIDIR}/,${FONT75DPIDIR}/"
9-if test "$cross_compiling" != yes; then
10- AC_CHECK_FILE([${sysconfdir}/X11/fontpath.d],
11- [DEFAULT_FONT_PATH='catalogue:${sysconfdir}/X11/fontpath.d'],
12- [case $host_os in
13+ case $host_os in
14 darwin*) DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;;
15- esac])
16-fi
17+ esac
18 AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]),
19 [ FONTPATH="$withval" ],
20 [ FONTPATH="${DEFAULT_FONT_PATH}" ])
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/doublefix.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/doublefix.patch
new file mode 100644
index 0000000000..092a712903
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/doublefix.patch
@@ -0,0 +1,13 @@
1Index: xorg-server-1.6.0/hw/xfree86/common/Makefile.am
2===================================================================
3--- xorg-server-1.6.0.orig/hw/xfree86/common/Makefile.am 2010-02-01 14:04:53.247789918 +0000
4+++ xorg-server-1.6.0/hw/xfree86/common/Makefile.am 2010-02-01 14:05:27.787817002 +0000
5@@ -46,7 +46,7 @@
6 sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \
7 xf86PciInfo.h xf86Priv.h xf86Privstr.h xf86Resources.h \
8 xf86cmap.h xf86fbman.h xf86str.h xf86RAC.h xf86Xinput.h xisb.h \
9- $(XVSDKINCS) xorgVersion.h \
10+ xorgVersion.h \
11 xf86sbusBus.h xf86xv.h xf86xvmc.h xf86xvpriv.h
12
13 DISTCLEANFILES = xf86Build.h
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/drmfix.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/drmfix.patch
new file mode 100644
index 0000000000..a62a767f23
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/drmfix.patch
@@ -0,0 +1,13 @@
1Index: xorg-server-1.4/hw/xfree86/os-support/linux/Makefile.am
2===================================================================
3--- xorg-server-1.4.orig/hw/xfree86/os-support/linux/Makefile.am 2007-08-23 21:04:53.000000000 +0200
4+++ xorg-server-1.4/hw/xfree86/os-support/linux/Makefile.am 2008-03-13 18:27:23.000000000 +0100
5@@ -41,7 +41,7 @@
6
7 AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(DIX_CFLAGS) $(XORG_CFLAGS) $(PLATFORM_DEFINES)
8
9-INCLUDES = $(XORG_INCS) $(PLATFORM_INCLUDES) -I/usr/include/drm # FIXME this last part is crack
10+INCLUDES = $(XORG_INCS) $(PLATFORM_INCLUDES) $(LIBDRM_CFLAGS)
11
12 # FIXME: These need to be added to the build
13 LNX_EXTRA_SRCS = \
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/fix_macros.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/fix_macros.patch
new file mode 100644
index 0000000000..eed491b4d9
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/fix_macros.patch
@@ -0,0 +1,21 @@
1We need to insert the sysroot path into compiler commandlines for this
2kind of variable use, otherwise we're looking into /usr/include/.
3
4RP - 26/11/09
5
6Index: git/xorg-server.m4
7===================================================================
8--- git.orig/xorg-server.m4 2009-11-10 12:04:34.000000000 +0000
9+++ git/xorg-server.m4 2009-11-27 00:05:02.000000000 +0000
10@@ -28,9 +28,10 @@
11 # Checks for the $1 define in xorg-server.h (from the sdk). If it
12 # is defined, then add $1 to $REQUIRED_MODULES.
13
14+m4_pattern_allow([^PKG_CONFIG_SYSROOT_DIR$])
15 AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
16 SAVE_CFLAGS="$CFLAGS"
17- CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
18+ CFLAGS="$CFLAGS -I$PKG_CONFIG_SYSROOT_DIR`pkg-config --variable=sdkdir xorg-server`"
19 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
20 #include "xorg-server.h"
21 #if !defined $1
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/fix_macros1.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/fix_macros1.patch
new file mode 100644
index 0000000000..94852f0dea
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/fix_macros1.patch
@@ -0,0 +1,22 @@
1We need to insert the sysroot path into compiler commandlines for this
2kind of variable use, otherwise we're looking into /usr/include/.
3
4RP - 26/11/09
5
6Index: git/xorg-server.m4
7===================================================================
8--- git.orig/xorg-server.m4 2010-02-05 10:00:55.000000000 +0000
9+++ git/xorg-server.m4 2010-02-05 10:02:12.000000000 +0000
10@@ -28,10 +28,11 @@
11 # Checks for the $1 define in xorg-server.h (from the sdk). If it
12 # is defined, then add $1 to $REQUIRED_MODULES.
13
14+m4_pattern_allow([^PKG_CONFIG_SYSROOT_DIR$])
15 AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
16 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
17 SAVE_CFLAGS="$CFLAGS"
18- CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
19+ CFLAGS="$CFLAGS -I$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=sdkdir xorg-server`"
20 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
21 #include "xorg-server.h"
22 #if !defined $1
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/fix_open_max_preprocessor_error.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/fix_open_max_preprocessor_error.patch
new file mode 100644
index 0000000000..565832eed8
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/fix_open_max_preprocessor_error.patch
@@ -0,0 +1,13 @@
1Index: git/os/osdep.h
2===================================================================
3--- git.orig/os/osdep.h 2008-10-07 18:38:21.000000000 +0100
4+++ git/os/osdep.h 2008-10-07 18:39:36.000000000 +0100
5@@ -92,7 +92,7 @@
6 * like sysconf(_SC_OPEN_MAX) is not supported.
7 */
8
9-#if OPEN_MAX <= 256
10+#if 0
11 #define MAXSOCKS (OPEN_MAX - 1)
12 #else
13 #define MAXSOCKS 256
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/libdri-xinerama-symbol.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/libdri-xinerama-symbol.patch
new file mode 100644
index 0000000000..db29da93ca
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/libdri-xinerama-symbol.patch
@@ -0,0 +1,50 @@
1Index: xorg-server-1.5.0/hw/xfree86/dri/dri.c
2===================================================================
3--- xorg-server-1.5.0.orig/hw/xfree86/dri/dri.c 2008-09-24 17:43:04.000000000 +0100
4+++ xorg-server-1.5.0/hw/xfree86/dri/dri.c 2008-09-24 17:46:38.000000000 +0100
5@@ -73,10 +73,6 @@
6
7 #define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu)
8
9-#if !defined(PANORAMIX)
10-extern Bool noPanoramiXExtension;
11-#endif
12-
13 static int DRIEntPrivIndex = -1;
14 static DevPrivateKey DRIScreenPrivKey = &DRIScreenPrivKey;
15 static DevPrivateKey DRIWindowPrivKey = &DRIWindowPrivKey;
16@@ -307,7 +303,6 @@
17 drm_context_t * reserved;
18 int reserved_count;
19 int i;
20- Bool xineramaInCore = FALSE;
21 DRIEntPrivPtr pDRIEntPriv;
22 ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
23 DRIContextFlags flags = 0;
24@@ -320,20 +315,13 @@
25 return FALSE;
26 }
27
28- /*
29- * If Xinerama is on, don't allow DRI to initialise. It won't be usable
30- * anyway.
31- */
32- if (xf86LoaderCheckSymbol("noPanoramiXExtension"))
33- xineramaInCore = TRUE;
34-
35- if (xineramaInCore) {
36- if (!noPanoramiXExtension) {
37- DRIDrvMsg(pScreen->myNum, X_WARNING,
38- "Direct rendering is not supported when Xinerama is enabled\n");
39- return FALSE;
40- }
41+#if defined(PANORAMIX)
42+ if (!noPanoramiXExtension) {
43+ DRIDrvMsg(pScreen->myNum, X_WARNING,
44+ "Direct rendering is not supported when Xinerama is enabled\n");
45+ return FALSE;
46 }
47+#endif
48
49 if (!DRIOpenDRMMaster(pScrn, pDRIInfo->SAREASize,
50 pDRIInfo->busIdString,
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/macro_tweak.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/macro_tweak.patch
new file mode 100644
index 0000000000..cd408c7bc2
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/macro_tweak.patch
@@ -0,0 +1,28 @@
1This is the revised version of files/macro_tweak.patch for
2xorg-server 1.8.99.904.
3
4the files/macro_tweak.patch can not removed now since it is used by
5xserver-kdrive-1.7.99.2 and xserver-xf86-lite_1.7.99.2. Once they
6are all upgraded to 1.8.99.904, the the files/macro_tweak.patch
7can be safely replace by this patch.
8
9Signed-off-by: Yu Ke <ke.yu@intel.com>
10
11diff --git a/xorg-server.m4 b/xorg-server.m4
12index bdecf62..040fdb8 100644
13--- a/xorg-server.m4
14+++ b/xorg-server.m4
15@@ -28,10 +28,12 @@ dnl
16 # Checks for the $1 define in xorg-server.h (from the sdk). If it
17 # is defined, then add $1 to $REQUIRED_MODULES.
18
19+m4_pattern_allow(PKG_CONFIG_SYSROOT_DIR)
20+
21 AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
22 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
23 SAVE_CFLAGS="$CFLAGS"
24- CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
25+ CFLAGS="$CFLAGS -I$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=sdkdir xorg-server`"
26 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
27 #include "xorg-server.h"
28 #if !defined $1
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/nodolt.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/nodolt.patch
new file mode 100644
index 0000000000..6b34032a39
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/nodolt.patch
@@ -0,0 +1,12 @@
1Index: git/configure.ac
2===================================================================
3--- git.orig/configure.ac 2009-01-15 20:35:31.000000000 +0000
4+++ git/configure.ac 2009-01-15 20:35:38.000000000 +0000
5@@ -62,7 +62,6 @@
6 AC_LIBTOOL_WIN32_DLL
7 AC_DISABLE_STATIC
8 AC_PROG_LIBTOOL
9-DOLT
10 AC_PROG_MAKE_SET
11 PKG_PROG_PKG_CONFIG
12 AC_PROG_LEX
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xorg-server-disable-dri_sarea.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xorg-server-disable-dri_sarea.patch
new file mode 100755
index 0000000000..3d2fa1669a
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xorg-server-disable-dri_sarea.patch
@@ -0,0 +1,12 @@
1diff -urN xorg-server-1.5.99.1/hw/xfree86/dri2/dri2.c xorg-server-1.5.99.1.new/hw/xfree86/dri2/dri2.c
2--- xorg-server-1.5.99.1/hw/xfree86/dri2/dri2.c 2008-09-01 03:26:37.000000000 +0800
3+++ xorg-server-1.5.99.1.new/hw/xfree86/dri2/dri2.c 2008-09-18 00:28:16.000000000 +0800
4@@ -39,7 +39,7 @@
5 #include "scrnintstr.h"
6 #include "windowstr.h"
7 #include "dri2.h"
8-#include <GL/internal/dri_sarea.h>
9+//#include <GL/internal/dri_sarea.h>
10
11 #include "xf86.h"
12
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xorg-server-enable-dri2.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xorg-server-enable-dri2.patch
new file mode 100755
index 0000000000..7ff3658d0c
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xorg-server-enable-dri2.patch
@@ -0,0 +1,23 @@
1commit 67b9b3a77a8b86eef03af36a0f4be3a07411efee
2Author: Eric Anholt <eric@anholt.net>
3Date: Thu Sep 11 16:18:17 2008 -0700
4
5 Enable DRI2 build.
6
7diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
8index eff2c31..98d7ec8 100644
9--- a/hw/xfree86/Makefile.am
10+++ b/hw/xfree86/Makefile.am
11@@ -4,9 +4,9 @@ if DRI
12 DRI_SUBDIR = dri
13 endif
14
15-#if DRI2
16-#DRI2_SUBDIR = dri2
17-#endif
18+if DRI2
19+DRI2_SUBDIR = dri2
20+endif
21
22 if XF86UTILS
23 XF86UTILS_SUBDIR = utils
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-1.5.0-bg-none-root.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-1.5.0-bg-none-root.patch
new file mode 100644
index 0000000000..ef53689bd0
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-1.5.0-bg-none-root.patch
@@ -0,0 +1,156 @@
1From a3e15680da24cb8259f6a83dee0c930dab024290 Mon Sep 17 00:00:00 2001
2From: Kristian <krh@redhat.com>
3Date: Fri, 15 Aug 2008 15:15:14 +1000
4Subject: [PATCH] Add nr for background=none root
5
6---
7 dix/globals.c | 1 +
8 dix/window.c | 22 ++++++++++++----------
9 hw/xfree86/common/xf86Init.c | 11 +++++++++++
10 hw/xfree86/common/xf86str.h | 5 ++++-
11 include/opaque.h | 1 +
12 os/utils.c | 3 +++
13 6 files changed, 32 insertions(+), 11 deletions(-)
14
15diff --git a/dix/globals.c b/dix/globals.c
16index 973dc43..dbd76bb 100644
17--- a/dix/globals.c
18+++ b/dix/globals.c
19@@ -141,6 +141,7 @@ FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in
20 CursorPtr rootCursor;
21 Bool party_like_its_1989 = FALSE;
22 Bool whiteRoot = FALSE;
23+Bool bgNoneRoot = FALSE;
24
25 int cursorScreenDevPriv[MAXSCREENS];
26
27diff --git a/dix/window.c b/dix/window.c
28index c31fa87..8bb178d 100644
29--- a/dix/window.c
30+++ b/dix/window.c
31@@ -482,23 +482,24 @@ InitRootWindow(WindowPtr pWin)
32 pWin->cursorIsNone = FALSE;
33 pWin->optional->cursor = rootCursor;
34 rootCursor->refcnt++;
35-
36+ pWin->backingStore = defaultBackingStore;
37+ pWin->forcedBS = (defaultBackingStore != NotUseful);
38
39 if (party_like_its_1989) {
40 MakeRootTile(pWin);
41 backFlag |= CWBackPixmap;
42+ pScreen->ChangeWindowAttributes(pWin, backFlag);
43+ } else if (bgNoneRoot) {
44+ /* nothing, handled in xf86CreateRootWindow */
45 } else {
46 if (whiteRoot)
47 pWin->background.pixel = pScreen->whitePixel;
48 else
49 pWin->background.pixel = pScreen->blackPixel;
50 backFlag |= CWBackPixel;
51- }
52
53- pWin->backingStore = defaultBackingStore;
54- pWin->forcedBS = (defaultBackingStore != NotUseful);
55- /* We SHOULD check for an error value here XXX */
56- (*pScreen->ChangeWindowAttributes)(pWin, backFlag);
57+ pScreen->ChangeWindowAttributes(pWin, backFlag);
58+ }
59
60 MapWindow(pWin, serverClient);
61 }
62diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
63index 236c00b..083a6ac 100644
64--- a/hw/xfree86/common/xf86Init.c
65+++ b/hw/xfree86/common/xf86Init.c
66@@ -79,6 +79,7 @@
67 #ifdef RENDER
68 #include "picturestr.h"
69 #endif
70+#include "xace.h"
71
72 #include "globals.h"
73
74@@ -328,6 +329,7 @@ xf86CreateRootWindow(WindowPtr pWin)
75 int ret = TRUE;
76 int err = Success;
77 ScreenPtr pScreen = pWin->drawable.pScreen;
78+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
79 RootWinPropPtr pProp;
80 CreateWindowProcPtr CreateWindow = (CreateWindowProcPtr)
81 dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey);
82@@ -381,6 +383,15 @@ xf86CreateRootWindow(WindowPtr pWin)
83 }
84 }
85
86+ if (bgNoneRoot && pScrn->canDoBGNoneRoot || 1) {
87+ pWin->backgroundState = XaceBackgroundNoneState(pWin);
88+ pWin->background.pixel = pScreen->whitePixel;
89+ pScreen->ChangeWindowAttributes(pWin, CWBackPixmap | CWBorderPixel | CWCursor | CWBackingStore);
90+ } else {
91+ pWin->background.pixel = pScreen->blackPixel;
92+ pScreen->ChangeWindowAttributes(pWin, CWBackPixel | CWBorderPixel | CWCursor | CWBackingStore);
93+ }
94+
95 #ifdef DEBUG
96 ErrorF("xf86CreateRootWindow() returns %d\n", ret);
97 #endif
98diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
99index 904c369..8c38f69 100644
100--- a/hw/xfree86/common/xf86str.h
101+++ b/hw/xfree86/common/xf86str.h
102@@ -531,7 +531,7 @@ typedef struct _confdrirec {
103 } confDRIRec, *confDRIPtr;
104
105 /* These values should be adjusted when new fields are added to ScrnInfoRec */
106-#define NUM_RESERVED_INTS 16
107+#define NUM_RESERVED_INTS 15
108 #define NUM_RESERVED_POINTERS 15
109 #define NUM_RESERVED_FUNCS 11
110
111@@ -959,6 +959,9 @@ typedef struct _ScrnInfoRec {
112 ClockRangesPtr clockRanges;
113 int adjustFlags;
114
115+ /* -nr support */
116+ int canDoBGNoneRoot;
117+
118 /*
119 * These can be used when the minor ABI version is incremented.
120 * The NUM_* parameters must be reduced appropriately to keep the
121diff --git a/include/opaque.h b/include/opaque.h
122index 07a0715..be1577b 100644
123--- a/include/opaque.h
124+++ b/include/opaque.h
125@@ -71,6 +71,7 @@ extern Bool defeatAccessControl;
126 extern long maxBigRequestSize;
127 extern Bool party_like_its_1989;
128 extern Bool whiteRoot;
129+extern Bool bgNoneRoot;
130
131 extern Bool CoreDump;
132
133diff --git a/os/utils.c b/os/utils.c
134index b100949..c41b45b 100644
135--- a/os/utils.c
136+++ b/os/utils.c
137@@ -515,6 +515,7 @@ void UseMsg(void)
138 #endif
139 ErrorF("-nolisten string don't listen on protocol\n");
140 ErrorF("-noreset don't reset after last client exists\n");
141+ ErrorF("-nr create root window with no background\n");
142 ErrorF("-reset reset after last client exists\n");
143 ErrorF("-p # screen-saver pattern duration (minutes)\n");
144 ErrorF("-pn accept failure to listen on all ports\n");
145@@ -859,6 +860,8 @@ ProcessCommandLine(int argc, char *argv[])
146 defaultBackingStore = WhenMapped;
147 else if ( strcmp( argv[i], "-wr") == 0)
148 whiteRoot = TRUE;
149+ else if ( strcmp( argv[i], "-nr") == 0)
150+ bgNoneRoot = TRUE;
151 else if ( strcmp( argv[i], "-maxbigreqsize") == 0) {
152 if(++i < argc) {
153 long reqSizeArg = atol(argv[i]);
154--
1551.5.3.4
156
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-DRI2Swapbuffer.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-DRI2Swapbuffer.patch
new file mode 100644
index 0000000000..2754170d2f
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-DRI2Swapbuffer.patch
@@ -0,0 +1,179 @@
1diff --git a/glx/glxdri2.c b/glx/glxdri2.c
2index 146ea82..3b5338b 100644
3--- a/glx/glxdri2.c
4+++ b/glx/glxdri2.c
5@@ -70,6 +70,7 @@ struct __GLXDRIscreen {
6
7 const __DRIcoreExtension *core;
8 const __DRIdri2Extension *dri2;
9+ const __DRI2flushExtension *flush;
10 const __DRIcopySubBufferExtension *copySubBuffer;
11 const __DRIswapControlExtension *swapControl;
12 const __DRItexBufferExtension *texBuffer;
13@@ -135,10 +136,14 @@ __glXDRIdrawableCopySubBuffer(__GLXdrawable *drawable,
14 static GLboolean
15 __glXDRIdrawableSwapBuffers(__GLXdrawable *drawable)
16 {
17- __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
18+ __GLXDRIdrawable *priv = (__GLXDRIdrawable *) drawable;
19+ __GLXDRIscreen *screen = priv->screen;
20+
21+ if (!DRI2SwapBuffers(drawable->pDraw))
22+ return FALSE;
23
24- __glXDRIdrawableCopySubBuffer(drawable, 0, 0,
25- private->width, private->height);
26+ if (screen->flush->flushInvalidate)
27+ (*screen->flush->flushInvalidate)(priv->driDrawable);
28
29 return TRUE;
30 }
31diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
32index 580383d..23e6467 100644
33--- a/hw/xfree86/dri2/dri2.c
34+++ b/hw/xfree86/dri2/dri2.c
35@@ -70,6 +70,7 @@ typedef struct _DRI2Screen {
36 DRI2CreateBufferProcPtr CreateBuffer;
37 DRI2DestroyBufferProcPtr DestroyBuffer;
38 DRI2CopyRegionProcPtr CopyRegion;
39+ DRI2SwapBuffersProcPtr SwapBuffers;
40
41 HandleExposuresProcPtr HandleExposures;
42 } DRI2ScreenRec, *DRI2ScreenPtr;
43@@ -422,6 +423,49 @@ DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion,
44 return Success;
45 }
46
47+Bool
48+DRI2SwapBuffers(DrawablePtr pDraw)
49+{
50+ DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen);
51+ DRI2DrawablePtr pPriv;
52+ DRI2BufferPtr pDestBuffer, pSrcBuffer;
53+ int i;
54+
55+ pPriv = DRI2GetDrawable(pDraw);
56+ if (pPriv == NULL)
57+ return FALSE;
58+
59+ pDestBuffer = NULL;
60+ pSrcBuffer = NULL;
61+ for (i = 0; i < pPriv->bufferCount; i++)
62+ {
63+ if (pPriv->buffers[i]->attachment == DRI2BufferFrontLeft)
64+ pDestBuffer = (DRI2BufferPtr) pPriv->buffers[i];
65+ if (pPriv->buffers[i]->attachment == DRI2BufferBackLeft)
66+ pSrcBuffer = (DRI2BufferPtr) pPriv->buffers[i];
67+ }
68+ if (pSrcBuffer == NULL || pDestBuffer == NULL)
69+ return FALSE;
70+
71+ if (ds->SwapBuffers) {
72+ if ((*ds->SwapBuffers)(pDraw, pDestBuffer, pSrcBuffer))
73+ return TRUE;
74+ }
75+
76+ BoxRec box;
77+ RegionRec region;
78+
79+ box.x1 = 0;
80+ box.y1 = 0;
81+ box.x2 = pDraw->width;
82+ box.y2 = pDraw->height;
83+ REGION_INIT(drawable->pDraw->pScreen, &region, &box, 0);
84+ if (DRI2CopyRegion(pDraw, &region, DRI2BufferFrontLeft, DRI2BufferBackLeft) != Success)
85+ return FALSE;
86+
87+ return TRUE;
88+}
89+
90 void
91 DRI2DestroyDrawable(DrawablePtr pDraw)
92 {
93@@ -538,6 +582,9 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
94 }
95 ds->CopyRegion = info->CopyRegion;
96
97+ if (info->version >= 3)
98+ ds->SwapBuffers = info->SwapBuffers;
99+
100 dixSetPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey, ds);
101
102 xf86DrvMsg(pScreen->myNum, X_INFO, "[DRI2] Setup complete\n");
103diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
104index f369267..e2784dd 100644
105--- a/hw/xfree86/dri2/dri2.h
106+++ b/hw/xfree86/dri2/dri2.h
107@@ -67,6 +67,10 @@ typedef void (*DRI2CopyRegionProcPtr)(DrawablePtr pDraw,
108 DRI2BufferPtr pDestBuffer,
109 DRI2BufferPtr pSrcBuffer);
110
111+typedef Bool (*DRI2SwapBuffersProcPtr)(DrawablePtr pDraw,
112+ DRI2BufferPtr pFrontBuffer,
113+ DRI2BufferPtr pBackBuffer);
114+
115 typedef void (*DRI2WaitProcPtr)(WindowPtr pWin,
116 unsigned int sequence);
117
118@@ -90,6 +94,7 @@ typedef struct {
119 DRI2CreateBuffersProcPtr CreateBuffers;
120 DRI2DestroyBuffersProcPtr DestroyBuffers;
121 DRI2CopyRegionProcPtr CopyRegion;
122+ DRI2SwapBuffersProcPtr SwapBuffers;
123 DRI2WaitProcPtr Wait;
124
125 /**
126@@ -153,4 +158,6 @@ extern _X_EXPORT DRI2Buffer2Ptr *DRI2GetBuffersWithFormat(DrawablePtr pDraw,
127 int *width, int *height, unsigned int *attachments, int count,
128 int *out_count);
129
130+extern _X_EXPORT Bool DRI2SwapBuffers(DrawablePtr pDraw);
131+
132 #endif
133diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
134index 3c06174..67b419b 100644
135--- a/hw/xfree86/dri2/dri2ext.c
136+++ b/hw/xfree86/dri2/dri2ext.c
137@@ -81,7 +81,7 @@ ProcDRI2QueryVersion(ClientPtr client)
138 rep.length = 0;
139 rep.sequenceNumber = client->sequence;
140 rep.majorVersion = 1;
141- rep.minorVersion = 1;
142+ rep.minorVersion = 2;
143
144 if (client->swapped) {
145 swaps(&rep.sequenceNumber, n);
146@@ -323,6 +323,24 @@ ProcDRI2CopyRegion(ClientPtr client)
147 }
148
149 static int
150+ProcDRI2SwapBuffers(ClientPtr client)
151+{
152+ REQUEST(xDRI2SwapBuffersReq);
153+ DrawablePtr pDrawable;
154+ int status;
155+
156+ REQUEST_SIZE_MATCH(xDRI2SwapBuffersReq);
157+
158+ if (!validDrawable(client, stuff->drawable, &pDrawable, &status))
159+ return status;
160+
161+ if (!DRI2SwapBuffers(pDrawable))
162+ return BadAlloc;
163+
164+ return client->noClientException;
165+}
166+
167+static int
168 ProcDRI2Dispatch (ClientPtr client)
169 {
170 REQUEST(xReq);
171@@ -350,6 +368,8 @@ ProcDRI2Dispatch (ClientPtr client)
172 return ProcDRI2CopyRegion(client);
173 case X_DRI2GetBuffersWithFormat:
174 return ProcDRI2GetBuffersWithFormat(client);
175+ case X_DRI2SwapBuffers:
176+ return ProcDRI2SwapBuffers(client);
177 default:
178 return BadRequest;
179 }
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-boottime.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-boottime.patch
new file mode 100644
index 0000000000..efc85a42ab
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-boottime.patch
@@ -0,0 +1,38 @@
1diff --git a/os/log.c b/os/log.c
2index 0860847..2c46f1a 100644
3--- a/os/log.c
4+++ b/os/log.c
5@@ -255,6 +255,33 @@ LogVWrite(int verb, const char *f, va_list args)
6 static char tmpBuffer[1024];
7 int len = 0;
8
9+ struct timeval time;
10+ time_t tv_sec;
11+ suseconds_t tv_usec;
12+ static Bool first = TRUE;
13+ static time_t start_tv_sec;
14+ static suseconds_t start_usec;
15+ int diff_sec, diff_usec;
16+
17+ gettimeofday(&time, NULL);
18+ tv_sec = time.tv_sec;
19+ tv_usec = time.tv_usec;
20+ if (first == TRUE) {
21+ start_tv_sec = tv_sec;
22+ start_usec = tv_usec;
23+ first = FALSE;
24+ }
25+ diff_sec = (int)difftime(tv_sec, start_tv_sec);
26+ diff_usec = (tv_usec - start_usec);
27+ if (diff_usec < 0) {
28+ diff_sec--;
29+ diff_usec += 1000000;
30+ }
31+ sprintf(tmpBuffer, "[%d sec: %06d usec]", diff_sec , diff_usec);
32+ len = strlen(tmpBuffer);
33+ if (logFile)
34+ fwrite(tmpBuffer, len, 1, logFile);
35+
36 /*
37 * Since a va_list can only be processed once, write the string to a
38 * buffer, and then write the buffer out to the appropriate output
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-no-root-2.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-no-root-2.patch
new file mode 100644
index 0000000000..afc94dcc5c
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-no-root-2.patch
@@ -0,0 +1,105 @@
1diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
2index 7f40857..cf58c01 100644
3--- a/hw/xfree86/os-support/linux/lnx_init.c
4+++ b/hw/xfree86/os-support/linux/lnx_init.c
5@@ -49,6 +49,7 @@ static Bool KeepTty = FALSE;
6 static int VTnum = -1;
7 static Bool VTSwitch = TRUE;
8 static Bool ShareVTs = FALSE;
9+Bool NoHwAccess = FALSE;
10 static int activeVT = -1;
11
12 static int vtPermSave[4];
13@@ -80,9 +81,11 @@ saveVtPerms(void)
14 static void
15 restoreVtPerms(void)
16 {
17- /* Set the terminal permissions back to before we started. */
18- chown("/dev/tty0", vtPermSave[0], vtPermSave[1]);
19- chown(vtname, vtPermSave[2], vtPermSave[3]);
20+ if (geteuid() == 0) {
21+ /* Set the terminal permissions back to before we started. */
22+ (void)chown("/dev/tty0", vtPermSave[0], vtPermSave[1]);
23+ (void)chown(vtname, vtPermSave[2], vtPermSave[3]);
24+ }
25 }
26
27 static void *console_handler;
28@@ -210,20 +213,22 @@ xf86OpenConsole(void)
29 xf86Msg(X_WARNING,
30 "xf86OpenConsole: Could not save ownership of VT\n");
31
32- /* change ownership of the vt */
33- if (chown(vtname, getuid(), getgid()) < 0)
34- xf86Msg(X_WARNING,"xf86OpenConsole: chown %s failed: %s\n",
35- vtname, strerror(errno));
36-
37- /*
38- * the current VT device we're running on is not "console", we want
39- * to grab all consoles too
40- *
41- * Why is this needed??
42- */
43- if (chown("/dev/tty0", getuid(), getgid()) < 0)
44- xf86Msg(X_WARNING,"xf86OpenConsole: chown /dev/tty0 failed: %s\n",
45- strerror(errno));
46+ if (geteuid() == 0) {
47+ /* change ownership of the vt */
48+ if (chown(vtname, getuid(), getgid()) < 0)
49+ xf86Msg(X_WARNING,"xf86OpenConsole: chown %s failed: %s\n",
50+ vtname, strerror(errno));
51+
52+ /*
53+ * the current VT device we're running on is not
54+ * "console", we want to grab all consoles too
55+ *
56+ * Why is this needed??
57+ */
58+ if (chown("/dev/tty0", getuid(), getgid()) < 0)
59+ xf86Msg(X_WARNING,"xf86OpenConsole: chown /dev/tty0 failed: %s\n",
60+ strerror(errno));
61+ }
62 }
63
64 /*
65@@ -433,6 +438,11 @@ xf86ProcessArgument(int argc, char *argv[], int i)
66 ShareVTs = TRUE;
67 return(1);
68 }
69+ if (!strcmp(argv[i], "-nohwaccess"))
70+ {
71+ NoHwAccess = TRUE;
72+ return(1);
73+ }
74 if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
75 {
76 if (sscanf(argv[i], "vt%2d", &VTnum) == 0)
77@@ -454,5 +464,6 @@ xf86UseMsg()
78 ErrorF("don't detach controlling tty (for debugging only)\n");
79 ErrorF("-novtswitch don't immediately switch to new VT\n");
80 ErrorF("-sharevts share VTs with another X server\n");
81+ ErrorF("-nohwaccess don't access hardware ports directly\n");
82 return;
83 }
84diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
85index 688106a..34a845b 100644
86--- a/hw/xfree86/os-support/linux/lnx_video.c
87+++ b/hw/xfree86/os-support/linux/lnx_video.c
88@@ -51,6 +51,7 @@
89 #define MAP_FAILED ((void *)-1)
90 #endif
91
92+extern Bool NoHwAccess;
93 static Bool ExtendedEnabled = FALSE;
94
95 #ifdef __ia64__
96@@ -509,6 +510,9 @@ xf86EnableIO(void)
97 int fd;
98 unsigned int ioBase_phys;
99 #endif
100+ /* Fake it... */
101+ if (NoHwAccess)
102+ return TRUE;
103
104 if (ExtendedEnabled)
105 return TRUE;