summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/mesa/qemugl
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics/mesa/qemugl')
-rw-r--r--meta/recipes-graphics/mesa/qemugl/call_opengl_fix.patch94
-rw-r--r--meta/recipes-graphics/mesa/qemugl/extensions_emulation.patch34
-rw-r--r--meta/recipes-graphics/mesa/qemugl/remove-x11r6-lib-dir.patch21
-rw-r--r--meta/recipes-graphics/mesa/qemugl/versionfix.patch32
4 files changed, 0 insertions, 181 deletions
diff --git a/meta/recipes-graphics/mesa/qemugl/call_opengl_fix.patch b/meta/recipes-graphics/mesa/qemugl/call_opengl_fix.patch
deleted file mode 100644
index 342f49b717..0000000000
--- a/meta/recipes-graphics/mesa/qemugl/call_opengl_fix.patch
+++ /dev/null
@@ -1,94 +0,0 @@
1Save registers via local variables instead of simple "push", so that gcc become
2aware of this operation and avoid stack disorder.
3
4opengl calling (in call_opengl_qemu) includes 4 steps:
51. prepare opengl parameters on stack
62. save some "input" register by push
73. load "input" register with parameters on stack via same index as step 1
84. issue "int 0x99" to trap into qemu, who will get parameter in the registers
9
10New gcc uses "%esp" rather than "%ebp" to index local variable in stack, which
11leads wrong index in step 3, as push decrease "%esp" automatically. Saving
12registers via local variables to fix it.
13
14Upstream-Status: Pending
15
16Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
17Index: git/opengl_client.c
18===================================================================
19--- git.orig/opengl_client.c 2012-02-28 15:26:28.000000000 +0800
20+++ git/opengl_client.c 2012-02-28 15:29:18.000000000 +0800
21@@ -1076,23 +1076,29 @@
22 {
23 #if defined(__i386__)
24 int ret;
25+ int bx, cx, dx, si;
26 #ifdef WIN32
27 __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (win32_sigsegv_handler));
28 #endif
29- __asm__ ("push %ebx");
30- __asm__ ("push %ecx");
31- __asm__ ("push %edx");
32- __asm__ ("push %esi");
33+ /* save registers before opengl call */
34+ __asm__ ("mov %%ebx, %0"::"m"(bx));
35+ __asm__ ("mov %%ecx, %0"::"m"(cx));
36+ __asm__ ("mov %%edx, %0"::"m"(dx));
37+ __asm__ ("mov %%esi, %0"::"m"(si));
38+
39 __asm__ ("mov %0, %%eax"::"m"(func_number));
40 __asm__ ("mov %0, %%ebx"::"m"(pid));
41 __asm__ ("mov %0, %%ecx"::"m"(ret_string));
42 __asm__ ("mov %0, %%edx"::"m"(args));
43 __asm__ ("mov %0, %%esi"::"m"(args_size));
44 __asm__ ("int $0x99");
45- __asm__ ("pop %esi");
46- __asm__ ("pop %edx");
47- __asm__ ("pop %ecx");
48- __asm__ ("pop %ebx");
49+
50+ /* restore registers */
51+ __asm__ ("mov %0, %%ebx"::"m"(bx));
52+ __asm__ ("mov %0, %%ecx"::"m"(cx));
53+ __asm__ ("mov %0, %%edx"::"m"(dx));
54+ __asm__ ("mov %0, %%esi"::"m"(si));
55+
56 __asm__ ("mov %%eax, %0"::"m"(ret));
57 #ifdef WIN32
58 __asm__ ("movl (%%esp),%%ecx;movl %%ecx,%%fs:0;addl $8,%%esp;" : : : "%ecx");
59@@ -1100,20 +1106,27 @@
60 return ret;
61 #elif defined(__x86_64__)
62 int ret;
63- __asm__ ("push %rbx");
64- __asm__ ("push %rcx");
65- __asm__ ("push %rdx");
66- __asm__ ("push %rsi");
67+ long bx, cx, dx, si;
68+
69+ /* save registers before opengl call */
70+ __asm__ ("mov %%rbx, %0"::"m"(bx));
71+ __asm__ ("mov %%rcx, %0"::"m"(cx));
72+ __asm__ ("mov %%rdx, %0"::"m"(dx));
73+ __asm__ ("mov %%rsi, %0"::"m"(si));
74+
75 __asm__ ("mov %0, %%eax"::"m"(func_number));
76 __asm__ ("mov %0, %%ebx"::"m"(pid));
77 __asm__ ("mov %0, %%rcx"::"m"(ret_string));
78 __asm__ ("mov %0, %%rdx"::"m"(args));
79 __asm__ ("mov %0, %%rsi"::"m"(args_size));
80 __asm__ ("int $0x99");
81- __asm__ ("pop %rsi");
82- __asm__ ("pop %rdx");
83- __asm__ ("pop %rcx");
84- __asm__ ("pop %rbx");
85+
86+ /* restore registers */
87+ __asm__ ("mov %0, %%rbx"::"m"(bx));
88+ __asm__ ("mov %0, %%rcx"::"m"(cx));
89+ __asm__ ("mov %0, %%rdx"::"m"(dx));
90+ __asm__ ("mov %0, %%rsi"::"m"(si));
91+
92 __asm__ ("mov %%eax, %0"::"m"(ret));
93 return ret;
94 #else
diff --git a/meta/recipes-graphics/mesa/qemugl/extensions_emulation.patch b/meta/recipes-graphics/mesa/qemugl/extensions_emulation.patch
deleted file mode 100644
index 08418c2f4b..0000000000
--- a/meta/recipes-graphics/mesa/qemugl/extensions_emulation.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1Hide some GLX extensions by default to avoid guest call missing GLX API. It's
2hacky to implement these APIs, so hide these extensions as fix.
3
4Upstream-Status: Pending
5
6Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
7
8Index: git/opengl_client.c
9===================================================================
10--- git.orig/opengl_client.c 2012-03-16 18:22:27.000000000 +0800
11+++ git/opengl_client.c 2012-03-16 18:52:06.000000000 +0800
12@@ -105,6 +105,12 @@
13 "NO_MOVE", /* default : set if TCP/IP communication */
14 };
15
16+/* Hiding some GLX extensions from guest */
17+static const char* hiding_extensions =
18+ "GLX_MESA_copy_sub_buffer,\
19+ GLX_MESA_multithread_makecurrent,\
20+ GLX_MESA_swap_control,\
21+ ";
22
23 #ifdef WIN32
24
25@@ -3516,7 +3522,8 @@
26 static void removeUnwantedExtensions(char* ret)
27 {
28 char* toBeRemoved = getenv("GL_REMOVE_EXTENSIONS");
29- if (toBeRemoved == NULL) return;
30+ if (toBeRemoved == NULL)
31+ toBeRemoved = hiding_extensions;
32 toBeRemoved = strdup(toBeRemoved);
33 char* iterToBeRemoved = toBeRemoved;
34 while(*iterToBeRemoved)
diff --git a/meta/recipes-graphics/mesa/qemugl/remove-x11r6-lib-dir.patch b/meta/recipes-graphics/mesa/qemugl/remove-x11r6-lib-dir.patch
deleted file mode 100644
index d24d0455d9..0000000000
--- a/meta/recipes-graphics/mesa/qemugl/remove-x11r6-lib-dir.patch
+++ /dev/null
@@ -1,21 +0,0 @@
1Remove X11R6 lib directory
2
3"-L/usr/X11R6/lib" is obsolate in poky. Poky currently use Xserver from X.org (X11R7.x), which puts lib in standard /usr/lib, so no need to specify the extra -L/usr/X11R6/lib. Meanwhile, the -L/usr/X11R6/lib will cause warning: library search path "/usr/X11R6/lib" is unsafe for cross-compilation. so better to remove it.
4
5Upstream-Status: Pending
6
7Signed-off-by: Yu Ke <ke.yu@intel.com>
8
9diff --git a/Makefile b/Makefile
10index 9e5a8ea..f3a082a 100644
11--- a/Makefile
12+++ b/Makefile
13@@ -3,7 +3,7 @@ GL_CFLAGS := -Wall -g -O2 -fno-strict-aliasing
14 all: libGL.so.1.2
15
16 libGL.so.1.2: client_stub.c opengl_client.c glgetv_cst.h opengl_func.h opengl_utils.h opengl_client_xfonts.c mesa_gl.h mesa_glext.h mesa_glx.h mesa_glxext.h
17- $(CC) -fPIC $(GL_CFLAGS) opengl_client.c -shared -o libGL.so.1.2 -lX11 -lXfixes -lm -L$(D)/usr/X11R6/lib -lpthread -I.
18+ $(CC) -fPIC $(GL_CFLAGS) opengl_client.c -shared -o libGL.so.1.2 -lX11 -lXfixes -lm -lpthread -I.
19
20 opengl_func.h: gl_func.h
21
diff --git a/meta/recipes-graphics/mesa/qemugl/versionfix.patch b/meta/recipes-graphics/mesa/qemugl/versionfix.patch
deleted file mode 100644
index 614b816d14..0000000000
--- a/meta/recipes-graphics/mesa/qemugl/versionfix.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1Upstream-Status: Pending
2
3Index: git/Makefile
4===================================================================
5--- git.orig/Makefile 2009-01-19 23:37:36.000000000 +0000
6+++ git/Makefile 2009-06-09 20:30:37.000000000 +0100
7@@ -1,9 +1,9 @@
8 GL_CFLAGS := -Wall -g -O2 -fno-strict-aliasing
9
10-all: libGL.so
11+all: libGL.so.1.2
12
13-libGL.so: client_stub.c opengl_client.c glgetv_cst.h opengl_func.h opengl_utils.h opengl_client_xfonts.c mesa_gl.h mesa_glext.h mesa_glx.h mesa_glxext.h
14- $(CC) -fPIC $(GL_CFLAGS) opengl_client.c -shared -o libGL.so -lX11 -lXfixes -lm -L$(D)/usr/X11R6/lib -lpthread -I.
15+libGL.so.1.2: client_stub.c opengl_client.c glgetv_cst.h opengl_func.h opengl_utils.h opengl_client_xfonts.c mesa_gl.h mesa_glext.h mesa_glx.h mesa_glxext.h
16+ $(CC) -fPIC $(GL_CFLAGS) opengl_client.c -shared -o libGL.so.1.2 -lX11 -lXfixes -lm -L$(D)/usr/X11R6/lib -lpthread -I.
17
18 opengl_func.h: gl_func.h
19
20Index: git/opengl_client.c
21===================================================================
22--- git.orig/opengl_client.c 2009-06-09 21:07:15.000000000 +0100
23+++ git/opengl_client.c 2009-06-09 21:07:33.000000000 +0100
24@@ -11578,7 +11578,7 @@
25 tab_assoc = calloc(tabSize, sizeof(AssocProcAdress));
26
27 #ifndef WIN32
28- handle = dlopen(getenv("REAL_LIBGL") ? getenv("REAL_LIBGL") : "libGL.so" ,RTLD_LAZY);
29+ handle = dlopen(getenv("REAL_LIBGL") ? getenv("REAL_LIBGL") : "libGL.so.1.2" ,RTLD_LAZY);
30 if (!handle) {
31 log_gl("%s\n", dlerror());
32 exit(1);