Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] Fix gl failure when 64b target on 32b host, Edwin, Apr6, 2012
@ 2012-04-06  8:04 edwin.zhai
  2012-04-06  8:04 ` [PATCH 1/1] qemu: Fix gl failure from 64b target on 32b host edwin.zhai
  2012-04-10 15:27 ` [PATCH 0/1] Fix gl failure when 64b target on 32b host, Edwin, Apr6, 2012 Saul Wold
  0 siblings, 2 replies; 4+ messages in thread
From: edwin.zhai @ 2012-04-06  8:04 UTC (permalink / raw)
  To: openembedded-core

From: Zhai Edwin <edwin.zhai@intel.com>

All,
This patch fix gl failure when 64b target on 32b host. Pls. help to review.
Thanks,
Edwin

The following changes since commit 190f6d791d51aaa4cfb9f1cf932bc205ff674fb5:

  runqemu-internal: Add console=tty for qemuppc and NFS (2012-04-06 01:12:47 +0100)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib gzhai/fix2
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=gzhai/fix2

Zhai Edwin (1):
  qemu: Fix gl failure from 64b target on 32b host

 .../qemu/qemu-0.15.1/opengl-args-copy-fix.patch    |   66 ++++++++++++++++++++
 meta/recipes-devtools/qemu/qemu_0.15.1.bb          |    1 +
 2 files changed, 67 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-devtools/qemu/qemu-0.15.1/opengl-args-copy-fix.patch

-- 
1.7.5.4




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] qemu: Fix gl failure from 64b target on 32b host
  2012-04-06  8:04 [PATCH 0/1] Fix gl failure when 64b target on 32b host, Edwin, Apr6, 2012 edwin.zhai
@ 2012-04-06  8:04 ` edwin.zhai
  2012-04-07 20:13   ` Saul Wold
  2012-04-10 15:27 ` [PATCH 0/1] Fix gl failure when 64b target on 32b host, Edwin, Apr6, 2012 Saul Wold
  1 sibling, 1 reply; 4+ messages in thread
From: edwin.zhai @ 2012-04-06  8:04 UTC (permalink / raw)
  To: openembedded-core

From: Zhai Edwin <edwin.zhai@intel.com>

Data from 64b target is truncated by 32b host. This patch makes type of data
buf in host same as target.

[YOCTO #2221] got fixed.

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
---
 .../qemu/qemu-0.15.1/opengl-args-copy-fix.patch    |   66 ++++++++++++++++++++
 meta/recipes-devtools/qemu/qemu_0.15.1.bb          |    1 +
 2 files changed, 67 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-devtools/qemu/qemu-0.15.1/opengl-args-copy-fix.patch

diff --git a/meta/recipes-devtools/qemu/qemu-0.15.1/opengl-args-copy-fix.patch b/meta/recipes-devtools/qemu/qemu-0.15.1/opengl-args-copy-fix.patch
new file mode 100644
index 0000000..ddf4e4a
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu-0.15.1/opengl-args-copy-fix.patch
@@ -0,0 +1,66 @@
+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
diff --git a/meta/recipes-devtools/qemu/qemu_0.15.1.bb b/meta/recipes-devtools/qemu/qemu_0.15.1.bb
index 3a4ef32..d01e79d 100644
--- a/meta/recipes-devtools/qemu/qemu_0.15.1.bb
+++ b/meta/recipes-devtools/qemu/qemu_0.15.1.bb
@@ -29,6 +29,7 @@ QEMUGLPATCHES = "\
     file://enable-i386-linux-user.patch \
     file://qemugl-fix.patch \
     file://opengl-sdl-fix.patch \
+    file://opengl-args-copy-fix.patch \
     "
 
 SRC_URI_append_virtclass-native = "\
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] qemu: Fix gl failure from 64b target on 32b host
  2012-04-06  8:04 ` [PATCH 1/1] qemu: Fix gl failure from 64b target on 32b host edwin.zhai
