diff options
author | Khem Raj <raj.khem@gmail.com> | 2012-02-04 15:54:09 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-02-08 00:50:28 +0000 |
commit | a50eeb884affcec346b3f4c690902db4c2a72d0d (patch) | |
tree | 04e4e5aec3512ec1ea7053c4276963373b02d544 /meta/recipes-graphics | |
parent | a4021674edbb47cead999a10fa85210e397456ba (diff) | |
download | poky-a50eeb884affcec346b3f4c690902db4c2a72d0d.tar.gz |
libx11: Backport _XGetRequest API
This API is relatively new and will be in next release of libX11
this is needed for OE qemu-native which links to libx11-native
but uses libGL from build system and herein lies the problem
if you have bleeding edge distro e.g. ubuntu 12.04(development)
libGL.so expects this API to be present. Backported to 1.4.4
thusly
(From OE-Core rev: e08604800fe1cb8f240f53c147ceb4ee08a29b91)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics')
-rw-r--r-- | meta/recipes-graphics/xorg-lib/libx11-1.4.4/0001-Add-_XGetRequest-as-substitute-for-GetReq-GetReqExtr.patch | 137 | ||||
-rw-r--r-- | meta/recipes-graphics/xorg-lib/libx11_1.4.4.bb | 3 |
2 files changed, 140 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xorg-lib/libx11-1.4.4/0001-Add-_XGetRequest-as-substitute-for-GetReq-GetReqExtr.patch b/meta/recipes-graphics/xorg-lib/libx11-1.4.4/0001-Add-_XGetRequest-as-substitute-for-GetReq-GetReqExtr.patch new file mode 100644 index 0000000000..aedb5c4366 --- /dev/null +++ b/meta/recipes-graphics/xorg-lib/libx11-1.4.4/0001-Add-_XGetRequest-as-substitute-for-GetReq-GetReqExtr.patch | |||
@@ -0,0 +1,137 @@ | |||
1 | From 4a060f993bf676cf21ad9784e010f54134da7b40 Mon Sep 17 00:00:00 2001 | ||
2 | From: Peter Hutterer <peter.hutterer@who-t.net> | ||
3 | Date: Mon, 17 Oct 2011 09:45:15 +1000 | ||
4 | Subject: [PATCH] Add _XGetRequest as substitute for GetReq/GetReqExtra | ||
5 | |||
6 | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
7 | Reviewed-by: Jamey Sharp <jamey@minilop.net> | ||
8 | --- | ||
9 | include/X11/Xlibint.h | 49 ++++++++++++++++--------------------------------- | ||
10 | src/XlibInt.c | 31 +++++++++++++++++++++++++++++++ | ||
11 | 2 files changed, 47 insertions(+), 33 deletions(-) | ||
12 | |||
13 | Upstream-Status: Backport | ||
14 | |||
15 | diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h | ||
16 | index 2ce356d..43d1f2a 100644 | ||
17 | --- a/include/X11/Xlibint.h | ||
18 | +++ b/include/X11/Xlibint.h | ||
19 | @@ -420,6 +420,18 @@ extern LockInfoPtr _Xglobal_lock; | ||
20 | #define WORD64ALIGN | ||
21 | #endif /* WORD64 */ | ||
22 | |||
23 | +/** | ||
24 | + * Return a len-sized request buffer for the request type. This function may | ||
25 | + * flush the output queue. | ||
26 | + * | ||
27 | + * @param dpy The display connection | ||
28 | + * @param type The request type | ||
29 | + * @param len Length of the request in bytes | ||
30 | + * | ||
31 | + * @returns A pointer to the request buffer with a few default values | ||
32 | + * initialized. | ||
33 | + */ | ||
34 | +extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); | ||
35 | |||
36 | /* | ||
37 | * GetReq - Get the next available X request packet in the buffer and | ||
38 | @@ -432,25 +444,10 @@ extern LockInfoPtr _Xglobal_lock; | ||
39 | |||
40 | #if !defined(UNIXCPP) || defined(ANSICPP) | ||
41 | #define GetReq(name, req) \ | ||
42 | - WORD64ALIGN\ | ||
43 | - if ((dpy->bufptr + SIZEOF(x##name##Req)) > dpy->bufmax)\ | ||
44 | - _XFlush(dpy);\ | ||
45 | - req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\ | ||
46 | - req->reqType = X_##name;\ | ||
47 | - req->length = (SIZEOF(x##name##Req))>>2;\ | ||
48 | - dpy->bufptr += SIZEOF(x##name##Req);\ | ||
49 | - dpy->request++ | ||
50 | - | ||
51 | + req = (x##name##Req *) _XGetRequest(dpy, X_##name, SIZEOF(x##name##Req)) | ||
52 | #else /* non-ANSI C uses empty comment instead of "##" for token concatenation */ | ||
53 | #define GetReq(name, req) \ | ||
54 | - WORD64ALIGN\ | ||
55 | - if ((dpy->bufptr + SIZEOF(x/**/name/**/Req)) > dpy->bufmax)\ | ||
56 | - _XFlush(dpy);\ | ||
57 | - req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ | ||
58 | - req->reqType = X_/**/name;\ | ||
59 | - req->length = (SIZEOF(x/**/name/**/Req))>>2;\ | ||
60 | - dpy->bufptr += SIZEOF(x/**/name/**/Req);\ | ||
61 | - dpy->request++ | ||
62 | + req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, SIZEOF(x/**/name/**/Req)) | ||
63 | #endif | ||
64 | |||
65 | /* GetReqExtra is the same as GetReq, but allocates "n" additional | ||
66 | @@ -458,24 +455,10 @@ extern LockInfoPtr _Xglobal_lock; | ||
67 | |||
68 | #if !defined(UNIXCPP) || defined(ANSICPP) | ||
69 | #define GetReqExtra(name, n, req) \ | ||
70 | - WORD64ALIGN\ | ||
71 | - if ((dpy->bufptr + SIZEOF(x##name##Req) + n) > dpy->bufmax)\ | ||
72 | - _XFlush(dpy);\ | ||
73 | - req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\ | ||
74 | - req->reqType = X_##name;\ | ||
75 | - req->length = (SIZEOF(x##name##Req) + n)>>2;\ | ||
76 | - dpy->bufptr += SIZEOF(x##name##Req) + n;\ | ||
77 | - dpy->request++ | ||
78 | + req = (x##name##Req *) _XGetRequest(dpy, X_##name, SIZEOF(x##name##Req) + n) | ||
79 | #else | ||
80 | #define GetReqExtra(name, n, req) \ | ||
81 | - WORD64ALIGN\ | ||
82 | - if ((dpy->bufptr + SIZEOF(x/**/name/**/Req) + n) > dpy->bufmax)\ | ||
83 | - _XFlush(dpy);\ | ||
84 | - req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ | ||
85 | - req->reqType = X_/**/name;\ | ||
86 | - req->length = (SIZEOF(x/**/name/**/Req) + n)>>2;\ | ||
87 | - dpy->bufptr += SIZEOF(x/**/name/**/Req) + n;\ | ||
88 | - dpy->request++ | ||
89 | + req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, SIZEOF(x/**/name/**/Req) + n) | ||
90 | #endif | ||
91 | |||
92 | |||
93 | diff --git a/src/XlibInt.c b/src/XlibInt.c | ||
94 | index 3db151e..a8f5d08 100644 | ||
95 | --- a/src/XlibInt.c | ||
96 | +++ b/src/XlibInt.c | ||
97 | @@ -1956,6 +1956,37 @@ Screen *_XScreenOfWindow(Display *dpy, Window w) | ||
98 | } | ||
99 | |||
100 | |||
101 | +/* | ||
102 | + * WARNING: This implementation's pre-conditions and post-conditions | ||
103 | + * must remain compatible with the old macro-based implementations of | ||
104 | + * GetReq, GetReqExtra, GetResReq, and GetEmptyReq. The portions of the | ||
105 | + * Display structure affected by those macros are part of libX11's | ||
106 | + * ABI. | ||
107 | + */ | ||
108 | +void *_XGetRequest(Display *dpy, CARD8 type, size_t len) | ||
109 | +{ | ||
110 | + xReq *req; | ||
111 | + | ||
112 | + WORD64ALIGN | ||
113 | + | ||
114 | + if (dpy->bufptr + len > dpy->bufmax) | ||
115 | + _XFlush(dpy); | ||
116 | + | ||
117 | + if (len % 4) | ||
118 | + fprintf(stderr, | ||
119 | + "Xlib: request %d length %zd not a multiple of 4.\n", | ||
120 | + type, len); | ||
121 | + | ||
122 | + dpy->last_req = dpy->bufptr; | ||
123 | + | ||
124 | + req = (xReq*)dpy->bufptr; | ||
125 | + req->reqType = type; | ||
126 | + req->length = len / 4; | ||
127 | + dpy->bufptr += len; | ||
128 | + dpy->request++; | ||
129 | + return req; | ||
130 | +} | ||
131 | + | ||
132 | #if defined(WIN32) | ||
133 | |||
134 | /* | ||
135 | -- | ||
136 | 1.7.8.3 | ||
137 | |||
diff --git a/meta/recipes-graphics/xorg-lib/libx11_1.4.4.bb b/meta/recipes-graphics/xorg-lib/libx11_1.4.4.bb index 823b3dcbea..ee1d919b22 100644 --- a/meta/recipes-graphics/xorg-lib/libx11_1.4.4.bb +++ b/meta/recipes-graphics/xorg-lib/libx11_1.4.4.bb | |||
@@ -1,6 +1,8 @@ | |||
1 | require libx11.inc | 1 | require libx11.inc |
2 | inherit gettext | 2 | inherit gettext |
3 | 3 | ||
4 | PR = "r1" | ||
5 | |||
4 | BBCLASSEXTEND = "native nativesdk" | 6 | BBCLASSEXTEND = "native nativesdk" |
5 | 7 | ||
6 | EXTRA_OECONF += "--with-keysymdefdir=${STAGING_INCDIR}/X11" | 8 | EXTRA_OECONF += "--with-keysymdefdir=${STAGING_INCDIR}/X11" |
@@ -12,6 +14,7 @@ DEPENDS += "util-macros xtrans libxdmcp libxau \ | |||
12 | 14 | ||
13 | SRC_URI += " file://keysymdef_include.patch \ | 15 | SRC_URI += " file://keysymdef_include.patch \ |
14 | file://x11_disable_makekeys.patch \ | 16 | file://x11_disable_makekeys.patch \ |
17 | file://0001-Add-_XGetRequest-as-substitute-for-GetReq-GetReqExtr.patch \ | ||
15 | " | 18 | " |
16 | 19 | ||
17 | SRC_URI[md5sum] = "ed7c382cbf8c13425b6a66bcac0ca5d9" | 20 | SRC_URI[md5sum] = "ed7c382cbf8c13425b6a66bcac0ca5d9" |