if (enable_yagl) {
capability_check_gl = check_gl();
- if (capability_check_gl != 0) {
+ if (capability_check_gl == 1) {
enable_yagl = 0;
- LOG_INFO("<WARNING> GL acceleration was disabled due to the fail of GL check!\n");
+ LOG_INFO("<WARNING> 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);
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;
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;
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;
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!");