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

Unified Diff: content/gpu/gpu_info_collector_win.cc

Issue 12632009: Merge 186345 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1410/src/
Patch Set: Created 7 years, 9 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/browser/gpu/gpu_internals_ui.cc ('k') | content/public/common/gpu_info.h » ('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 186765)
+++ content/gpu/gpu_info_collector_win.cc (working copy)
@@ -25,6 +25,7 @@
#include "base/string_number_conversions.h"
#include "base/string_util.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"
@@ -34,6 +35,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))
@@ -153,6 +162,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 {
@@ -477,6 +508,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);
« no previous file with comments | « content/browser/gpu/gpu_internals_ui.cc ('k') | content/public/common/gpu_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698