Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: gpu/config/gpu_util.cc

Issue 2756793003: Move GPU blacklist and driver bug workaround list from json to data struct. (Closed)
Patch Set: pure rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/config/gpu_driver_bug_workaround_type.h ('k') | gpu/config/gpu_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/config/gpu_util.h" 5 #include "gpu/config/gpu_util.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/debug/crash_logging.h" 11 #include "base/debug/crash_logging.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
14 #include "base/strings/string_piece.h" 14 #include "base/strings/string_piece.h"
15 #include "base/strings/string_split.h" 15 #include "base/strings/string_split.h"
16 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
17 #include "base/strings/stringprintf.h" 17 #include "base/strings/stringprintf.h"
18 #include "base/sys_info.h" 18 #include "base/sys_info.h"
19 #include "gpu/config/gpu_blacklist.h" 19 #include "gpu/config/gpu_blacklist.h"
20 #include "gpu/config/gpu_control_list_jsons.h"
21 #include "gpu/config/gpu_crash_keys.h" 20 #include "gpu/config/gpu_crash_keys.h"
22 #include "gpu/config/gpu_driver_bug_list.h" 21 #include "gpu/config/gpu_driver_bug_list.h"
22 #include "gpu/config/gpu_driver_bug_workaround_type.h"
23 #include "gpu/config/gpu_feature_type.h" 23 #include "gpu/config/gpu_feature_type.h"
24 #include "gpu/config/gpu_finch_features.h" 24 #include "gpu/config/gpu_finch_features.h"
25 #include "gpu/config/gpu_info_collector.h" 25 #include "gpu/config/gpu_info_collector.h"
26 #include "gpu/config/gpu_switches.h" 26 #include "gpu/config/gpu_switches.h"
27 #include "ui/gl/gl_switches.h" 27 #include "ui/gl/gl_switches.h"
28 #include "ui/gl/gpu_switching_manager.h" 28 #include "ui/gl/gpu_switching_manager.h"
29 29
30 namespace gpu { 30 namespace gpu {
31 31
32 namespace { 32 namespace {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 return kGpuFeatureStatusDisabled; 91 return kGpuFeatureStatusDisabled;
92 92
93 return kGpuFeatureStatusEnabled; 93 return kGpuFeatureStatusEnabled;
94 } 94 }
95 95
96 } // namespace anonymous 96 } // namespace anonymous
97 97
98 void ApplyGpuDriverBugWorkarounds(const GPUInfo& gpu_info, 98 void ApplyGpuDriverBugWorkarounds(const GPUInfo& gpu_info,
99 base::CommandLine* command_line) { 99 base::CommandLine* command_line) {
100 std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); 100 std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create());
101 list->LoadList(kGpuDriverBugListJson,
102 GpuControlList::kCurrentOsOnly);
103 std::set<int> workarounds = list->MakeDecision( 101 std::set<int> workarounds = list->MakeDecision(
104 GpuControlList::kOsAny, std::string(), gpu_info); 102 GpuControlList::kOsAny, std::string(), gpu_info);
105 GpuDriverBugList::AppendWorkaroundsFromCommandLine( 103 GpuDriverBugList::AppendWorkaroundsFromCommandLine(
106 &workarounds, *command_line); 104 &workarounds, *command_line);
107 if (!workarounds.empty()) { 105 if (!workarounds.empty()) {
108 command_line->AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, 106 command_line->AppendSwitchASCII(switches::kGpuDriverBugWorkarounds,
109 IntSetToString(workarounds)); 107 IntSetToString(workarounds));
110 } 108 }
111 109
112 std::vector<std::string> buglist_disabled_extensions = 110 std::vector<std::string> buglist_disabled_extensions =
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 else if (driver_bug_workarounds.count(gpu::FORCE_INTEGRATED_GPU) == 1) 187 else if (driver_bug_workarounds.count(gpu::FORCE_INTEGRATED_GPU) == 1)
190 ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu(); 188 ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu();
191 } 189 }
192 190
193 GpuFeatureInfo GetGpuFeatureInfo(const GPUInfo& gpu_info, 191 GpuFeatureInfo GetGpuFeatureInfo(const GPUInfo& gpu_info,
194 const base::CommandLine& command_line) { 192 const base::CommandLine& command_line) {
195 GpuFeatureInfo gpu_feature_info; 193 GpuFeatureInfo gpu_feature_info;
196 std::set<int> blacklisted_features; 194 std::set<int> blacklisted_features;
197 if (!command_line.HasSwitch(switches::kIgnoreGpuBlacklist)) { 195 if (!command_line.HasSwitch(switches::kIgnoreGpuBlacklist)) {
198 std::unique_ptr<GpuBlacklist> list(GpuBlacklist::Create()); 196 std::unique_ptr<GpuBlacklist> list(GpuBlacklist::Create());
199 list->LoadList(kSoftwareRenderingListJson, GpuControlList::kCurrentOsOnly);
200 blacklisted_features = 197 blacklisted_features =
201 list->MakeDecision(GpuControlList::kOsAny, std::string(), gpu_info); 198 list->MakeDecision(GpuControlList::kOsAny, std::string(), gpu_info);
202 } 199 }
203 200
204 // Currently only used for GPU rasterization. 201 // Currently only used for GPU rasterization.
205 gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] = 202 gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] =
206 GetGpuRasterizationFeatureStatus(blacklisted_features, command_line); 203 GetGpuRasterizationFeatureStatus(blacklisted_features, command_line);
207 204
208 return gpu_feature_info; 205 return gpu_feature_info;
209 } 206 }
(...skipping 15 matching lines...) Expand all
225 gpu_info.vertex_shader_version); 222 gpu_info.vertex_shader_version);
226 #if defined(OS_MACOSX) 223 #if defined(OS_MACOSX)
227 base::debug::SetCrashKeyValue(crash_keys::kGPUGLVersion, gpu_info.gl_version); 224 base::debug::SetCrashKeyValue(crash_keys::kGPUGLVersion, gpu_info.gl_version);
228 #elif defined(OS_POSIX) 225 #elif defined(OS_POSIX)
229 base::debug::SetCrashKeyValue(crash_keys::kGPUVendor, gpu_info.gl_vendor); 226 base::debug::SetCrashKeyValue(crash_keys::kGPUVendor, gpu_info.gl_vendor);
230 base::debug::SetCrashKeyValue(crash_keys::kGPURenderer, gpu_info.gl_renderer); 227 base::debug::SetCrashKeyValue(crash_keys::kGPURenderer, gpu_info.gl_renderer);
231 #endif 228 #endif
232 } 229 }
233 230
234 } // namespace gpu 231 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/config/gpu_driver_bug_workaround_type.h ('k') | gpu/config/gpu_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698