summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlaforge@chromium.org <laforge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-12 02:49:17 +0000
committerlaforge@chromium.org <laforge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-12 02:49:17 +0000
commit4006674a13210190fc4b31955ac5f7a02603e7e0 (patch)
treea03c59ad26c4f535b9e725a35e7fe0eed90c7b1b
parent9f35b8383ac2a5a74262ff5844dbcef2363c1041 (diff)
downloadchromium_src-4006674a13210190fc4b31955ac5f7a02603e7e0.zip
chromium_src-4006674a13210190fc4b31955ac5f7a02603e7e0.tar.gz
chromium_src-4006674a13210190fc4b31955ac5f7a02603e7e0.tar.bz2
Revert 131376 - Revert 130496 - Disable image transport surface on AMD GPUs
Was causing black screen. BUG=117371 Review URL: https://chromiumcodereview.appspot.com/9969135 TBR=jbauman@chromium.org Review URL: https://chromiumcodereview.appspot.com/9960035 TBR=laforge@chromium.org Review URL: https://chromiumcodereview.appspot.com/10066004 git-svn-id: svn://svn.chromium.org/chrome/branches/1025/src@131910 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/gpu/gpu_data_manager.cc7
-rw-r--r--content/gpu/gpu_info_collector_win.cc16
-rw-r--r--content/public/common/gpu_info.cc1
-rw-r--r--content/public/common/gpu_info.h3
4 files changed, 27 insertions, 0 deletions
diff --git a/content/browser/gpu/gpu_data_manager.cc b/content/browser/gpu/gpu_data_manager.cc
index d02569b..011f65f 100644
--- a/content/browser/gpu/gpu_data_manager.cc
+++ b/content/browser/gpu/gpu_data_manager.cc
@@ -507,6 +507,12 @@ void GpuDataManager::AppendGpuCommandLine(
if (gpu_info().optimus)
command_line->AppendSwitch(switches::kReduceGpuSandbox);
+ if (gpu_info().amd_switchable) {
+ // The image transport surface currently doesn't work with AMD Dynamic
+ // Switchable graphics.
+ command_line->AppendSwitch(switches::kReduceGpuSandbox);
+ command_line->AppendSwitch(switches::kDisableImageTransportSurface);
+ }
}
void GpuDataManager::SetGpuBlacklist(GpuBlacklist* gpu_blacklist) {
@@ -728,6 +734,7 @@ bool GpuDataManager::Merge(content::GPUInfo* object,
object->finalized = other.finalized;
object->initialization_time = other.initialization_time;
object->optimus |= other.optimus;
+ object->amd_switchable |= other.amd_switchable;
if (object->driver_vendor.empty()) {
changed |= object->driver_vendor != other.driver_vendor;
diff --git a/content/gpu/gpu_info_collector_win.cc b/content/gpu/gpu_info_collector_win.cc
index 1736f43..c19a19b 100644
--- a/content/gpu/gpu_info_collector_win.cc
+++ b/content/gpu/gpu_info_collector_win.cc
@@ -255,6 +255,22 @@ bool CollectDriverInfoD3D(const std::wstring& device_id,
if (result == ERROR_SUCCESS)
driver_date = WideToASCII(std::wstring(value));
+ std::string driver_vendor;
+ dwcb_data = sizeof(value);
+ result = RegQueryValueExW(
+ key, L"ProviderName", NULL, NULL,
+ 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.";
+ }
+
+ gpu_info->driver_vendor = driver_vendor;
gpu_info->driver_version = driver_version;
gpu_info->driver_date = driver_date;
found = true;
diff --git a/content/public/common/gpu_info.cc b/content/public/common/gpu_info.cc
index b4e17f6..2f47625 100644
--- a/content/public/common/gpu_info.cc
+++ b/content/public/common/gpu_info.cc
@@ -9,6 +9,7 @@ namespace content {
GPUInfo::GPUInfo()
: finalized(false),
optimus(false),
+ amd_switchable(false),
vendor_id(0),
device_id(0),
can_lose_context(false) {
diff --git a/content/public/common/gpu_info.h b/content/public/common/gpu_info.h
index cf4b8dc..ac248aa 100644
--- a/content/public/common/gpu_info.h
+++ b/content/public/common/gpu_info.h
@@ -33,6 +33,9 @@ struct CONTENT_EXPORT GPUInfo {
// Computer has NVIDIA Optimus
bool optimus;
+ // Computer has AMD Dynamic Switchable Graphics
+ bool amd_switchable;
+
// The DWORD (uint32) representing the graphics card vendor id.
uint32 vendor_id;