qemu-0.15: Drop GL passthrough support

These patches are a maintenance nightmare and impacting our abaility to
keep up to date with qemu. They are also a source of various bugs.

Remove them until someone is willing to step up and maintain them,
or upstream gains GL support.

(From OE-Core rev: e9a6df98458d9147227659d3888eff01589f2f76)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2012-08-20 11:20:12 +00:00
parent 91ece5d566
commit 0b0db813a5
12 changed files with 2 additions and 34969 deletions

View File

@ -1,31 +0,0 @@
Add a dummy option for GL acceleration to pass the configure when there is no
GL acceleration patch. The parsing function will be filled by following
opengl-disable-option.patch.
Upstream-Status: Inappropriate [other] - depends on GL patch
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Index: qemu-0.15.1/configure
===================================================================
--- qemu-0.15.1.orig/configure 2012-05-14 21:23:34.000000000 +0800
+++ qemu-0.15.1/configure 2012-05-14 21:23:36.000000000 +0800
@@ -179,6 +179,7 @@
smartcard_nss=""
usb_redir=""
opengl=""
+gl_accel="yes"
guest_agent="yes"
# parse CC options first
@@ -739,6 +740,10 @@
;;
--enable-opengl) opengl="yes"
;;
+ --disable-gl-accel) gl_accel="no"
+ ;;
+ --enable-gl-accel) gl_accel="yes"
+ ;;
--*dir)
;;
--disable-rbd) rbd="no"

View File

@ -1,127 +0,0 @@
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/Makefile.target
===================================================================
--- qemu-0.14.0.orig/Makefile.target
+++ qemu-0.14.0/Makefile.target
@@ -79,6 +79,12 @@ libobj-y += cpuid.o
endif
libobj-$(CONFIG_NEED_MMU) += mmu.o
libobj-$(TARGET_I386) += helper_opengl.o opengl_exec.o
+libobj-$(TARGET_X86_64) += helper_opengl.o opengl_exec.o
+libobj-$(TARGET_ARM) += dummygl.o
+libobj-$(TARGET_MIPS) += dummygl.o
+libobj-$(TARGET_MIPS64) += dummygl.o
+libobj-$(TARGET_PPC) += dummygl.o
+libobj-$(TARGET_SH4) += dummygl.o
libobj-$(TARGET_ARM) += neon_helper.o iwmmxt_helper.o
libobj-y += disas.o
Index: qemu-0.14.0/target-arm/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-arm/dummygl.c
@@ -0,0 +1,22 @@
+#include <string.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <stdint.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+void opengl_exec_set_parent_window(Display* _dpy, Window _parent_window)
+{
+
+}
+
+void opengl_process_enable(void)
+{
+
+}
+
+
+void mem_opengl(uint64_t ptr)
+{
+
+}
Index: qemu-0.14.0/target-mips/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-mips/dummygl.c
@@ -0,0 +1,22 @@
+#include <string.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <stdint.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+void opengl_exec_set_parent_window(Display* _dpy, Window _parent_window)
+{
+
+}
+
+void opengl_process_enable(void)
+{
+
+}
+
+
+void mem_opengl(uint64_t ptr)
+{
+
+}
Index: qemu-0.14.0/target-ppc/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-ppc/dummygl.c
@@ -0,0 +1,22 @@
+#include <string.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <stdint.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+void opengl_exec_set_parent_window(Display* _dpy, Window _parent_window)
+{
+
+}
+
+void opengl_process_enable(void)
+{
+
+}
+
+
+void mem_opengl(uint64_t ptr)
+{
+
+}
Index: qemu-0.14.0/target-sh4/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-sh4/dummygl.c
@@ -0,0 +1,22 @@
+#include <string.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <stdint.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+void opengl_exec_set_parent_window(Display* _dpy, Window _parent_window)
+{
+
+}
+
+void opengl_process_enable(void)
+{
+
+}
+
+
+void mem_opengl(uint64_t ptr)
+{
+
+}

View File

@ -1,33 +0,0 @@
Considering relocation, qemu-nativesdk is independent of host library except
libGL. Normal method like 'cat > $TMPC' doesn't work, so we check the library
directly.
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.15.1/configure
===================================================================
--- qemu-0.15.1.orig/configure 2012-05-25 18:26:05.000000000 +0800
+++ qemu-0.15.1/configure 2012-05-29 09:43:27.000000000 +0800
@@ -2032,15 +2032,13 @@
exit 1;
fi
- gl_accel_libs="-lGL -lGLU"
- cat > $TMPC << EOF
-#include <X11/Xlib.h>
-#include <GL/gl.h>
-#include <GL/glx.h>
-#include <GL/glu.h>
-int main(void) { GL_VERSION; return 0; }
-EOF
- if compile_prog "" "-lGL -lGLU" ; then
+ gl_accel_libs="-lGL"
+ libgl='no'
+ test -e /usr/lib/libGL.so && libgl='yes'
+ test -e /usr/lib64/libGL.so && libgl='yes'
+ test -e /usr/lib/*-linux-gnu/libGL.so && libgl='yes'
+
+ if test "$libgl" = "yes" ; then
gl_accel=yes
libs_softmmu="$gl_accel_libs $libs_softmmu"
else

View File

@ -1,66 +0,0 @@
This patch fix GL application failure from 64b target on 32b host
64b target produce 64b args buffer, but qemu parse it as 32b and get wrong
data. To avoid this, the type of args buffer in qemu should be same as target,
that is, target_phys_addr_t. The only potential issue is that we need copy
the data in buffer one by one, or else data corruption when 32b/64b for
target/host combination.
Upstream-Status: Inappropriate [other] - depends on qemu gl patch
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Index: qemu-0.15.1/target-i386/opengl_func.h
===================================================================
--- qemu-0.15.1.orig/target-i386/opengl_func.h 2012-04-06 10:00:08.000000000 +0800
+++ qemu-0.15.1/target-i386/opengl_func.h 2012-04-06 10:47:38.000000000 +0800
@@ -25,10 +25,10 @@
#include "mesa_gl.h"
#include "mesa_glext.h"
-/* Argument list are internally of a type that can hold a target pointer
- * or a host pointer. If 32b target runs on 64b host, it should be big enough
- * to hold host pointer */
-typedef long unsigned int arg_t;
+/* Argument list are internally of a type that point to a buffer passed from
+ * target. It should have same type as target, so that we can support 32b
+ * target on 64b host, and vice versa */
+typedef target_phys_addr_t arg_t;
enum {
TYPE_NONE,
Index: qemu-0.15.1/Makefile.target
===================================================================
--- qemu-0.15.1.orig/Makefile.target 2012-04-06 10:00:08.000000000 +0800
+++ qemu-0.15.1/Makefile.target 2012-04-06 10:00:08.000000000 +0800
@@ -128,7 +128,7 @@
gl_beginend.h: ../target-i386/beginend_funcs.sh
$< > $@
opengl_exec.o : opengl_exec.c server_stub.c gl_func.h opengl_func.h gl_beginend.h
- $(CC) $(GL_CFLAGS) $(DEFINES) -c -o $@ $< -I. -I../target-i386
+ $(CC) $(GL_CFLAGS) $(DEFINES) -c -o $@ $< -I.. -I. -I../fpu -I../target-i386 -DNEED_CPU_H
#########################################################
# Linux user emulator target
Index: qemu-0.15.1/target-i386/opengl_exec.c
===================================================================
--- qemu-0.15.1.orig/target-i386/opengl_exec.c 2012-04-06 10:00:08.000000000 +0800
+++ qemu-0.15.1/target-i386/opengl_exec.c 2012-04-06 10:39:22.000000000 +0800
@@ -37,16 +37,12 @@
#include <mesa_gl.h>
#include <mesa_glx.h>
-// TODO
-typedef long unsigned int target_phys_addr_t;
-
+#include "exec.h"
#include "opengl_func.h"
#include "mesa_glu.h"
#include "mesa_mipmap.c"
-#include "../qemu-common.h"
-
//#define SYSTEMATIC_ERROR_CHECK
#define BUFFER_BEGINEND
#define glGetError() 0

View File

@ -1,137 +0,0 @@
Add an option gl-accel to disable GL acceleration:
* When enabled, configure try best to enable GL acceleration and fail when
missing host dependency(libSDL and libGL), which is the default.
* When disabled, end user choose to turn off GL capability, thus remove the
host dependence in building.
Upstream-Status: Inappropriate [other] - depends on GL patch
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Index: qemu-0.15.1/Makefile.target
===================================================================
--- qemu-0.15.1.orig/Makefile.target 2012-05-29 11:20:04.000000000 +0800
+++ qemu-0.15.1/Makefile.target 2012-05-29 11:20:04.000000000 +0800
@@ -80,13 +80,16 @@
endif
libobj-$(CONFIG_NEED_MMU) += mmu.o
ifndef CONFIG_LINUX_USER
+ifdef CONFIG_GL_ACCEL
libobj-$(TARGET_I386) += helper_opengl.o opengl_exec.o
libobj-$(TARGET_X86_64) += helper_opengl.o opengl_exec.o
else
-ifdef CONFIG_SDL
libobj-$(TARGET_I386) += dummygl.o
libobj-$(TARGET_X86_64) += dummygl.o
-endif
+endif #CONFIG_GL_ACCEL
+else
+libobj-$(TARGET_I386) += dummygl.o
+libobj-$(TARGET_X86_64) += dummygl.o
endif #CONFIG_LINUX_USER
libobj-$(TARGET_ARM) += dummygl.o
libobj-$(TARGET_MIPS) += dummygl.o
@@ -262,8 +265,10 @@
obj-i386-$(CONFIG_SPICE) += qxl.o qxl-logger.o qxl-render.o
ifeq ($(TARGET_BASE_ARCH), i386)
+ifdef CONFIG_GL_ACCEL
QEMU_CFLAGS += -DTARGET_OPENGL_OK
endif
+endif
# shared objects
obj-ppc-y = ppc.o
@@ -409,8 +414,6 @@
monitor.o: hmp-commands.h qmp-commands.h
-LIBS += -lGL -lGLU
-
$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
obj-y += $(addprefix ../, $(common-obj-y))
Index: qemu-0.15.1/configure
===================================================================
--- qemu-0.15.1.orig/configure 2012-05-29 11:20:03.000000000 +0800
+++ qemu-0.15.1/configure 2012-05-29 11:20:04.000000000 +0800
@@ -2021,6 +2021,39 @@
fi
fi
+#####################################################
+# GL acceleration probe depending on gl, glu and sdl
+if test "$gl_accel" != "no" ; then
+ if test "$sdl" = "no" ; then
+ gl_accel=no
+ echo "libSDL and header no found to build opengl acceleration for qemu-native.
+ Ubuntu package names are: libsdl1.2-dev.
+ Fedora package names are: SDL-devel."
+ exit 1;
+ fi
+
+ gl_accel_libs="-lGL -lGLU"
+ cat > $TMPC << EOF
+#include <X11/Xlib.h>
+#include <GL/gl.h>
+#include <GL/glx.h>
+#include <GL/glu.h>
+int main(void) { GL_VERSION; return 0; }
+EOF
+ if compile_prog "" "-lGL -lGLU" ; then
+ gl_accel=yes
+ libs_softmmu="$gl_accel_libs $libs_softmmu"
+ else
+ feature_not_found "gl_accel"
+ gl_accel=no
+ gl_accel_libs=
+ echo "libGL.so and libGLU.so not found to build opengl acceleration for qemu-native.
+ Ubuntu package names are: libgl1-mesa-dev, libglu1-mesa-dev and libsdl1.2-dev.
+ Fedora package names are: mesa-libGL mesa-libGLU SDL-devel."
+ exit 1;
+ fi
+fi
+
#
# Check for xxxat() functions when we are building linux-user
# emulator. This is done because older glibc versions don't
@@ -2722,6 +2755,7 @@
echo "nss used $smartcard_nss"
echo "usb net redir $usb_redir"
echo "OpenGL support $opengl"
+echo "GL acceleration support $gl_accel"
echo "build guest agent $guest_agent"
if test $sdl_too_old = "yes"; then
@@ -3025,6 +3059,10 @@
echo "CONFIG_OPENGL=y" >> $config_host_mak
fi
+if test "$gl_accel" = "yes" ; then
+ echo "CONFIG_GL_ACCEL=y" >> $config_host_mak
+fi
+
# XXX: suppress that
if [ "$bsd" = "yes" ] ; then
echo "CONFIG_BSD=y" >> $config_host_mak
Index: qemu-0.15.1/qemu-char.c
===================================================================
--- qemu-0.15.1.orig/qemu-char.c 2012-05-29 11:20:03.000000000 +0800
+++ qemu-0.15.1/qemu-char.c 2012-05-29 11:20:04.000000000 +0800
@@ -2387,7 +2387,6 @@
return d->outbuf_size;
}
-#define TARGET_OPENGL_OK
#if defined(TARGET_OPENGL_OK)
static uint8_t buffer[32];
static int buffer_len;
@@ -2447,7 +2446,7 @@
return chr;
}
#else
-#define qemu_chr_open_opengl() 0
+#define qemu_chr_open_opengl NULL
#endif
QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename)

