Revert "yagl: fix the display broken issue"
authorVasiliy Ulyanov <v.ulyanov@samsung.com>
Wed, 24 Aug 2016 12:12:32 +0000 (15:12 +0300)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 6 Sep 2016 02:26:29 +0000 (11:26 +0900)
This reverts commit fcc44797b6faa635424e142a10870370948ee57d.

Currently tizen 2.4 platform does not include the patches needed for 64
bit addresses support in yagl package. Until it is fixed, there is a
need to handle two host/target communication protocol versions at qemu
side. In order to avoid modification of autogenerated files, the
function yagl_transport_get_out_uintptr_t now takes care of different
pointer sizes.

In general, this patch does not completely fix the compatibility problem
with various platfrom versions. I.e. if more API calls are added, there
is a need to make sure they are appended at the end of the funcs array
and the existing calls preserve their ID numbers. Otherwise backward
compatibility will be broken.

Change-Id: I9bb3c118d44f46d72c87d90c08aa34b85d4ab008
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
hw/yagl/yagl_apis/gles/yagl_gles_calls.c
hw/yagl/yagl_transport.c
hw/yagl/yagl_transport.h

index 421f272..97dcff6 100644 (file)
@@ -117,7 +117,7 @@ static void yagl_func_glReadPixelsOffset(struct yagl_transport *t)
     height = yagl_transport_get_out_GLsizei(t);
     format = yagl_transport_get_out_GLenum(t);
     type = yagl_transport_get_out_GLenum(t);
-    pixels = yagl_transport_get_out_uint64_t(t);
+    pixels = yagl_transport_get_out_uintptr_t(t);
     YAGL_LOG_FUNC_ENTER_SPLIT7(glReadPixelsOffset, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, uintptr_t, x, y, width, height, format, type, pixels);
     (void)yagl_host_glReadPixelsOffset(x, y, width, height, format, type, pixels);
     YAGL_LOG_FUNC_EXIT(NULL);
@@ -275,7 +275,7 @@ static void yagl_func_glVertexAttribPointerOffset(struct yagl_transport *t)
     type = yagl_transport_get_out_GLenum(t);
     normalized = yagl_transport_get_out_GLboolean(t);
     stride = yagl_transport_get_out_GLsizei(t);
-    offset = yagl_transport_get_out_uint64_t(t);
+    offset = yagl_transport_get_out_uintptr_t(t);
     YAGL_LOG_FUNC_ENTER_SPLIT6(glVertexAttribPointerOffset, GLuint, GLint, GLenum, GLboolean, GLsizei, uintptr_t, indx, size, type, normalized, stride, offset);
     (void)yagl_host_glVertexAttribPointerOffset(indx, size, type, normalized, stride, offset);
     YAGL_LOG_FUNC_EXIT(NULL);
@@ -314,7 +314,7 @@ static void yagl_func_glVertexPointerOffset(struct yagl_transport *t)
     size = yagl_transport_get_out_GLint(t);
     type = yagl_transport_get_out_GLenum(t);
     stride = yagl_transport_get_out_GLsizei(t);
-    offset = yagl_transport_get_out_uint64_t(t);
+    offset = yagl_transport_get_out_uintptr_t(t);
     YAGL_LOG_FUNC_ENTER_SPLIT4(glVertexPointerOffset, GLint, GLenum, GLsizei, uintptr_t, size, type, stride, offset);
     (void)yagl_host_glVertexPointerOffset(size, type, stride, offset);
     YAGL_LOG_FUNC_EXIT(NULL);
@@ -349,7 +349,7 @@ static void yagl_func_glNormalPointerOffset(struct yagl_transport *t)
     uintptr_t offset;
     type = yagl_transport_get_out_GLenum(t);
     stride = yagl_transport_get_out_GLsizei(t);
-    offset = yagl_transport_get_out_uint64_t(t);
+    offset = yagl_transport_get_out_uintptr_t(t);
     YAGL_LOG_FUNC_ENTER_SPLIT3(glNormalPointerOffset, GLenum, GLsizei, uintptr_t, type, stride, offset);
     (void)yagl_host_glNormalPointerOffset(type, stride, offset);
     YAGL_LOG_FUNC_EXIT(NULL);
@@ -388,7 +388,7 @@ static void yagl_func_glColorPointerOffset(struct yagl_transport *t)
     size = yagl_transport_get_out_GLint(t);
     type = yagl_transport_get_out_GLenum(t);
     stride = yagl_transport_get_out_GLsizei(t);
-    offset = yagl_transport_get_out_uint64_t(t);
+    offset = yagl_transport_get_out_uintptr_t(t);
     YAGL_LOG_FUNC_ENTER_SPLIT4(glColorPointerOffset, GLint, GLenum, GLsizei, uintptr_t, size, type, stride, offset);
     (void)yagl_host_glColorPointerOffset(size, type, stride, offset);
     YAGL_LOG_FUNC_EXIT(NULL);
@@ -429,7 +429,7 @@ static void yagl_func_glTexCoordPointerOffset(struct yagl_transport *t)
     size = yagl_transport_get_out_GLint(t);
     type = yagl_transport_get_out_GLenum(t);
     stride = yagl_transport_get_out_GLsizei(t);
-    offset = yagl_transport_get_out_uint64_t(t);
+    offset = yagl_transport_get_out_uintptr_t(t);
     YAGL_LOG_FUNC_ENTER_SPLIT4(glTexCoordPointerOffset, GLint, GLenum, GLsizei, uintptr_t, size, type, stride, offset);
     (void)yagl_host_glTexCoordPointerOffset(size, type, stride, offset);
     YAGL_LOG_FUNC_EXIT(NULL);
@@ -510,7 +510,7 @@ static void yagl_func_glVertexAttribIPointerOffset(struct yagl_transport *t)
     size = yagl_transport_get_out_GLint(t);
     type = yagl_transport_get_out_GLenum(t);
     stride = yagl_transport_get_out_GLsizei(t);
-    offset = yagl_transport_get_out_uint64_t(t);
+    offset = yagl_transport_get_out_uintptr_t(t);
     YAGL_LOG_FUNC_ENTER_SPLIT5(glVertexAttribIPointerOffset, GLuint, GLint, GLenum, GLsizei, uintptr_t, index, size, type, stride, offset);
     (void)yagl_host_glVertexAttribIPointerOffset(index, size, type, stride, offset);
     YAGL_LOG_FUNC_EXIT(NULL);
@@ -827,7 +827,7 @@ static void yagl_func_glTexImage2DOffset(struct yagl_transport *t)
     border = yagl_transport_get_out_GLint(t);
     format = yagl_transport_get_out_GLenum(t);
     type = yagl_transport_get_out_GLenum(t);
-    pixels = yagl_transport_get_out_uint64_t(t);
+    pixels = yagl_transport_get_out_uintptr_t(t);
     YAGL_LOG_FUNC_ENTER_SPLIT9(glTexImage2DOffset, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, uintptr_t, target, level, internalformat, width, height, border, format, type, pixels);
     (void)yagl_host_glTexImage2DOffset(target, level, internalformat, width, height, border, format, type, pixels);
     YAGL_LOG_FUNC_EXIT(NULL);
@@ -950,7 +950,7 @@ static void yagl_func_glTexSubImage2DOffset(struct yagl_transport *t)
     height = yagl_transport_get_out_GLsizei(t);
     format = yagl_transport_get_out_GLenum(t);
     type = yagl_transport_get_out_GLenum(t);
-    pixels = yagl_transport_get_out_uint64_t(t);
+    pixels = yagl_transport_get_out_uintptr_t(t);
     YAGL_LOG_FUNC_ENTER_SPLIT9(glTexSubImage2DOffset, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, uintptr_t, target, level, xoffset, yoffset, width, height, format, type, pixels);
     (void)yagl_host_glTexSubImage2DOffset(target, level, xoffset, yoffset, width, height, format, type, pixels);
     YAGL_LOG_FUNC_EXIT(NULL);