@ 2012-04-07 20:13   ` Saul Wold
  0 siblings, 0 replies; 4+ messages in thread
From: Saul Wold @ 2012-04-07 20:13 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 04/06/2012 01:04 AM, edwin.zhai@intel.com wrote:
> From: Zhai Edwin<edwin.zhai@intel.com>
>
> Data from 64b target is truncated by 32b host. This patch makes type of data
> buf in host same as target.
>
> [YOCTO #2221] got fixed.
>
> Signed-off-by: Zhai Edwin<edwin.zhai@intel.com>
> ---
>   .../qemu/qemu-0.15.1/opengl-args-copy-fix.patch    |   66 ++++++++++++++++++++
>   meta/recipes-devtools/qemu/qemu_0.15.1.bb          |    1 +
>   2 files changed, 67 insertions(+), 0 deletions(-)
>   create mode 100644 meta/recipes-devtools/qemu/qemu-0.15.1/opengl-args-copy-fix.patch
>
> diff --git a/meta/recipes-devtools/qemu/qemu-0.15.1/opengl-args-copy-fix.patch b/meta/recipes-devtools/qemu/qemu-0.15.1/opengl-args-copy-fix.patch
> new file mode 100644
> index 0000000..ddf4e4a
> --- /dev/null
> +++ b/meta/recipes-devtools/qemu/qemu-0.15.1/opengl-args-copy-fix.patch
> @@ -0,0 +1,66 @@
> +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
> diff --git a/meta/recipes-devtools/qemu/qemu_0.15.1.bb b/meta/recipes-devtools/qemu/qemu_0.15.1.bb
> index 3a4ef32..d01e79d 100644
> --- a/meta/recipes-devtools/qemu/qemu_0.15.1.bb
> +++ b/meta/recipes-devtools/qemu/qemu_0.15.1.bb
> @@ -29,6 +29,7 @@ QEMUGLPATCHES = "\
>       file://enable-i386-linux-user.patch \
>       file://qemugl-fix.patch \
>       file://opengl-sdl-fix.patch \
> +    file://opengl-args-copy-fix.patch \
>       "
>
>   SRC_URI_append_virtclass-native = "\

Needs a PR bump, which I added for testing.

Sau!



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/1] Fix gl failure when 64b target on 32b host, Edwin, Apr6, 2012
  2012-04-06  8:04 [PATCH 0/1] Fix gl failure when 64b target on 32b host, Edwin, Apr6, 2012 edwin.zhai
  2012-04-06  8:04 ` [PATCH 1/1] qemu: Fix gl failure from 64b target on 32b host edwin.zhai
@ 2012-04-10 15:27 ` Saul Wold
  1 sibling, 0 replies; 4+ messages in thread
From: Saul Wold @ 2012-04-10 15:27 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 04/06/2012 01:04 AM, edwin.zhai@intel.com wrote:
> From: Zhai Edwin<edwin.zhai@intel.com>
>
> All,
> This patch fix gl failure when 64b target on 32b host. Pls. help to review.
> Thanks,
> Edwin
>
> The following changes since commit 190f6d791d51aaa4cfb9f1cf932bc205ff674fb5:
>
>    runqemu-internal: Add console=tty for qemuppc and NFS (2012-04-06 01:12:47 +0100)
>
> are available in the git repository at:
>    git://git.pokylinux.org/poky-contrib gzhai/fix2
>    http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=gzhai/fix2
>
> Zhai Edwin (1):
>    qemu: Fix gl failure from 64b target on 32b host
>
>   .../qemu/qemu-0.15.1/opengl-args-copy-fix.patch    |   66 ++++++++++++++++++++
>   meta/recipes-devtools/qemu/qemu_0.15.1.bb          |    1 +
>   2 files changed, 67 insertions(+), 0 deletions(-)
>   create mode 100644 meta/recipes-devtools/qemu/qemu-0.15.1/opengl-args-copy-fix.patch
>


Merged into OE-Core

Thanks
	Sau!



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-04-10 15:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-06  8:04 [PATCH 0/1] Fix gl failure when 64b target on 32b host, Edwin, Apr6, 2012 edwin.zhai
2012-04-06  8:04 ` [PATCH 1/1] qemu: Fix gl failure from 64b target on 32b host edwin.zhai
2012-04-07 20:13   ` Saul Wold
2012-04-10 15:27 ` [PATCH 0/1] Fix gl failure when 64b target on 32b host, Edwin, Apr6, 2012 Saul Wold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox