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

Unified Diff: content/browser/gpu/gpu_data_manager_impl_private.cc

Issue 1874643003: Do not lose secondary gpus and make sure to have an active gpu on multiple gpu configurations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added use_testing_switches param to ParseSecondaryGpuDevicesFromCommandLine and added IdentifyActiv… Created 4 years, 8 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 | « no previous file | content/browser/gpu/gpu_process_host.cc » ('j') | content/gpu/gpu_main.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_data_manager_impl_private.cc
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
index ceb4500461f5f1894bab21d64e6f16f4f1220a48..c7cf1430f54628ff592a2d345ff454de29fb5e6c 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -544,6 +544,9 @@ void GpuDataManagerImplPrivate::Initialize() {
gpu_info.gpu.active = true;
gpu_info.secondary_gpus.clear();
}
+
+ gpu::ParseSecondaryGpuDevicesFromCommandLine(*command_line, true,
+ &gpu_info);
}
#if defined(ARCH_CPU_X86_FAMILY)
if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id) {
@@ -742,6 +745,24 @@ void GpuDataManagerImplPrivate::AppendGpuCommandLine(
gpu_info_.driver_vendor);
command_line->AppendSwitchASCII(switches::kGpuDriverVersion,
gpu_info_.driver_version);
+
+ std::string vendor_ids_str;
+ std::string device_ids_str;
+ for (const auto& device : gpu_info_.secondary_gpus) {
+ if (!vendor_ids_str.empty())
+ vendor_ids_str += ";";
+ if (!device_ids_str.empty())
+ device_ids_str += ";";
+ vendor_ids_str += base::StringPrintf("0x%04x", device.vendor_id);
+ device_ids_str += base::StringPrintf("0x%04x", device.device_id);
+ }
+
+ if (!vendor_ids_str.empty() && !device_ids_str.empty()) {
+ command_line->AppendSwitchASCII(switches::kGpuSecondaryVendorIDs,
+ vendor_ids_str);
+ command_line->AppendSwitchASCII(switches::kGpuSecondaryDeviceIDs,
+ device_ids_str);
+ }
}
void GpuDataManagerImplPrivate::UpdateRendererWebPrefs(
« no previous file with comments | « no previous file | content/browser/gpu/gpu_process_host.cc » ('j') | content/gpu/gpu_main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698