OLD | NEW |
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" |
23 #include "gpu/config/gpu_feature_type.h" | 22 #include "gpu/config/gpu_feature_type.h" |
24 #include "gpu/config/gpu_finch_features.h" | 23 #include "gpu/config/gpu_finch_features.h" |
25 #include "gpu/config/gpu_info_collector.h" | 24 #include "gpu/config/gpu_info_collector.h" |
26 #include "gpu/config/gpu_switches.h" | 25 #include "gpu/config/gpu_switches.h" |
27 #include "ui/gl/gl_switches.h" | 26 #include "ui/gl/gl_switches.h" |
28 #include "ui/gl/gpu_switching_manager.h" | 27 #include "ui/gl/gpu_switching_manager.h" |
29 | 28 |
30 namespace gpu { | 29 namespace gpu { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 return kGpuFeatureStatusDisabled; | 90 return kGpuFeatureStatusDisabled; |
92 | 91 |
93 return kGpuFeatureStatusEnabled; | 92 return kGpuFeatureStatusEnabled; |
94 } | 93 } |
95 | 94 |
96 } // namespace anonymous | 95 } // namespace anonymous |
97 | 96 |
98 void ApplyGpuDriverBugWorkarounds(const GPUInfo& gpu_info, | 97 void ApplyGpuDriverBugWorkarounds(const GPUInfo& gpu_info, |
99 base::CommandLine* command_line) { | 98 base::CommandLine* command_line) { |
100 std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); | 99 std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); |
101 list->LoadList(kGpuDriverBugListJson, | |
102 GpuControlList::kCurrentOsOnly); | |
103 std::set<int> workarounds = list->MakeDecision( | 100 std::set<int> workarounds = list->MakeDecision( |
104 GpuControlList::kOsAny, std::string(), gpu_info); | 101 GpuControlList::kOsAny, std::string(), gpu_info); |
105 GpuDriverBugList::AppendWorkaroundsFromCommandLine( | 102 GpuDriverBugList::AppendWorkaroundsFromCommandLine( |
106 &workarounds, *command_line); | 103 &workarounds, *command_line); |
107 if (!workarounds.empty()) { | 104 if (!workarounds.empty()) { |
108 command_line->AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, | 105 command_line->AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, |
109 IntSetToString(workarounds)); | 106 IntSetToString(workarounds)); |
110 } | 107 } |
111 | 108 |
112 std::vector<std::string> buglist_disabled_extensions = | 109 std::vector<std::string> buglist_disabled_extensions = |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 else if (driver_bug_workarounds.count(gpu::FORCE_INTEGRATED_GPU) == 1) | 186 else if (driver_bug_workarounds.count(gpu::FORCE_INTEGRATED_GPU) == 1) |
190 ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu(); | 187 ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu(); |
191 } | 188 } |
192 | 189 |
193 GpuFeatureInfo GetGpuFeatureInfo(const GPUInfo& gpu_info, | 190 GpuFeatureInfo GetGpuFeatureInfo(const GPUInfo& gpu_info, |
194 const base::CommandLine& command_line) { | 191 const base::CommandLine& command_line) { |
195 GpuFeatureInfo gpu_feature_info; | 192 GpuFeatureInfo gpu_feature_info; |
196 std::set<int> blacklisted_features; | 193 std::set<int> blacklisted_features; |
197 if (!command_line.HasSwitch(switches::kIgnoreGpuBlacklist)) { | 194 if (!command_line.HasSwitch(switches::kIgnoreGpuBlacklist)) { |
198 std::unique_ptr<GpuBlacklist> list(GpuBlacklist::Create()); | 195 std::unique_ptr<GpuBlacklist> list(GpuBlacklist::Create()); |
199 list->LoadList(kSoftwareRenderingListJson, GpuControlList::kCurrentOsOnly); | |
200 blacklisted_features = | 196 blacklisted_features = |
201 list->MakeDecision(GpuControlList::kOsAny, std::string(), gpu_info); | 197 list->MakeDecision(GpuControlList::kOsAny, std::string(), gpu_info); |
202 } | 198 } |
203 | 199 |
204 // Currently only used for GPU rasterization. | 200 // Currently only used for GPU rasterization. |
205 gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] = | 201 gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] = |
206 GetGpuRasterizationFeatureStatus(blacklisted_features, command_line); | 202 GetGpuRasterizationFeatureStatus(blacklisted_features, command_line); |
207 | 203 |
208 return gpu_feature_info; | 204 return gpu_feature_info; |
209 } | 205 } |
(...skipping 15 matching lines...) Expand all Loading... |
225 gpu_info.vertex_shader_version); | 221 gpu_info.vertex_shader_version); |
226 #if defined(OS_MACOSX) | 222 #if defined(OS_MACOSX) |
227 base::debug::SetCrashKeyValue(crash_keys::kGPUGLVersion, gpu_info.gl_version); | 223 base::debug::SetCrashKeyValue(crash_keys::kGPUGLVersion, gpu_info.gl_version); |
228 #elif defined(OS_POSIX) | 224 #elif defined(OS_POSIX) |
229 base::debug::SetCrashKeyValue(crash_keys::kGPUVendor, gpu_info.gl_vendor); | 225 base::debug::SetCrashKeyValue(crash_keys::kGPUVendor, gpu_info.gl_vendor); |
230 base::debug::SetCrashKeyValue(crash_keys::kGPURenderer, gpu_info.gl_renderer); | 226 base::debug::SetCrashKeyValue(crash_keys::kGPURenderer, gpu_info.gl_renderer); |
231 #endif | 227 #endif |
232 } | 228 } |
233 | 229 |
234 } // namespace gpu | 230 } // namespace gpu |
OLD | NEW |