summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2014-06-23 20:13:54 +0200
committerAndras Becsi <andras.becsi@digia.com>2014-06-24 13:19:49 +0200
commit986f1fc7829248bbcf0fe84471cbf48c932908ce (patch)
tree0dbef6a88e43aec5fdb105f06abe7f837dcbddb6
parent95cc7dd358e6916f4caf2891ff0a46935ec56dbb (diff)
Do not use fence sync on the i.MX6
The change to check for the correct EGL_KHR_fence_sync extension revealed that on the i.MX6 SabreLite the eglClientWaitSyncKHR call results in a crash, but since for this device glFlush() seems to be enough to sync GL commands between threads, we can skip creating a fence if we run on this hardware. Change-Id: I208c7f390c9ceb792720f4e060c4a76c5db53e8f Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
-rw-r--r--src/core/chromium_gpu_helper.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/core/chromium_gpu_helper.cpp b/src/core/chromium_gpu_helper.cpp
index 8782f5d9..d771f40d 100644
--- a/src/core/chromium_gpu_helper.cpp
+++ b/src/core/chromium_gpu_helper.cpp
@@ -45,11 +45,26 @@
#include "chromium_gpu_helper.h"
+#include "base/strings/string_util.h"
#include "content/common/gpu/gpu_channel_manager.h"
#include "content/common/gpu/sync_point_manager.h"
#include "content/gpu/gpu_child_thread.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/command_buffer/service/texture_manager.h"
+#include "gpu/config/gpu_info_collector.h"
+
+namespace {
+
+bool isVivante()
+{
+ gpu::GPUInfo gpuInfo;
+ gpu::CollectBasicGraphicsInfo(&gpuInfo);
+
+ return LowerCaseEqualsASCII(gpuInfo.gpu.vendor_string, "vivante corporation")
+ && LowerCaseEqualsASCII(gpuInfo.gpu.device_string, "gc2000 core");
+}
+
+}
static void addSyncPointCallbackDelegate(content::SyncPointManager *syncPointManager, uint32 sync_point, const base::Closure& callback)
{
@@ -59,6 +74,17 @@ static void addSyncPointCallbackDelegate(content::SyncPointManager *syncPointMan
FenceSync createFence()
{
FenceSync ret;
+
+ static bool hasVivanteGPU = isVivante();
+
+ // On the iMX6 the eglClientWaitSyncKHR call crashes with the fence_sync
+ // but the glFlush() call below seems to be enough to sync GL commands,
+ // thus skip creating a fence sync for the Vivante GPU.
+ if (hasVivanteGPU) {
+ glFlush();
+ return ret;
+ }
+
// Logic taken from chromium/ui/gl/gl_fence.cc
#if !defined(OS_MACOSX)
if (gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync) {