| 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_info_collector.h" | 5 #include "gpu/config/gpu_info_collector.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 for (size_t ii = 0; ii < gpu_info->secondary_gpus.size(); ++ii) { | 300 for (size_t ii = 0; ii < gpu_info->secondary_gpus.size(); ++ii) { |
| 301 if (active_vendor_id == gpu_info->secondary_gpus[ii].vendor_id) { | 301 if (active_vendor_id == gpu_info->secondary_gpus[ii].vendor_id) { |
| 302 gpu_info->secondary_gpus[ii].active = true; | 302 gpu_info->secondary_gpus[ii].active = true; |
| 303 return; | 303 return; |
| 304 } | 304 } |
| 305 } | 305 } |
| 306 } | 306 } |
| 307 | 307 |
| 308 void FillGPUInfoFromSystemInfo(GPUInfo* gpu_info, | 308 void FillGPUInfoFromSystemInfo(GPUInfo* gpu_info, |
| 309 angle::SystemInfo* system_info) { | 309 angle::SystemInfo* system_info) { |
| 310 DCHECK(system_info->primaryGPUIndex >= 0); |
| 311 |
| 310 angle::GPUDeviceInfo* primary = | 312 angle::GPUDeviceInfo* primary = |
| 311 &system_info->gpus[system_info->primaryGPUIndex]; | 313 &system_info->gpus[system_info->primaryGPUIndex]; |
| 312 | 314 |
| 313 gpu_info->gpu.vendor_id = primary->vendorId; | 315 gpu_info->gpu.vendor_id = primary->vendorId; |
| 314 gpu_info->gpu.device_id = primary->deviceId; | 316 gpu_info->gpu.device_id = primary->deviceId; |
| 317 if (system_info->primaryGPUIndex == system_info->activeGPUIndex) { |
| 318 gpu_info->gpu.active = true; |
| 319 } |
| 315 | 320 |
| 316 gpu_info->driver_vendor = std::move(primary->driverVendor); | 321 gpu_info->driver_vendor = std::move(primary->driverVendor); |
| 317 gpu_info->driver_version = std::move(primary->driverVersion); | 322 gpu_info->driver_version = std::move(primary->driverVersion); |
| 318 gpu_info->driver_date = std::move(primary->driverDate); | 323 gpu_info->driver_date = std::move(primary->driverDate); |
| 319 | 324 |
| 320 for (size_t i = 0; i < system_info->gpus.size(); i++) { | 325 for (size_t i = 0; i < system_info->gpus.size(); i++) { |
| 321 if (static_cast<int>(i) == system_info->primaryGPUIndex) { | 326 if (static_cast<int>(i) == system_info->primaryGPUIndex) { |
| 322 continue; | 327 continue; |
| 323 } | 328 } |
| 324 | 329 |
| 325 GPUInfo::GPUDevice device; | 330 GPUInfo::GPUDevice device; |
| 326 device.vendor_id = system_info->gpus[i].vendorId; | 331 device.vendor_id = system_info->gpus[i].vendorId; |
| 327 device.device_id = system_info->gpus[i].deviceId; | 332 device.device_id = system_info->gpus[i].deviceId; |
| 333 if (static_cast<int>(i) == system_info->activeGPUIndex) { |
| 334 device.active = true; |
| 335 } |
| 328 | 336 |
| 329 gpu_info->secondary_gpus.push_back(device); | 337 gpu_info->secondary_gpus.push_back(device); |
| 330 } | 338 } |
| 331 | 339 |
| 332 gpu_info->optimus = system_info->isOptimus; | 340 gpu_info->optimus = system_info->isOptimus; |
| 333 gpu_info->amd_switchable = system_info->isAMDSwitchable; | 341 gpu_info->amd_switchable = system_info->isAMDSwitchable; |
| 334 | 342 |
| 335 gpu_info->machine_model_name = system_info->machineModelName; | 343 gpu_info->machine_model_name = system_info->machineModelName; |
| 336 gpu_info->machine_model_version = system_info->machineModelVersion; | 344 gpu_info->machine_model_version = system_info->machineModelVersion; |
| 337 } | 345 } |
| 338 | 346 |
| 339 } // namespace gpu | 347 } // namespace gpu |
| OLD | NEW |