OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_linux.h" | 5 #include "gpu/config/gpu_info_collector_linux.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "ui/gl/gl_switches.h" | 24 #include "ui/gl/gl_switches.h" |
25 | 25 |
26 #if defined(USE_LIBPCI) | 26 #if defined(USE_LIBPCI) |
27 #include "library_loaders/libpci.h" | 27 #include "library_loaders/libpci.h" |
28 #endif | 28 #endif |
29 | 29 |
30 namespace gpu { | 30 namespace gpu { |
31 | 31 |
32 namespace { | 32 namespace { |
33 | 33 |
| 34 #if defined(USE_LIBPCI) |
34 // This checks if a system supports PCI bus. | 35 // This checks if a system supports PCI bus. |
35 // We check the existence of /sys/bus/pci or /sys/bug/pci_express. | 36 // We check the existence of /sys/bus/pci or /sys/bug/pci_express. |
36 bool IsPciSupported() { | 37 bool IsPciSupported() { |
37 const base::FilePath pci_path("/sys/bus/pci/"); | 38 const base::FilePath pci_path("/sys/bus/pci/"); |
38 const base::FilePath pcie_path("/sys/bus/pci_express/"); | 39 const base::FilePath pcie_path("/sys/bus/pci_express/"); |
39 return (base::PathExists(pci_path) || | 40 return (base::PathExists(pci_path) || |
40 base::PathExists(pcie_path)); | 41 base::PathExists(pcie_path)); |
41 } | 42 } |
| 43 #endif // defined(USE_LIBPCI) |
42 | 44 |
43 // Scan /etc/ati/amdpcsdb.default for "ReleaseVersion". | 45 // Scan /etc/ati/amdpcsdb.default for "ReleaseVersion". |
44 // Return empty string on failing. | 46 // Return empty string on failing. |
45 std::string CollectDriverVersionATI() { | 47 std::string CollectDriverVersionATI() { |
46 const base::FilePath::CharType kATIFileName[] = | 48 const base::FilePath::CharType kATIFileName[] = |
47 FILE_PATH_LITERAL("/etc/ati/amdpcsdb.default"); | 49 FILE_PATH_LITERAL("/etc/ati/amdpcsdb.default"); |
48 base::FilePath ati_file_path(kATIFileName); | 50 base::FilePath ati_file_path(kATIFileName); |
49 if (!base::PathExists(ati_file_path)) | 51 if (!base::PathExists(ati_file_path)) |
50 return std::string(); | 52 return std::string(); |
51 std::string contents; | 53 std::string contents; |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 gpu_info->driver_version = driver_version; | 264 gpu_info->driver_version = driver_version; |
263 return kCollectInfoSuccess; | 265 return kCollectInfoSuccess; |
264 } | 266 } |
265 | 267 |
266 void MergeGPUInfo(GPUInfo* basic_gpu_info, | 268 void MergeGPUInfo(GPUInfo* basic_gpu_info, |
267 const GPUInfo& context_gpu_info) { | 269 const GPUInfo& context_gpu_info) { |
268 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); | 270 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); |
269 } | 271 } |
270 | 272 |
271 } // namespace gpu | 273 } // namespace gpu |
OLD | NEW |