From 986f1fc7829248bbcf0fe84471cbf48c932908ce Mon Sep 17 00:00:00 2001 From: Andras Becsi Date: Mon, 23 Jun 2014 20:13:54 +0200 Subject: 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 --- src/core/chromium_gpu_helper.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/core/chromium_gpu_helper.cpp b/src/core/chromium_gpu_helper.cpp index 8782f5d98..d771f40d2 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) { -- cgit v1.2.3