| 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" |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |