From: jinhyung.jo Date: Mon, 20 Oct 2014 11:48:55 +0000 (+0900) Subject: check-gl: Modified check-gl X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~629^2~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb659ae56afce1f80351ca0e2034c69dec30b461;p=sdk%2Femulator%2Fqemu.git check-gl: Modified check-gl Add the routine to check GL driver vendor on Ubuntu Change-Id: I373dcbbf61e6d0a71ec33fd968771ff526481341 Signed-off-by: Jinhyung Jo --- diff --git a/tizen/src/emulator.c b/tizen/src/emulator.c index a66de955bf..f101f649e5 100644 --- a/tizen/src/emulator.c +++ b/tizen/src/emulator.c @@ -245,10 +245,33 @@ static void prepare_opengl_acceleration(gchar * const kernel_cmdline) if (enable_yagl) { capability_check_gl = check_gl(); - if (capability_check_gl != 0) { + if (capability_check_gl == 1) { enable_yagl = 0; - LOG_INFO(" GL acceleration was disabled due to the fail of GL check!\n"); + LOG_INFO(" GL acceleration was disabled " + "due to the fail of GL check!\n"); +#ifndef CONFIG_LINUX } +#else + } else if (capability_check_gl == 2) { + int ret = 0; + gchar *cmd = NULL; + char exec_cmd[] = "zenity --error --no-wrap --text="; + char err_msg[] = + "\"You are using invalid graphic card driver for " + "the emulator.\n" + "You have to use the lastest vendor-provided graphic " + "card driver.\n\nFor more information, see under ubuntu" + " driver help page.\n" + "https://help.ubuntu.com/community/BinaryDriverHowto/\""; + int cmd_len = strlen(exec_cmd) + strlen(err_msg); + cmd = g_malloc0(cmd_len); + snprintf(cmd, cmd_len + 1, "%s%s", exec_cmd, err_msg); + ret = system(cmd); + LOG_SEVERE("%s\nzenity return=%d\n", err_msg, ret); + g_free(cmd); + exit(-1); + } +#endif } gchar * const tmp_str = g_strdup_printf(" yagl=%d", enable_yagl); diff --git a/tizen/src/util/check_gl_core.c b/tizen/src/util/check_gl_core.c index c2280cfd1c..a9ae1e4358 100644 --- a/tizen/src/util/check_gl_core.c +++ b/tizen/src/util/check_gl_core.c @@ -76,7 +76,11 @@ static const GLubyte *(GLAPIENTRY *get_stringi)(GLenum, GLuint); static void (GLAPIENTRY *get_integerv)(GLenum, GLint*); static void (GLAPIENTRY *dummy)(void); +#if defined(__linux__) && !defined(__APPLE__) +static struct gl_context *check_gl_version(gl_version version, int *isGallium) +#else static struct gl_context *check_gl_version(gl_version version) +#endif { struct gl_context *ctx = NULL; int hw = 1; @@ -115,6 +119,14 @@ static struct gl_context *check_gl_version(gl_version version) check_gl_log(gl_info, "+ GL_RENDERER = %s", (const char*)get_string(GL_RENDERER)); check_gl_log(gl_info, "+ GL_VERSION = %s", (const char*)get_string(GL_VERSION)); +#if defined(__linux__) && !defined(__APPLE__) + if ((strstr((const char *)get_string(GL_RENDERER), "Gallium") != NULL)) { + *isGallium = 1; + } else { + *isGallium = 0; + } +#endif + if (!hw) { check_gl_context_destroy(ctx); ctx = NULL; @@ -145,6 +157,11 @@ int check_gl(void) int have_es3 = 0; int have_es3_compatibility = 0; int have_es1 = 0; +#if defined(__linux__) && !defined(__APPLE__) + int isGallium_2 = 0; + int isGallium_3_1 = 0; + int isGallium_3_2 = 0; +#endif if (!check_gl_init()) { return 1; @@ -156,9 +173,21 @@ int check_gl(void) goto out; } +#if defined(__linux__) && !defined(__APPLE__) + ctx_2 = check_gl_version(gl_2, &isGallium_2); + ctx_3_1 = check_gl_version(gl_3_1, &isGallium_3_1); + ctx_3_2 = check_gl_version(gl_3_2, &isGallium_3_2); + + if (isGallium_2 || isGallium_3_1 || isGallium_3_2) { + check_gl_log(gl_error, "Host has Gallium GL driver!"); + res = 2; + goto out; + } +#else ctx_2 = check_gl_version(gl_2); ctx_3_1 = check_gl_version(gl_3_1); ctx_3_2 = check_gl_version(gl_3_2); +#endif if (!ctx_2 && !ctx_3_1 && !ctx_3_2) { check_gl_log(gl_info, "Host does not have hardware GL acceleration!");