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

Unified Diff: content/gpu/gpu_info_collector_win.cc

Issue 10790060: Wire the AMD switchable videcard detection (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | « content/gpu/gpu_info_collector.h ('k') | gpu/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/gpu_info_collector_win.cc
===================================================================
--- content/gpu/gpu_info_collector_win.cc (revision 147262)
+++ content/gpu/gpu_info_collector_win.cc (working copy)
@@ -153,6 +153,16 @@
namespace gpu_info_collector {
+#if !defined(OFFICIAL_BUILD)
+AMDVideoCardType GetAMDVideocardType() {
+ return UNKNOWN;
+}
+#else
+// This function has a real implementation for official builds that can
+// be found in src/third_party/amd.
+AMDVideoCardType GetAMDVideocardType();
+#endif
+
bool CollectGraphicsInfo(content::GPUInfo* gpu_info) {
TRACE_EVENT0("gpu", "CollectGraphicsInfo");
@@ -344,12 +354,13 @@
reinterpret_cast<LPBYTE>(value), &dwcb_data);
if (result == ERROR_SUCCESS) {
driver_vendor = WideToASCII(std::wstring(value));
- // If it's an Intel GPU with a driver provided by AMD then it's
- // probably AMD's Dynamic Switchable Graphics.
- // TODO: detect only AMD switchable
- gpu_info->amd_switchable =
- driver_vendor == "Advanced Micro Devices, Inc." ||
- driver_vendor == "ATI Technologies Inc.";
+ if (driver_vendor == "Advanced Micro Devices, Inc." ||
+ driver_vendor == "ATI Technologies Inc.") {
+ // We are conservative and assume that in the absense of a clear
+ // signal the videocard is assumed to be switchable.
+ AMDVideoCardType amd_card_type = GetAMDVideocardType();
+ gpu_info->amd_switchable = (amd_card_type != STANDALONE);
+ }
}
gpu_info->driver_vendor = driver_vendor;
« no previous file with comments | « content/gpu/gpu_info_collector.h ('k') | gpu/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698