@@ -1147,7 +1147,7 @@ static void yagl_func_glTexImage3DOffset(struct yagl_transport *t)
     border = yagl_transport_get_out_GLint(t);
     format = yagl_transport_get_out_GLenum(t);
     type = yagl_transport_get_out_GLenum(t);
-    pixels = yagl_transport_get_out_uint64_t(t);
+    pixels = yagl_transport_get_out_uintptr_t(t);
     YAGL_LOG_FUNC_ENTER_SPLIT10(glTexImage3DOffset, GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, uintptr_t, target, level, internalformat, width, height, depth, border, format, type, pixels);
     (void)yagl_host_glTexImage3DOffset(target, level, internalformat, width, height, depth, border, format, type, pixels);
     YAGL_LOG_FUNC_EXIT(NULL);
@@ -1212,7 +1212,7 @@ static void yagl_func_glTexSubImage3DOffset(struct yagl_transport *t)
     depth = yagl_transport_get_out_GLsizei(t);
     format = yagl_transport_get_out_GLenum(t);
     type = yagl_transport_get_out_GLenum(t);
-    pixels = yagl_transport_get_out_uint64_t(t);
+    pixels = yagl_transport_get_out_uintptr_t(t);
     YAGL_LOG_FUNC_ENTER_SPLIT11(glTexSubImage3DOffset, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, uintptr_t, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
     (void)yagl_host_glTexSubImage3DOffset(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
     YAGL_LOG_FUNC_EXIT(NULL);
index 7085084..ce1a841 100644 (file)
@@ -269,7 +269,7 @@ void yagl_transport_get_out_array(struct yagl_transport *t,
                                   const void **data,
                                   int32_t *count)
 {
-    target_ulong va = (target_ulong)yagl_transport_get_out_uint64_t(t);
+    target_ulong va = (target_ulong)yagl_transport_get_out_va(t);
     uint32_t size;
 
     *count = yagl_transport_get_out_uint32_t(t);
@@ -296,7 +296,7 @@ void yagl_transport_get_in_array(struct yagl_transport *t,
                                  int32_t *maxcount,
                                  int32_t **count)
 {
-    target_ulong va = (target_ulong)yagl_transport_get_out_uint64_t(t);
+    target_ulong va = (target_ulong)yagl_transport_get_out_va(t);
     uint32_t size;
     struct yagl_transport_in_array *in_array;
     uint32_t offset;
index a91453f..8fe9ec6 100644 (file)
@@ -154,7 +154,13 @@ static __inline uint32_t yagl_transport_get_out_uint32_t(struct yagl_transport *
     return tmp;
 }
 
-static __inline uint64_t yagl_transport_get_out_uint64_t(struct yagl_transport *t)
+/*
+ * FIXME This is a workaround to make pointers handling correct for all the
+ * supported platfroms. E.g. some patches have not been applied to tizen 2.4
+ * yagl platfrom package, so there is a need to take additional care of it in
+ * qemu.
+ */
+static __inline uintptr_t yagl_transport_get_out_uintptr_t(struct yagl_transport *t)
 {
     uint64_t tmp;
     if (yagl_protocol_version < 24) {
@@ -163,14 +169,7 @@ static __inline uint64_t yagl_transport_get_out_uint64_t(struct yagl_transport *
         tmp = *(uint64_t*)t->ptr;
     }
     t->ptr += 8;
-    return tmp;
-}
-
-static __inline uintptr_t yagl_transport_get_out_uintptr_t(struct yagl_transport *t)
-{
-    uintptr_t tmp = *(uintptr_t*)t->ptr;
-    t->ptr += 8;
-    return tmp;
+    return (uintptr_t)tmp;
 }
 
 static __inline float yagl_transport_get_out_float(struct yagl_transport *t)