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

Side by Side Diff: gpu/config/gpu_info_collector_win.cc

Issue 333683004: Revert of Use the updated AMD switchable info collection code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gpu/config/gpu_info_collector.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/config/gpu_info_collector.h" 5 #include "gpu/config/gpu_info_collector.h"
6 6
7 // This has to be included before windows.h. 7 // This has to be included before windows.h.
8 #include "third_party/re2/re2/re2.h" 8 #include "third_party/re2/re2/re2.h"
9 9
10 #include <windows.h> 10 #include <windows.h>
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 void CollectD3D11Support() { 356 void CollectD3D11Support() {
357 // D3D11 takes about 50ms to initialize so do this on a worker thread. 357 // D3D11 takes about 50ms to initialize so do this on a worker thread.
358 base::WorkerPool::PostTask( 358 base::WorkerPool::PostTask(
359 FROM_HERE, 359 FROM_HERE,
360 base::Bind(CollectD3D11SupportOnWorkerThread), 360 base::Bind(CollectD3D11SupportOnWorkerThread),
361 false); 361 false);
362 } 362 }
363 } // namespace anonymous 363 } // namespace anonymous
364 364
365 #if !defined(GOOGLE_CHROME_BUILD) 365 #if !defined(GOOGLE_CHROME_BUILD)
366 void GetAMDVideocardInfo(GPUInfo* gpu_info) { 366 AMDVideoCardType GetAMDVideocardType() {
367 DCHECK(gpu_info); 367 return STANDALONE;
368 return;
369 } 368 }
370 #else 369 #else
371 // This function has a real implementation for official builds that can 370 // This function has a real implementation for official builds that can
372 // be found in src/third_party/amd. 371 // be found in src/third_party/amd.
373 void GetAMDVideocardInfo(GPUInfo* gpu_info); 372 AMDVideoCardType GetAMDVideocardType();
374 #endif 373 #endif
375 374
376 bool CollectDriverInfoD3D(const std::wstring& device_id, 375 bool CollectDriverInfoD3D(const std::wstring& device_id,
377 GPUInfo* gpu_info) { 376 GPUInfo* gpu_info) {
378 TRACE_EVENT0("gpu", "CollectDriverInfoD3D"); 377 TRACE_EVENT0("gpu", "CollectDriverInfoD3D");
379 378
380 // create device info for the display device 379 // create device info for the display device
381 HDEVINFO device_info = SetupDiGetClassDevsW( 380 HDEVINFO device_info = SetupDiGetClassDevsW(
382 NULL, device_id.c_str(), NULL, 381 NULL, device_id.c_str(), NULL,
383 DIGCF_PRESENT | DIGCF_PROFILE | DIGCF_ALLCLASSES); 382 DIGCF_PRESENT | DIGCF_PROFILE | DIGCF_ALLCLASSES);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 key, L"ProviderName", NULL, NULL, 426 key, L"ProviderName", NULL, NULL,
428 reinterpret_cast<LPBYTE>(value), &dwcb_data); 427 reinterpret_cast<LPBYTE>(value), &dwcb_data);
429 if (result == ERROR_SUCCESS) { 428 if (result == ERROR_SUCCESS) {
430 driver_vendor = base::UTF16ToASCII(std::wstring(value)); 429 driver_vendor = base::UTF16ToASCII(std::wstring(value));
431 if (driver_vendor == "Advanced Micro Devices, Inc." || 430 if (driver_vendor == "Advanced Micro Devices, Inc." ||
432 driver_vendor == "ATI Technologies Inc.") { 431 driver_vendor == "ATI Technologies Inc.") {
433 // We are conservative and assume that in the absence of a clear 432 // We are conservative and assume that in the absence of a clear
434 // signal the videocard is assumed to be switchable. Additionally, 433 // signal the videocard is assumed to be switchable. Additionally,
435 // some switchable systems with Intel GPUs aren't correctly 434 // some switchable systems with Intel GPUs aren't correctly
436 // detected, so always count them. 435 // detected, so always count them.
437 GetAMDVideocardInfo(gpu_info); 436 AMDVideoCardType amd_card_type = GetAMDVideocardType();
438 if (!gpu_info->amd_switchable && 437 gpu_info->amd_switchable = (gpu_info->gpu.vendor_id == 0x8086) ||
439 gpu_info->gpu.vendor_id == 0x8086) { 438 (amd_card_type != STANDALONE);
440 gpu_info->amd_switchable = true;
441 gpu_info->secondary_gpus.push_back(gpu_info->gpu);
442 gpu_info->gpu.vendor_id = 0x1002;
443 gpu_info->gpu.device_id = 0; // Unknown discrete AMD GPU.
444 }
445 } 439 }
446 } 440 }
447 441
448 gpu_info->driver_vendor = driver_vendor; 442 gpu_info->driver_vendor = driver_vendor;
449 gpu_info->driver_version = driver_version; 443 gpu_info->driver_version = driver_version;
450 gpu_info->driver_date = driver_date; 444 gpu_info->driver_date = driver_date;
451 found = true; 445 found = true;
452 RegCloseKey(key); 446 RegCloseKey(key);
453 break; 447 break;
454 } 448 }
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 basic_gpu_info->software_rendering = true; 647 basic_gpu_info->software_rendering = true;
654 return; 648 return;
655 } 649 }
656 650
657 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); 651 MergeGPUInfoGL(basic_gpu_info, context_gpu_info);
658 652
659 basic_gpu_info->dx_diagnostics = context_gpu_info.dx_diagnostics; 653 basic_gpu_info->dx_diagnostics = context_gpu_info.dx_diagnostics;
660 } 654 }
661 655
662 } // namespace gpu 656 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/config/gpu_info_collector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698