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

Unified Diff: gpu/config/gpu_info_collector.cc

Issue 2725873007: gpu/config: Use angle::GetSystemInfo on Linux (Closed)
Patch Set: "Fix" gn check Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/config/gpu_info_collector.h ('k') | gpu/config/gpu_info_collector_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/config/gpu_info_collector.cc
diff --git a/gpu/config/gpu_info_collector.cc b/gpu/config/gpu_info_collector.cc
index 2d2dfe2db47603c4b2e1bafe14e222bbc4251e33..6f8068ea9dcc63579d04cbb1f3e68d856a76e195 100644
--- a/gpu/config/gpu_info_collector.cc
+++ b/gpu/config/gpu_info_collector.cc
@@ -19,6 +19,7 @@
#include "base/strings/string_util.h"
#include "base/trace_event/trace_event.h"
#include "gpu/config/gpu_switches.h"
+#include "third_party/angle/src/gpu_info_util/SystemInfo.h" // nogncheck
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_implementation.h"
@@ -304,4 +305,35 @@ void IdentifyActiveGPU(GPUInfo* gpu_info) {
}
}
+void FillGPUInfoFromSystemInfo(GPUInfo* gpu_info,
+ angle::SystemInfo* system_info) {
+ angle::GPUDeviceInfo* primary =
+ &system_info->gpus[system_info->primaryGPUIndex];
+
+ gpu_info->gpu.vendor_id = primary->vendorId;
+ gpu_info->gpu.device_id = primary->deviceId;
+
+ gpu_info->driver_vendor = std::move(primary->driverVendor);
+ gpu_info->driver_version = std::move(primary->driverVersion);
+ gpu_info->driver_date = std::move(primary->driverDate);
+
+ for (size_t i = 0; i < system_info->gpus.size(); i++) {
+ if (static_cast<int>(i) == system_info->primaryGPUIndex) {
+ continue;
+ }
+
+ GPUInfo::GPUDevice device;
+ device.vendor_id = system_info->gpus[i].vendorId;
+ device.device_id = system_info->gpus[i].deviceId;
+
+ gpu_info->secondary_gpus.push_back(device);
+ }
+
+ gpu_info->optimus = system_info->isOptimus;
+ gpu_info->amd_switchable = system_info->isAMDSwitchable;
+
+ gpu_info->machine_model_name = system_info->machineModelName;
+ gpu_info->machine_model_version = system_info->machineModelVersion;
+}
+
} // namespace gpu
« no previous file with comments | « gpu/config/gpu_info_collector.h ('k') | gpu/config/gpu_info_collector_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698