OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/browser/gpu/gpu_data_manager_impl_private.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl_private.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 command_line->GetSwitchValueASCII(switches::kGpuTestingVendorId), | 539 command_line->GetSwitchValueASCII(switches::kGpuTestingVendorId), |
540 &gpu_info.gpu.vendor_id); | 540 &gpu_info.gpu.vendor_id); |
541 base::HexStringToUInt( | 541 base::HexStringToUInt( |
542 command_line->GetSwitchValueASCII(switches::kGpuTestingDeviceId), | 542 command_line->GetSwitchValueASCII(switches::kGpuTestingDeviceId), |
543 &gpu_info.gpu.device_id); | 543 &gpu_info.gpu.device_id); |
544 gpu_info.gpu.active = true; | 544 gpu_info.gpu.active = true; |
545 gpu_info.secondary_gpus.clear(); | 545 gpu_info.secondary_gpus.clear(); |
546 } | 546 } |
547 | 547 |
548 gpu::ParseSecondaryGpuDevicesFromCommandLine(*command_line, &gpu_info); | 548 gpu::ParseSecondaryGpuDevicesFromCommandLine(*command_line, &gpu_info); |
| 549 |
| 550 if (command_line->HasSwitch(switches::kGpuTestingDriverDate)) { |
| 551 gpu_info.driver_date = |
| 552 command_line->GetSwitchValueASCII(switches::kGpuTestingDriverDate); |
| 553 } |
549 } | 554 } |
550 #if defined(ARCH_CPU_X86_FAMILY) | 555 #if defined(ARCH_CPU_X86_FAMILY) |
551 if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id) { | 556 if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id) { |
552 gpu_info.context_info_state = gpu::kCollectInfoNonFatalFailure; | 557 gpu_info.context_info_state = gpu::kCollectInfoNonFatalFailure; |
553 #if defined(OS_WIN) | 558 #if defined(OS_WIN) |
554 gpu_info.dx_diagnostics_info_state = gpu::kCollectInfoNonFatalFailure; | 559 gpu_info.dx_diagnostics_info_state = gpu::kCollectInfoNonFatalFailure; |
555 #endif // OS_WIN | 560 #endif // OS_WIN |
556 } | 561 } |
557 #endif // ARCH_CPU_X86_FAMILY | 562 #endif // ARCH_CPU_X86_FAMILY |
558 | 563 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 // device_id, driver_vendor, driver_version for deciding whether we need to | 742 // device_id, driver_vendor, driver_version for deciding whether we need to |
738 // collect full info (on Linux) and for crash reporting purpose. | 743 // collect full info (on Linux) and for crash reporting purpose. |
739 command_line->AppendSwitchASCII(switches::kGpuVendorID, | 744 command_line->AppendSwitchASCII(switches::kGpuVendorID, |
740 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); | 745 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); |
741 command_line->AppendSwitchASCII(switches::kGpuDeviceID, | 746 command_line->AppendSwitchASCII(switches::kGpuDeviceID, |
742 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id)); | 747 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id)); |
743 command_line->AppendSwitchASCII(switches::kGpuDriverVendor, | 748 command_line->AppendSwitchASCII(switches::kGpuDriverVendor, |
744 gpu_info_.driver_vendor); | 749 gpu_info_.driver_vendor); |
745 command_line->AppendSwitchASCII(switches::kGpuDriverVersion, | 750 command_line->AppendSwitchASCII(switches::kGpuDriverVersion, |
746 gpu_info_.driver_version); | 751 gpu_info_.driver_version); |
| 752 command_line->AppendSwitchASCII(switches::kGpuDriverDate, |
| 753 gpu_info_.driver_date); |
747 | 754 |
748 gpu::GPUInfo::GPUDevice maybe_active_gpu_device; | 755 gpu::GPUInfo::GPUDevice maybe_active_gpu_device; |
749 if (gpu_info_.gpu.active) | 756 if (gpu_info_.gpu.active) |
750 maybe_active_gpu_device = gpu_info_.gpu; | 757 maybe_active_gpu_device = gpu_info_.gpu; |
751 | 758 |
752 std::string vendor_ids_str; | 759 std::string vendor_ids_str; |
753 std::string device_ids_str; | 760 std::string device_ids_str; |
754 for (const auto& device : gpu_info_.secondary_gpus) { | 761 for (const auto& device : gpu_info_.secondary_gpus) { |
755 if (!vendor_ids_str.empty()) | 762 if (!vendor_ids_str.empty()) |
756 vendor_ids_str += ";"; | 763 vendor_ids_str += ";"; |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1255 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1262 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
1256 #if defined(OS_WIN) | 1263 #if defined(OS_WIN) |
1257 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1264 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
1258 #endif | 1265 #endif |
1259 complete_gpu_info_already_requested_ = true; | 1266 complete_gpu_info_already_requested_ = true; |
1260 // Some observers might be waiting. | 1267 // Some observers might be waiting. |
1261 NotifyGpuInfoUpdate(); | 1268 NotifyGpuInfoUpdate(); |
1262 } | 1269 } |
1263 | 1270 |
1264 } // namespace content | 1271 } // namespace content |
OLD | NEW |