| Index: content/gpu/gpu_info_collector_win.cc
|
| ===================================================================
|
| --- content/gpu/gpu_info_collector_win.cc (revision 186234)
|
| +++ content/gpu/gpu_info_collector_win.cc (working copy)
|
| @@ -26,6 +26,7 @@
|
| #include "base/stringprintf.h"
|
| #include "base/threading/thread.h"
|
| #include "base/threading/worker_pool.h"
|
| +#include "base/win/registry.h"
|
| #include "base/win/scoped_com_initializer.h"
|
| #include "base/win/scoped_comptr.h"
|
| #include "base/win/windows_version.h"
|
| @@ -35,6 +36,14 @@
|
|
|
| namespace {
|
|
|
| +// This must be kept in sync with histograms.xml.
|
| +enum DisplayLinkInstallationStatus {
|
| + DISPLAY_LINK_NOT_INSTALLED,
|
| + DISPLAY_LINK_7_1_OR_EARLIER,
|
| + DISPLAY_LINK_7_2_OR_LATER,
|
| + DISPLAY_LINK_INSTALLATION_STATUS_MAX
|
| +};
|
| +
|
| float ReadXMLFloatValue(XmlReader* reader) {
|
| std::string score_string;
|
| if (!reader->ReadElementContent(&score_string))
|
| @@ -154,6 +163,28 @@
|
| return stats;
|
| }
|
|
|
| +// Returns the display link driver version or an invalid version if it is
|
| +// not installed.
|
| +Version DisplayLinkVersion() {
|
| + base::win::RegKey key;
|
| +
|
| + if (FAILED(key.Open(
|
| + HKEY_LOCAL_MACHINE, L"SOFTWARE", KEY_READ | KEY_WOW64_64KEY))) {
|
| + return Version();
|
| + }
|
| +
|
| + if (FAILED(key.OpenKey(L"DisplayLink", KEY_READ | KEY_WOW64_64KEY)))
|
| + return Version();
|
| +
|
| + if (FAILED(key.OpenKey(L"Core", KEY_READ | KEY_WOW64_64KEY)))
|
| + return Version();
|
| +
|
| + string16 version;
|
| + if (FAILED(key.ReadValue(L"Version", &version)))
|
| + return Version();
|
| +
|
| + return Version(WideToASCII(version));
|
| +}
|
| } // namespace anonymous
|
|
|
| namespace gpu_info_collector {
|
| @@ -484,6 +515,22 @@
|
| HMODULE nvd3d9wrap = GetModuleHandleW(L"nvd3d9wrap.dll");
|
| gpu_info->optimus = nvd3d9wrap != NULL;
|
|
|
| + gpu_info->display_link_version = DisplayLinkVersion();
|
| +
|
| + if (!gpu_info->display_link_version .IsValid()) {
|
| + UMA_HISTOGRAM_ENUMERATION("GPU.DisplayLinkInstallationStatus",
|
| + DISPLAY_LINK_NOT_INSTALLED,
|
| + DISPLAY_LINK_INSTALLATION_STATUS_MAX);
|
| + } else if (gpu_info->display_link_version.IsOlderThan("7.2")) {
|
| + UMA_HISTOGRAM_ENUMERATION("GPU.DisplayLinkInstallationStatus",
|
| + DISPLAY_LINK_7_1_OR_EARLIER,
|
| + DISPLAY_LINK_INSTALLATION_STATUS_MAX);
|
| + } else {
|
| + UMA_HISTOGRAM_ENUMERATION("GPU.DisplayLinkInstallationStatus",
|
| + DISPLAY_LINK_7_2_OR_LATER,
|
| + DISPLAY_LINK_INSTALLATION_STATUS_MAX);
|
| + }
|
| +
|
| // Taken from http://developer.nvidia.com/object/device_ids.html
|
| DISPLAY_DEVICE dd;
|
| dd.cb = sizeof(DISPLAY_DEVICE);
|
|
|