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

Unified Diff: gpu/config/gpu_util.cc

Issue 2312173003: gpu: Unify code to initialize dual-gpu mode. (Closed)
Patch Set: . Created 4 years, 3 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_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/config/gpu_util.cc
diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
index 995c87c7e44c327e745c35a3c55b2ba6e14b9cfd..e27c292fecf6256c352ed0e2dfb4705547d0e2d7 100644
--- a/gpu/config/gpu_util.cc
+++ b/gpu/config/gpu_util.cc
@@ -17,6 +17,7 @@
#include "gpu/config/gpu_info_collector.h"
#include "gpu/config/gpu_switches.h"
#include "ui/gl/gl_switches.h"
+#include "ui/gl/gpu_switching_manager.h"
namespace gpu {
@@ -145,4 +146,16 @@ void ParseSecondaryGpuDevicesFromCommandLine(
}
}
+void InitializeDualGpusIfSupported(
+ const std::set<int>& driver_bug_workarounds) {
+ ui::GpuSwitchingManager* switching_manager =
+ ui::GpuSwitchingManager::GetInstance();
+ if (!switching_manager->SupportsDualGpus())
+ return;
+ if (driver_bug_workarounds.count(gpu::FORCE_DISCRETE_GPU) == 1)
+ ui::GpuSwitchingManager::GetInstance()->ForceUseOfDiscreteGpu();
+ else if (driver_bug_workarounds.count(gpu::FORCE_INTEGRATED_GPU) == 1)
+ ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu();
+}
+
} // namespace gpu
« no previous file with comments | « gpu/config/gpu_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698