summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-07 01:34:33 +0000
committerjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-07 01:34:33 +0000
commitc32b0c2ccd74235797224952e3944ad5397db4fa (patch)
treefc664de25ff798f2d19891901683fd142329626c
parent573889f2660f7a961adac4b81caf632a467f2134 (diff)
downloadchromium_src-c32b0c2ccd74235797224952e3944ad5397db4fa.zip
chromium_src-c32b0c2ccd74235797224952e3944ad5397db4fa.tar.gz
chromium_src-c32b0c2ccd74235797224952e3944ad5397db4fa.tar.bz2
Disable image transport surface on AMD's dynamic switchable graphics.
It was only displaying black if set to use the AMD chip. BUG=117371 TEST= Review URL: https://chromiumcodereview.appspot.com/9968074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131225 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/gpu_util.cc2
-rw-r--r--content/browser/gpu/gpu_data_manager_impl.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
5 files changed, 29 insertions, 0 deletions
diff --git a/chrome/browser/gpu_util.cc b/chrome/browser/gpu_util.cc
index b6f41d94..774fc90 100644
--- a/chrome/browser/gpu_util.cc
+++ b/chrome/browser/gpu_util.cc
@@ -341,6 +341,8 @@ DictionaryValue* GpuInfoAsDictionaryValue() {
"Device Id", base::StringPrintf("0x%04x", gpu_info.device_id)));
basic_info->Append(NewDescriptionValuePair(
"Optimus", Value::CreateBooleanValue(gpu_info.optimus)));
+ basic_info->Append(NewDescriptionValuePair(
+ "AMD switchable", Value::CreateBooleanValue(gpu_info.amd_switchable)));
basic_info->Append(NewDescriptionValuePair("Driver vendor",
gpu_info.driver_vendor));
basic_info->Append(NewDescriptionValuePair("Driver version",
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
index 76b239d..4f705b1 100644
--- a/content/browser/gpu/gpu_data_manager_impl.cc
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
@@ -207,6 +207,12 @@ void GpuDataManagerImpl::AppendGpuCommandLine(
base::AutoLock auto_lock(gpu_info_lock_);
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);
+ }
}
}
@@ -296,6 +302,7 @@ bool GpuDataManagerImpl::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 c56d5868..5fba37e 100644
--- a/content/gpu/gpu_info_collector_win.cc
+++ b/content/gpu/gpu_info_collector_win.cc
@@ -288,6 +288,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 552db8b..03e33a5 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 085878c..820ce23 100644
--- a/content/public/common/gpu_info.h
+++ b/content/public/common/gpu_info.h
@@ -34,6 +34,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;