diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-12 03:47:08 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-12 03:47:08 +0000 |
commit | 68852bdf95b0a8a4d7dfc70578caa503f49f3dbf (patch) | |
tree | 23d0c6a1e787d53136004590f68fe11567516952 | |
parent | 0158ac1f5d29789b7ca5cf022083b7c70abec368 (diff) | |
download | chromium_src-68852bdf95b0a8a4d7dfc70578caa503f49f3dbf.zip chromium_src-68852bdf95b0a8a4d7dfc70578caa503f49f3dbf.tar.gz chromium_src-68852bdf95b0a8a4d7dfc70578caa503f49f3dbf.tar.bz2 |
Windows: Detect whether Lenovo dCute is installed.
The associated Thinkpad USB Port Replicator driver can crash on GPU process startup.
This patch is just to detect it and note its presence in about:gpu. The fix for the crash itself will be separate.
BUG=181665
Review URL: https://chromiumcodereview.appspot.com/12566026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187478 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/browser/gpu/gpu_internals_ui.cc | 4 | ||||
-rw-r--r-- | content/common/gpu/gpu_messages.h | 1 | ||||
-rw-r--r-- | content/gpu/gpu_info_collector_win.cc | 20 | ||||
-rw-r--r-- | content/public/common/gpu_info.cc | 1 | ||||
-rw-r--r-- | content/public/common/gpu_info.h | 4 |
5 files changed, 30 insertions, 0 deletions
diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc index 6828793..6170b00 100644 --- a/content/browser/gpu/gpu_internals_ui.cc +++ b/content/browser/gpu/gpu_internals_ui.cc @@ -125,6 +125,10 @@ base::DictionaryValue* GpuInfoAsDictionaryValue() { "Optimus", new base::FundamentalValue(gpu_info.optimus))); basic_info->Append(NewDescriptionValuePair( "AMD switchable", new base::FundamentalValue(gpu_info.amd_switchable))); + if (gpu_info.lenovo_dcute) { + basic_info->Append(NewDescriptionValuePair( + "Lenovo dCute", new base::FundamentalValue(true))); + } if (gpu_info.display_link_version.IsValid()) { basic_info->Append(NewDescriptionValuePair( "DisplayLink Version", gpu_info.display_link_version.GetString())); diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h index feef8e8..4cf7613 100644 --- a/content/common/gpu/gpu_messages.h +++ b/content/common/gpu/gpu_messages.h @@ -134,6 +134,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::GPUInfo) IPC_STRUCT_TRAITS_MEMBER(initialization_time) IPC_STRUCT_TRAITS_MEMBER(optimus) IPC_STRUCT_TRAITS_MEMBER(amd_switchable) + IPC_STRUCT_TRAITS_MEMBER(lenovo_dcute) IPC_STRUCT_TRAITS_MEMBER(gpu) IPC_STRUCT_TRAITS_MEMBER(secondary_gpus) IPC_STRUCT_TRAITS_MEMBER(driver_vendor) diff --git a/content/gpu/gpu_info_collector_win.cc b/content/gpu/gpu_info_collector_win.cc index 3123eb39..51e1762 100644 --- a/content/gpu/gpu_info_collector_win.cc +++ b/content/gpu/gpu_info_collector_win.cc @@ -185,6 +185,24 @@ Version DisplayLinkVersion() { return Version(WideToASCII(version)); } + +// Returns whether Lenovo dCute is installed. +bool IsLenovoDCuteInstalled() { + base::win::RegKey key; + + if (FAILED(key.Open( + HKEY_LOCAL_MACHINE, L"SOFTWARE", KEY_READ | KEY_WOW64_64KEY))) { + return false; + } + + if (FAILED(key.OpenKey(L"Lenovo", KEY_READ | KEY_WOW64_64KEY))) + return false; + + if (FAILED(key.OpenKey(L"Lenovo dCute", KEY_READ | KEY_WOW64_64KEY))) + return false; + + return true; +} } // namespace anonymous namespace gpu_info_collector { @@ -515,6 +533,8 @@ bool CollectBasicGraphicsInfo(content::GPUInfo* gpu_info) { HMODULE nvd3d9wrap = GetModuleHandleW(L"nvd3d9wrap.dll"); gpu_info->optimus = nvd3d9wrap != NULL; + gpu_info->lenovo_dcute = IsLenovoDCuteInstalled(); + gpu_info->display_link_version = DisplayLinkVersion(); if (!gpu_info->display_link_version .IsValid()) { diff --git a/content/public/common/gpu_info.cc b/content/public/common/gpu_info.cc index 130732f..752abc4 100644 --- a/content/public/common/gpu_info.cc +++ b/content/public/common/gpu_info.cc @@ -17,6 +17,7 @@ GPUInfo::GPUInfo() : finalized(false), optimus(false), amd_switchable(false), + lenovo_dcute(false), can_lose_context(false), gpu_accessible(true), software_rendering(false), diff --git a/content/public/common/gpu_info.h b/content/public/common/gpu_info.h index a7867ab..2f0c11e 100644 --- a/content/public/common/gpu_info.h +++ b/content/public/common/gpu_info.h @@ -56,7 +56,11 @@ struct CONTENT_EXPORT GPUInfo { // Computer has AMD Dynamic Switchable Graphics bool amd_switchable; + // Lenovo dCute is installed. http://crbug.com/181665. + bool lenovo_dcute; + // Version of DisplayLink driver installed. Zero if not installed. + // http://crbug.com/177611. Version display_link_version; // Primary GPU, for exmaple, the discrete GPU in a dual GPU machine. |