View File

@ -1,43 +0,0 @@
Upstream-Status: Inappropriate [configuration]
diff -u -r qemu-0.14.0/Makefile.target qemu-0.14.0-fixed/Makefile.target
--- qemu-0.14.0/Makefile.target 2011-04-26 21:22:17.627637741 -0700
+++ qemu-0.14.0-fixed/Makefile.target 2011-04-26 21:23:02.767637747 -0700
@@ -82,8 +82,10 @@
libobj-$(TARGET_I386) += helper_opengl.o opengl_exec.o
libobj-$(TARGET_X86_64) += helper_opengl.o opengl_exec.o
else
+ifdef CONFIG_SDL
libobj-$(TARGET_I386) += dummygl.o
libobj-$(TARGET_X86_64) += dummygl.o
+endif
endif #CONFIG_LINUX_USER
libobj-$(TARGET_ARM) += dummygl.o
libobj-$(TARGET_MIPS) += dummygl.o
Only in qemu-0.14.0-fixed: config.log
diff -u -r qemu-0.14.0/target-i386/helper.h qemu-0.14.0-fixed/target-i386/helper.h
--- qemu-0.14.0/target-i386/helper.h 2011-04-26 21:22:11.418637742 -0700
+++ qemu-0.14.0-fixed/target-i386/helper.h 2011-04-26 21:23:02.539637747 -0700
@@ -217,6 +217,9 @@
DEF_HELPER_2(rcrq, tl, tl, tl)
#endif
+#ifdef CONFIG_SDL
DEF_HELPER_0(opengl, void)
+#endif
+
#include "def-helper.h"
diff -u -r qemu-0.14.0/target-i386/translate.c qemu-0.14.0-fixed/target-i386/translate.c
--- qemu-0.14.0/target-i386/translate.c 2011-04-26 21:22:21.600637743 -0700
+++ qemu-0.14.0-fixed/target-i386/translate.c 2011-04-26 21:23:02.538637747 -0700
@@ -2659,7 +2659,7 @@
static void gen_interrupt(DisasContext *s, int intno,
target_ulong cur_eip, target_ulong next_eip)
{
-#if !defined(CONFIG_USER_ONLY)
+#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_SDL)
if (enable_gl && intno == 0x99) {
gen_helper_opengl();
return;

View File

@ -1,65 +0,0 @@
Allow releasing the GLXContext/Drawable with glXMakeCurrent.
---
commit d942ed4e853e08d2298f3e11e9a952c1d952bff5
tree f0a934efd8a8ff48e2d96f0d6fc7d70bef106bfe
parent 93619e6be184f8de08759d347825ee0d678a6f9c
author Andrzej Zaborowski <andrew.zaborowski@intel.com> Tue, 16 Jun 2009 22:22:05 +0200
committer Andrzej Zaborowski <andrew.zaborowski@intel.com> Tue, 16 Jun 2009 22:22:05 +0200
target-i386/opengl_exec.c | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/target-i386/opengl_exec.c
===================================================================
--- qemu-0.14.0.orig/target-i386/opengl_exec.c
+++ qemu-0.14.0/target-i386/opengl_exec.c
@@ -1600,10 +1600,9 @@ int do_function_call(int func_number, ar
fprintf(stderr, "client_drawable=%p fake_ctx=%d\n",
(void *) client_drawable, fake_ctxt);
- if (client_drawable == 0 && fake_ctxt == 0) {
+ if (client_drawable == 0 && fake_ctxt == 0)
ret_int = glXMakeCurrent(dpy, 0, NULL);
- process->current_state = &process->default_state;
- } else if ((drawable = (GLXDrawable)
+ else if ((drawable = (GLXDrawable)
get_association_fakepbuffer_pbuffer(
process, client_drawable))) {
GLXContext ctxt = get_association_fakecontext_glxcontext(
@@ -1651,19 +1650,21 @@ int do_function_call(int func_number, ar
}
if (ret_int) {
- for (i = 0; i < process->nb_states; i ++) {
- if (process->glstates[i]->fake_ctxt == fake_ctxt) {
- /* HACK !!! REMOVE */
- process->current_state = process->glstates[i];
- process->current_state->drawable = drawable;
- break;
- }
- }
+ if (fake_ctxt) {
+ for (i = 0; i < process->nb_states; i ++)
+ if (process->glstates[i]->fake_ctxt == fake_ctxt) {
+ /* HACK !!! REMOVE */
+ process->current_state = process->glstates[i];
+ process->current_state->drawable = drawable;
+ break;
+ }
- if (i == process->nb_states) {
- fprintf(stderr, "error remembering the new context\n");
- exit(-1);
- }
+ if (i == process->nb_states) {
+ fprintf(stderr, "error remembering the new context\n");
+ exit(-1);
+ }
+ } else
+ process->current_state = &process->default_state;
}
break;
}

View File

@ -1,74 +0,0 @@
This patch fix GL application start failure on qemu 0.14.0.
Some turn-on macro/variable are re-arranged, buffer pointer is extended to
support 32/64b combination of target/host.
This is not perfect fix, and we need consider other GL alternatives in future.
Upstream-Status: Inappropriate [other] - depends on qemu gl patch
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Index: qemu-0.14.0/target-i386/opengl_func.h
===================================================================
--- qemu-0.14.0.orig/target-i386/opengl_func.h 2011-04-08 16:43:46.000000000 +0800
+++ qemu-0.14.0/target-i386/opengl_func.h 2011-04-08 16:45:55.000000000 +0800
@@ -26,8 +26,9 @@
#include "mesa_glext.h"
/* Argument list are internally of a type that can hold a target pointer
- * or a host pointer. */
-typedef target_phys_addr_t arg_t;
+ * or a host pointer. If 32b target runs on 64b host, it should be big enough
+ * to hold host pointer */
+typedef long unsigned int arg_t;
enum {
TYPE_NONE,
Index: qemu-0.14.0/target-i386/translate.c
===================================================================
--- qemu-0.14.0.orig/target-i386/translate.c 2011-04-08 16:19:15.000000000 +0800
+++ qemu-0.14.0/target-i386/translate.c 2011-04-08 16:22:03.000000000 +0800
@@ -2652,17 +2652,19 @@
s->is_jmp = DISAS_TB_JUMP;
}
-int enable_gl = 0;
+extern int enable_gl;
/* an interrupt is different from an exception because of the
privilege checks */
static void gen_interrupt(DisasContext *s, int intno,
target_ulong cur_eip, target_ulong next_eip)
{
+#if !defined(CONFIG_USER_ONLY)
if (enable_gl && intno == 0x99) {
gen_helper_opengl();
return;
}
+#endif
if (s->cc_op != CC_OP_DYNAMIC)
gen_op_set_cc_op(s->cc_op);
Index: qemu-0.14.0/vl.c
===================================================================
--- qemu-0.14.0.orig/vl.c 2011-04-08 16:11:43.000000000 +0800
+++ qemu-0.14.0/vl.c 2011-04-08 16:20:05.000000000 +0800
@@ -229,7 +229,7 @@
unsigned int nb_prom_envs = 0;
const char *prom_envs[MAX_PROM_ENVS];
int boot_menu;
-extern int enable_gl;
+int enable_gl = 0;
typedef struct FWBootEntry FWBootEntry;
@@ -1909,6 +1909,7 @@
return popt;
}
+#define TARGET_OPENGL_OK
int main(int argc, char **argv, char **envp)
{
const char *gdbstub_dev = NULL;

View File

@ -38,12 +38,10 @@ do_install () {
install -m 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu
}
PACKAGECONFIG ??= "gl"
PACKAGECONFIG[gl] = "--enable-gl-accel,--disable-gl-accel,,"
PACKAGECONFIG ??= ""
DEPENDS_virtclass-native = "zlib-native alsa-lib-native glib-2.0-native"
DEPENDS_virtclass-nativesdk = "zlib-nativesdk libsdl-nativesdk glib-2.0-nativesdk \
${@base_contains('DISTRO_FEATURES', 'x11', 'qemugl-nativesdk', '', d)}"
DEPENDS_virtclass-nativesdk = "zlib-nativesdk libsdl-nativesdk glib-2.0-nativesdk"
RDEPENDS_virtclass-nativesdk = "libsdl-nativesdk"
EXTRA_OECONF_virtclass-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror --disable-vnc-tls \
--disable-curl \

View File

@ -19,32 +19,11 @@ SRC_URI = "\
file://larger_default_ram_size.patch \
file://arm-bgr.patch \
file://a4d1f142542935b90d2eb30f3aead4edcf455fe6.patch \
file://dummy-gl-config.patch \
file://0001-ppc64-Fix-linker-script.patch \
file://ppc-s500-set-invalid-mask.patch \
file://hw-pl031-Actually-raise-interrupt-on-timer-expiry.patch \
"
# Only use the GL passthrough patches for native/nativesdk versions
QEMUGLPATCHES = "\
file://qemu-git-qemugl-host.patch \
file://fix-nogl.patch \
file://qemugl-allow-glxcontext-release.patch \
file://init-info.patch \
file://enable-i386-linux-user.patch \
file://qemugl-fix.patch \
file://opengl-sdl-fix.patch \
file://opengl-args-copy-fix.patch \
file://opengl-disable-option.patch \
"
SRC_URI_append_virtclass-native = "\
${QEMUGLPATCHES} \
"
SRC_URI_append_virtclass-nativesdk = "\
${@base_contains('DISTRO_FEATURES', 'x11', '${QEMUGLPATCHES} file://glflags.patch', '', d)} \
"
SRC_URI[md5sum] = "34f17737baaf1b3495c89cd6d4a607ed"
SRC_URI[sha256sum] = "7705b14d9b8e4df4a0b1790980e618084261e8daef0672a1aa7a830a0f3db5ba"