summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-18 23:20:34 +0000
committercpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-18 23:20:34 +0000
commit965087284e07e1fe0add70ee1855aaea8719925c (patch)
tree313cae8cdbabc24beb7ca5c44d6bf2f360632716
parentdc80c651db52a42dc3b71bd5d34287951a5f2f36 (diff)
downloadchromium_src-965087284e07e1fe0add70ee1855aaea8719925c.zip
chromium_src-965087284e07e1fe0add70ee1855aaea8719925c.tar.gz
chromium_src-965087284e07e1fe0add70ee1855aaea8719925c.tar.bz2
Wire the AMD switchable videcard detection
So we don't bucket all AMD cards as crappy. BUG=117371 Review URL: https://chromiumcodereview.appspot.com/10790060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147334 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/content_gpu.gypi6
-rw-r--r--content/gpu/gpu_info_collector.h11
-rw-r--r--content/gpu/gpu_info_collector_win.cc23
-rw-r--r--gpu/DEPS1
4 files changed, 34 insertions, 7 deletions
diff --git a/content/content_gpu.gypi b/content/content_gpu.gypi
index 50094a9..0145096 100644
--- a/content/content_gpu.gypi
+++ b/content/content_gpu.gypi
@@ -89,6 +89,12 @@
},
],
}],
+ ['OS=="win" and buildtype=="Official"', {
+ 'sources': [
+ '../third_party/amd/AmdCfxPxExt.h',
+ '../third_party/amd/amd_videocard_info_win.cc',
+ ],
+ }],
['OS=="linux"', {
'dependencies': [
'../third_party/libXNVCtrl/libXNVCtrl.gyp:libXNVCtrl',
diff --git a/content/gpu/gpu_info_collector.h b/content/gpu/gpu_info_collector.h
index 10cf2bf..6a5fa43 100644
--- a/content/gpu/gpu_info_collector.h
+++ b/content/gpu/gpu_info_collector.h
@@ -41,7 +41,7 @@ CONTENT_EXPORT bool CollectDriverInfoD3D(const std::wstring& device_id,
// Collect the DirectX Disagnostics information about the attached displays.
bool GetDxDiagnostics(content::DxDiagNode* output);
-#endif
+#endif // OS_WIN
// All platforms have a GL version for collecting information
CONTENT_EXPORT bool CollectGraphicsInfoGL(content::GPUInfo* gpu_info);
@@ -55,6 +55,15 @@ bool CollectVideoCardInfo(content::GPUInfo* gpu_info);
// Each platform stores the driver version on the GL_VERSION string differently
bool CollectDriverInfoGL(content::GPUInfo* gpu_info);
+// Advanced Micro Devices has interesting configurations on laptops were
+// there are two videocards that can alternatively a given process output.
+enum AMDVideoCardType {
+ UNKNOWN,
+ STANDALONE,
+ INTEGRATED,
+ SWITCHABLE
+};
+
} // namespace gpu_info_collector
#endif // CONTENT_GPU_GPU_INFO_COLLECTOR_H_
diff --git a/content/gpu/gpu_info_collector_win.cc b/content/gpu/gpu_info_collector_win.cc
index 6e28b51..fed4347 100644
--- a/content/gpu/gpu_info_collector_win.cc
+++ b/content/gpu/gpu_info_collector_win.cc
@@ -153,6 +153,16 @@ content::GpuPerformanceStats RetrieveGpuPerformanceStats() {
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 @@ bool CollectDriverInfoD3D(const std::wstring& device_id,
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;
diff --git a/gpu/DEPS b/gpu/DEPS
index a8804e4..a8cd23d 100644
--- a/gpu/DEPS
+++ b/gpu/DEPS
@@ -1,6 +1,7 @@
include_rules = [
"+native_client",
"+third_party/angle",
+ "+third_party/amd",
"+../../gpu_export.h",
"+../command_buffer",
"+../client",