Commit 2269f0f6 authored by zmo@chromium.org's avatar zmo@chromium.org

Use the updated AMD switchable info collection code.

BUG=376562
TEST=
R=kbr@chromium.org

Review URL: https://codereview.chromium.org/332843003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276865 0039d316-1c4b-4281-b951-d872f2087c98
parent 8f7f2988
...@@ -66,6 +66,8 @@ GPU_EXPORT void MergeGPUInfoGL(GPUInfo* basic_gpu_info, ...@@ -66,6 +66,8 @@ GPU_EXPORT void MergeGPUInfoGL(GPUInfo* basic_gpu_info,
// Advanced Micro Devices has interesting configurations on laptops were // Advanced Micro Devices has interesting configurations on laptops were
// there are two videocards that can alternatively a given process output. // there are two videocards that can alternatively a given process output.
// TODO(zmo): remove them when we remove the GetAMDVideocardType() in the
// internal src/third_party/amd.
enum AMDVideoCardType { enum AMDVideoCardType {
UNKNOWN, UNKNOWN,
STANDALONE, STANDALONE,
......
...@@ -363,13 +363,14 @@ void CollectD3D11Support() { ...@@ -363,13 +363,14 @@ void CollectD3D11Support() {
} // namespace anonymous } // namespace anonymous
#if !defined(GOOGLE_CHROME_BUILD) #if !defined(GOOGLE_CHROME_BUILD)
AMDVideoCardType GetAMDVideocardType() { void GetAMDVideocardInfo(GPUInfo* gpu_info) {
return STANDALONE; DCHECK(gpu_info);
return;
} }
#else #else
// This function has a real implementation for official builds that can // This function has a real implementation for official builds that can
// be found in src/third_party/amd. // be found in src/third_party/amd.
AMDVideoCardType GetAMDVideocardType(); void GetAMDVideocardInfo(GPUInfo* gpu_info);
#endif #endif
bool CollectDriverInfoD3D(const std::wstring& device_id, bool CollectDriverInfoD3D(const std::wstring& device_id,
...@@ -433,9 +434,14 @@ bool CollectDriverInfoD3D(const std::wstring& device_id, ...@@ -433,9 +434,14 @@ bool CollectDriverInfoD3D(const std::wstring& device_id,
// signal the videocard is assumed to be switchable. Additionally, // signal the videocard is assumed to be switchable. Additionally,
// some switchable systems with Intel GPUs aren't correctly // some switchable systems with Intel GPUs aren't correctly
// detected, so always count them. // detected, so always count them.
AMDVideoCardType amd_card_type = GetAMDVideocardType(); GetAMDVideocardInfo(gpu_info);
gpu_info->amd_switchable = (gpu_info->gpu.vendor_id == 0x8086) || if (!gpu_info->amd_switchable &&
(amd_card_type != STANDALONE); gpu_info->gpu.vendor_id == 0x8086) {
gpu_info->amd_switchable = true;
gpu_info->secondary_gpus.push_back(gpu_info->gpu);
gpu_info->gpu.vendor_id = 0x1002;
gpu_info->gpu.device_id = 0; // Unknown discrete AMD GPU.
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment