Commit 41236f80 authored by sievers@chromium.org's avatar sievers@chromium.org

Make using virtual contexts a workaround flag rather than cmdline

This removes the commandline used on Android and adds references
to each particular bug in the json workaround list.

BUG=280609
R=piman@chromium.org, zmo@chromium.org

Review URL: https://codereview.chromium.org/23503038

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221832 0039d316-1c4b-4281-b951-d872f2087c98
parent 06c0c6a8
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#include "base/win/windows_version.h" #include "base/win/windows_version.h"
#endif // OS_WIN #endif // OS_WIN
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
#include "base/android/build_info.h"
#include "ui/gfx/android/device_display_info.h" #include "ui/gfx/android/device_display_info.h"
#endif // OS_ANDROID #endif // OS_ANDROID
...@@ -259,36 +258,11 @@ void ApplyAndroidWorkarounds(const gpu::GPUInfo& gpu_info, ...@@ -259,36 +258,11 @@ void ApplyAndroidWorkarounds(const gpu::GPUInfo& gpu_info,
std::string renderer(StringToLowerASCII(gpu_info.gl_renderer)); std::string renderer(StringToLowerASCII(gpu_info.gl_renderer));
bool is_img = bool is_img =
gpu_info.gl_vendor.find("Imagination") != std::string::npos; gpu_info.gl_vendor.find("Imagination") != std::string::npos;
bool is_arm =
gpu_info.gl_vendor.find("ARM") != std::string::npos;
bool is_qualcomm =
gpu_info.gl_vendor.find("Qualcomm") != std::string::npos;
bool is_broadcom =
gpu_info.gl_vendor.find("Broadcom") != std::string::npos;
bool is_mali_t604 = is_arm &&
gpu_info.gl_renderer.find("Mali-T604") != std::string::npos;
bool is_nvidia =
gpu_info.gl_vendor.find("NVIDIA") != std::string::npos;
bool is_vivante =
gpu_info.gl_extensions.find("GL_VIV_shader_binary") !=
std::string::npos;
bool is_nexus7 = bool is_nexus7 =
gpu_info.machine_model.find("Nexus 7") != std::string::npos; gpu_info.machine_model.find("Nexus 7") != std::string::npos;
bool is_nexus10 = bool is_nexus10 =
gpu_info.machine_model.find("Nexus 10") != std::string::npos; gpu_info.machine_model.find("Nexus 10") != std::string::npos;
int sdk_int = base::android::BuildInfo::GetInstance()->sdk_int();
// IMG: avoid context switching perf problems, crashes with share groups
// Mali-T604: http://crbug.com/154715
// QualComm, NVIDIA: Crashes with share groups
if (is_vivante || is_img || is_mali_t604 ||
((is_nvidia || is_qualcomm) && sdk_int < 18) || is_broadcom) {
command_line->AppendSwitch(switches::kEnableVirtualGLContexts);
}
gfx::DeviceDisplayInfo info; gfx::DeviceDisplayInfo info;
int default_tile_size = 256; int default_tile_size = 256;
......
...@@ -1114,7 +1114,6 @@ bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id) { ...@@ -1114,7 +1114,6 @@ bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id) {
switches::kDisableSeccompFilterSandbox, switches::kDisableSeccompFilterSandbox,
switches::kEnableLogging, switches::kEnableLogging,
switches::kEnableShareGroupAsyncTextureUpload, switches::kEnableShareGroupAsyncTextureUpload,
switches::kEnableVirtualGLContexts,
switches::kGpuStartupDialog, switches::kGpuStartupDialog,
switches::kGpuSandboxAllowSysVShm, switches::kGpuSandboxAllowSysVShm,
switches::kLoggingLevel, switches::kLoggingLevel,
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include "content/common/gpu/media/gpu_video_decode_accelerator.h" #include "content/common/gpu/media/gpu_video_decode_accelerator.h"
#include "content/common/gpu/sync_point_manager.h" #include "content/common/gpu/sync_point_manager.h"
#include "content/public/common/content_client.h" #include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
#include "gpu/command_buffer/common/constants.h" #include "gpu/command_buffer/common/constants.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/common/mailbox.h"
...@@ -151,6 +150,9 @@ GpuCommandBufferStub::GpuCommandBufferStub( ...@@ -151,6 +150,9 @@ GpuCommandBufferStub::GpuCommandBufferStub(
stream_texture_manager, stream_texture_manager,
true); true);
} }
use_virtualized_gl_context_ |=
context_group_->feature_info()->workarounds().use_virtualized_gl_contexts;
} }
GpuCommandBufferStub::~GpuCommandBufferStub() { GpuCommandBufferStub::~GpuCommandBufferStub() {
...@@ -439,9 +441,7 @@ void GpuCommandBufferStub::OnInitialize( ...@@ -439,9 +441,7 @@ void GpuCommandBufferStub::OnInitialize(
} }
scoped_refptr<gfx::GLContext> context; scoped_refptr<gfx::GLContext> context;
if ((CommandLine::ForCurrentProcess()->HasSwitch( if (use_virtualized_gl_context_ && channel_->share_group()) {
switches::kEnableVirtualGLContexts) || use_virtualized_gl_context_) &&
channel_->share_group()) {
context = channel_->share_group()->GetSharedContext(); context = channel_->share_group()->GetSharedContext();
if (!context.get()) { if (!context.get()) {
context = gfx::GLContext::CreateGLContext( context = gfx::GLContext::CreateGLContext(
......
...@@ -518,10 +518,6 @@ const char kEnableUserMediaScreenCapturing[] = ...@@ -518,10 +518,6 @@ const char kEnableUserMediaScreenCapturing[] =
// pinch gestures. // pinch gestures.
const char kEnableViewport[] = "enable-viewport"; const char kEnableViewport[] = "enable-viewport";
// Allow GL contexts to be automatically virtualized (shared between command
// buffer clients) if they are compatible.
const char kEnableVirtualGLContexts[] = "enable-virtual-gl-contexts";
// Enables moving cursor by word in visual order. // Enables moving cursor by word in visual order.
const char kEnableVisualWordMovement[] = "enable-visual-word-movement"; const char kEnableVisualWordMovement[] = "enable-visual-word-movement";
......
...@@ -154,7 +154,6 @@ CONTENT_EXPORT extern const char kEnableTextServicesFramework[]; ...@@ -154,7 +154,6 @@ CONTENT_EXPORT extern const char kEnableTextServicesFramework[];
CONTENT_EXPORT extern const char kEnableThreadedCompositing[]; CONTENT_EXPORT extern const char kEnableThreadedCompositing[];
extern const char kEnableUserMediaScreenCapturing[]; extern const char kEnableUserMediaScreenCapturing[];
extern const char kEnableViewport[]; extern const char kEnableViewport[];
extern const char kEnableVirtualGLContexts[];
extern const char kEnableVisualWordMovement[]; extern const char kEnableVisualWordMovement[];
CONTENT_EXPORT extern const char kEnableVtune[]; CONTENT_EXPORT extern const char kEnableVtune[];
extern const char kEnableWebAnimationsCSS[]; extern const char kEnableWebAnimationsCSS[];
......
...@@ -85,7 +85,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST( ...@@ -85,7 +85,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
{ {
"name": "gpu driver bug list", "name": "gpu driver bug list",
// Please update the version number whenever you change this file. // Please update the version number whenever you change this file.
"version": "2.8", "version": "2.9",
"entries": [ "entries": [
{ {
"id": 1, "id": 1,
...@@ -462,6 +462,107 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST( ...@@ -462,6 +462,107 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"features": [ "features": [
"disable_multimonitor_multisampling" "disable_multimonitor_multisampling"
] ]
},
{
"id": 31,
"cr_bugs": [154715, 10068, 269829],
"description": "The Nexus 10 Mali driver does not guarantee flush ordering.",
"os": {
"type": "android"
},
"gl_vendor": {
"op": "beginwith",
"value": "ARM"
},
"gl_renderer": {
"op": "contains",
"value": "Mali-T604"
},
"features": [
"use_virtualized_gl_contexts"
]
},
{
"id": 32,
"cr_bugs": [179815],
"description": "Share groups are not working on (older?) Broadcom drivers.",
"os": {
"type": "android"
},
"gl_vendor": {
"op": "beginwith",
"value": "Broadcom"
},
"features": [
"use_virtualized_gl_contexts"
]
},
{
"id": 33,
"description": "Share group-related crashes and poor context switching perf on Galaxy Nexus.",
"os": {
"type": "android"
},
"gl_vendor": {
"op": "beginwith",
"value": "Imagination"
},
"features": [
"use_virtualized_gl_contexts"
]
},
{
"id": 34,
"cr_bugs": [179250, 229643, 230896],
"description": "Share groups are not working on (older?) Vivante drivers.",
"os": {
"type": "android"
},
"gl_extensions": {
"op": "contains",
"value": "GL_VIV_shader_binary"
},
"features": [
"use_virtualized_gl_contexts"
]
},
{
"id": 35,
"cr_bugs": [163464],
"description": "Share-group related crashes on older NVIDIA drivers.",
"os": {
"type": "android",
"version": {
"op": "<",
"number": "4.3"
}
},
"gl_vendor": {
"op": "beginwith",
"value": "NVIDIA"
},
"features": [
"use_virtualized_gl_contexts"
]
},
{
"id": 36,
"cr_bugs": [163464, 233612],
"description": "Share-group related crashes on Qualcomm drivers.",
"os": {
"type": "android",
"version": {
"op": "<",
"number": "4.3"
}
},
"gl_vendor": {
"op": "beginwith",
"value": "Qualcomm"
},
"features": [
"use_virtualized_gl_contexts"
]
} }
] ]
} }
......
...@@ -66,6 +66,8 @@ ...@@ -66,6 +66,8 @@
disable_angle_instanced_arrays) \ disable_angle_instanced_arrays) \
GPU_OP(DISABLE_MULTIMONITOR_MULTISAMPLING, \ GPU_OP(DISABLE_MULTIMONITOR_MULTISAMPLING, \
disable_multimonitor_multisampling) \ disable_multimonitor_multisampling) \
GPU_OP(USE_VIRTUALIZED_GL_CONTEXTS, \
use_virtualized_gl_contexts) \
namespace gpu { namespace gpu {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment