OLD | NEW |
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 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 GpuIDResult CollectGpuID(uint32* vendor_id, uint32* device_id) { | 202 GpuIDResult CollectGpuID(uint32* vendor_id, uint32* device_id) { |
203 DCHECK(vendor_id && device_id); | 203 DCHECK(vendor_id && device_id); |
204 *vendor_id = 0; | 204 *vendor_id = 0; |
205 *device_id = 0; | 205 *device_id = 0; |
206 | 206 |
207 GPUInfo gpu_info; | 207 GPUInfo gpu_info; |
208 if (CollectPCIVideoCardInfo(&gpu_info)) { | 208 if (CollectPCIVideoCardInfo(&gpu_info)) { |
209 *vendor_id = gpu_info.gpu.vendor_id; | 209 *vendor_id = gpu_info.gpu.vendor_id; |
210 *device_id = gpu_info.gpu.device_id; | 210 *device_id = gpu_info.gpu.device_id; |
211 return kGpuIDSuccess; | 211 if (*vendor_id != 0 && *device_id != 0) |
| 212 return kGpuIDSuccess; |
212 } | 213 } |
213 return kGpuIDFailure; | 214 return kGpuIDFailure; |
214 } | 215 } |
215 | 216 |
216 CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) { | 217 CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) { |
217 DCHECK(gpu_info); | 218 DCHECK(gpu_info); |
218 | 219 |
219 bool rt = CollectPCIVideoCardInfo(gpu_info); | 220 bool rt = CollectPCIVideoCardInfo(gpu_info); |
220 | 221 |
221 std::string driver_version; | 222 std::string driver_version; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 gpu_info->driver_version = driver_version; | 281 gpu_info->driver_version = driver_version; |
281 return kCollectInfoSuccess; | 282 return kCollectInfoSuccess; |
282 } | 283 } |
283 | 284 |
284 void MergeGPUInfo(GPUInfo* basic_gpu_info, | 285 void MergeGPUInfo(GPUInfo* basic_gpu_info, |
285 const GPUInfo& context_gpu_info) { | 286 const GPUInfo& context_gpu_info) { |
286 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); | 287 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); |
287 } | 288 } |
288 | 289 |
289 } // namespace gpu | 290 } // namespace gpu |
OLD | NEW |