From 4dc6bf34226e5e2152e7f44a27ff2374a3cc93f5 Mon Sep 17 00:00:00 2001 From: Igor Mitsyanko Date: Thu, 26 Jul 2012 11:49:10 +0400 Subject: [PATCH] configure: fix -enable-debug-gles option Opengles debug was not enabled when you specify -enable-debug-gles option because it defined wrong varible. Signed-off-by: Igor Mitsyanko --- configure | 2 +- hw/gles2.c | 28 ++++++++++++++-------------- hw/gles2.h | 10 +++------- hw/gles2_es20_calls.c | 6 +++--- hw/gles2_kernel_calls.c | 4 ++-- 5 files changed, 23 insertions(+), 27 deletions(-) diff --git a/configure b/configure index 139992b..fa954c1 100755 --- a/configure +++ b/configure @@ -3410,7 +3410,7 @@ fi if test "$opengles" = "yes" ; then echo "CONFIG_OPENGLES=y" >> $config_host_mak if test "$debug_gles" = "yes" ; then - echo "OPENGLES_DEBUG=y" >> $config_host_mak + echo "CONFIG_DEBUG_GLES=y" >> $config_host_mak fi fi diff --git a/hw/gles2.c b/hw/gles2.c index 3d87c99..8ef6ec0 100644 --- a/hw/gles2.c +++ b/hw/gles2.c @@ -65,9 +65,9 @@ int gles2_transfer_compile(gles2_CompiledTransfer* tfr, gles2_State *s, tfr->nsections = 0; tfr->sections = 0; -#if (GLES2_DEBUG == 1) +#if (CONFIG_DEBUG_GLES == 1) target_ulong first_page = TARGET_PAGE(va); -#endif // GLES2_DEBUG == 1 +#endif // CONFIG_DEBUG_GLES == 1 target_ulong last_page = TARGET_PAGE(va + len - 1); target_ulong start_addr = va; @@ -83,9 +83,9 @@ int gles2_transfer_compile(gles2_CompiledTransfer* tfr, gles2_State *s, { return 0; } -#if (GLES2_DEBUG == 1) +#if (CONFIG_DEBUG_GLES == 1) target_ulong end_pa = start_pa; -#endif // GLES2_DEBUG == 1 +#endif // CONFIG_DEBUG_GLES == 1 // Solve length of continuous section. target_ulong end_page = start_page; @@ -104,9 +104,9 @@ int gles2_transfer_compile(gles2_CompiledTransfer* tfr, gles2_State *s, } end_page = next_page; -#if (GLES2_DEBUG == 1) +#if (CONFIG_DEBUG_GLES == 1) end_pa = next_pa; -#endif // GLES2_DEBUG == 1 +#endif // CONFIG_DEBUG_GLES == 1 } unsigned id = tfr->nsections++; @@ -175,9 +175,9 @@ void gles2_transfer_free(gles2_CompiledTransfer* tfr) int gles2_transfer(gles2_State *s, target_ulong va, target_ulong len, void* data, int access_type) { -#if (GLES2_DEBUG == 1) +#if (CONFIG_DEBUG_GLES == 1) target_ulong first_page = TARGET_PAGE(va); -#endif // GLES2_DEBUG == 1 +#endif // CONFIG_DEBUG_GLES == 1 target_ulong last_page = TARGET_PAGE(va + len - 1); target_ulong start_addr = va; @@ -193,9 +193,9 @@ int gles2_transfer(gles2_State *s, target_ulong va, target_ulong len, { return 0; } -#if (GLES2_DEBUG == 1) +#if (CONFIG_DEBUG_GLES == 1) target_ulong end_pa = start_pa; -#endif // GLES2_DEBUG == 1 +#endif // CONFIG_DEBUG_GLES == 1 // Solve length of continuous section. target_ulong end_page = start_page; @@ -214,9 +214,9 @@ int gles2_transfer(gles2_State *s, target_ulong va, target_ulong len, } end_page = next_page; -#if (GLES2_DEBUG == 1) +#if (CONFIG_DEBUG_GLES == 1) end_pa = next_pa; -#endif // GLES2_DEBUG == 1 +#endif // CONFIG_DEBUG_GLES == 1 } GLES2_PRINT("\tContinuous from 0x%x to 0x%x (0x%x to 0x%x).\n", @@ -433,13 +433,13 @@ uint32_t gles2_handle_find(gles2_State *s, void* data) void* gles2_handle_get(gles2_State *s, uint32_t i) { -#if(GLES2_DEBUG == 1) +#ifdef CONFIG_DEBUG_GLES if(i && (i & ~GLES2_HANDLE_MASK) != GLES2_HANDLE_BASE) { GLES2_PRINT("ERROR: Invalid handle %x!\n", i); exit(1); } -#endif // GLES2_DEBUG == 1 +#endif // CONFIG_DEBUG_GLES == 1 void* data = i ? s->handles[i & GLES2_HANDLE_MASK] : NULL; diff --git a/hw/gles2.h b/hw/gles2.h index 76af97f..b0dd516 100644 --- a/hw/gles2.h +++ b/hw/gles2.h @@ -72,11 +72,7 @@ // Return the page offset part of address. #define TARGET_OFFSET(addr) ((addr) & (TARGET_PAGE_SIZE - 1)) -#ifndef GLES2_DEBUG -# define GLES2_DEBUG 0 -#endif - -#if(GLES2_DEBUG == 1) +#ifdef CONFIG_DEBUG_GLES # define GLES2_DEBUG_ARGS 1 # define GLES2_TRACING 1 # define GLES2_PRINT(format, args...) \ @@ -85,7 +81,7 @@ # define GLES2_DEBUG_ARGS 0 # define GLES2_PRINT(format, args...) (void)0 # define GLES2_TRACING 0 -#endif // GLES2_DEBUG != 1 +#endif // CONFIG_DEBUG_GLES != 1 #if(GLES2_TRACING == 1) # define GLES2_TRACE(format, args...) \ @@ -253,7 +249,7 @@ struct gles2_State pthread_mutex_t m; }; -#if(GLES2_DEBUG==1) +#ifdef CONFIG_DEBUG_GLES unsigned int gles20_glGetError(void); #endif diff --git a/hw/gles2_es20_calls.c b/hw/gles2_es20_calls.c index 69c0715..e28c74c 100644 --- a/hw/gles2_es20_calls.c +++ b/hw/gles2_es20_calls.c @@ -183,7 +183,7 @@ static unsigned gles2_GetCount(TGLenum pname) #include "gles2_escommon_calls.c" -#if(GLES2_DEBUG==1) +#ifdef CONFIG_DEBUG_GLES unsigned int gles20_glGetError(void) { return hgl.glGetError(); @@ -587,11 +587,11 @@ GLES2_CB(glShaderSource) GLES2_BARRIER_ARG_NORET; GLES2_PRINT("shader %d source:\n", shader); - #if(GLES2_DEBUG == 1) + #ifdef CONFIG_DEBUG_GLES for(i = 0; i < count; ++i) { fprintf(stderr, "%.*s", length_fgl[i], string_fgl[i]); } - #endif // GLES2_DEBUG == 1 + #endif // CONFIG_DEBUG_GLES == 1 GLES2_PRINT("\n--END--"); hgl.glShaderSource(shader, (GLsizei)count, diff --git a/hw/gles2_kernel_calls.c b/hw/gles2_kernel_calls.c index e995be9..b4f5489 100644 --- a/hw/gles2_kernel_calls.c +++ b/hw/gles2_kernel_calls.c @@ -173,7 +173,7 @@ void* gles2_client_worker(void *opaque) GLES2_TRACE("WORKER(%d): Calling function %s (%p)...\n", client->nr, client->call->name, client->call); client->call->callback(client->s, &d, client); -#if(GLES2_DEBUG == 1) +#ifdef CONFIG_DEBUG_GLES /*if (client->call->name[0] == 'g') { unsigned int error = gles20_glGetError(); if (error) { @@ -181,7 +181,7 @@ void* gles2_client_worker(void *opaque) error, client->call->name); } }*/ -#endif // GLES2_DEBUG == 1 +#endif // CONFIG_DEBUG_GLES == 1 GLES2_PRINT("\tWORKER(%d): Done.\n", client->nr); client->prev_call = client->call; client->state = gles2_ClientState_done; -- 2.7.4