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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // crash. | 299 // crash. |
300 // By skipping the following code on Mac, we don't really lose anything, | 300 // By skipping the following code on Mac, we don't really lose anything, |
301 // because the basic GPU information is passed down from browser process | 301 // because the basic GPU information is passed down from browser process |
302 // and we already registered them through SetGpuInfo() above. | 302 // and we already registered them through SetGpuInfo() above. |
303 base::TimeTicks before_collect_context_graphics_info = | 303 base::TimeTicks before_collect_context_graphics_info = |
304 base::TimeTicks::Now(); | 304 base::TimeTicks::Now(); |
305 #if !defined(OS_MACOSX) | 305 #if !defined(OS_MACOSX) |
306 if (!CollectGraphicsInfo(gpu_info)) | 306 if (!CollectGraphicsInfo(gpu_info)) |
307 dead_on_arrival = true; | 307 dead_on_arrival = true; |
308 | 308 |
309 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_LINUX) | |
310 // Recompute gpu driver bug workarounds. | 309 // Recompute gpu driver bug workarounds. |
311 // This is necessary on systems where vendor_id/device_id aren't available | 310 // This is necessary on systems where vendor_id/device_id aren't available |
312 // (Chrome OS, Android) or where workarounds may be dependent on GL_VENDOR | 311 // (Chrome OS, Android) or where workarounds may be dependent on GL_VENDOR |
313 // and GL_RENDERER strings which are lazily computed (Linux). | 312 // and GL_RENDERER strings which are lazily computed (Linux). |
314 if (!command_line.HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { | 313 if (!command_line.HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { |
315 // TODO: this can not affect disabled extensions, since they're already | 314 // TODO: this can not affect disabled extensions, since they're already |
316 // initialized in the bindings. This should be moved before bindings | 315 // initialized in the bindings. This should be moved before bindings |
317 // initialization. However, populating GPUInfo fully works only on | 316 // initialization. However, populating GPUInfo fully works only on |
318 // Android. Other platforms would need the bindings to query GL strings. | 317 // Android. Other platforms would need the bindings to query GL strings. |
319 gpu::ApplyGpuDriverBugWorkarounds( | 318 gpu::ApplyGpuDriverBugWorkarounds( |
320 gpu_info, const_cast<base::CommandLine*>(&command_line)); | 319 gpu_info, const_cast<base::CommandLine*>(&command_line)); |
321 } | 320 } |
322 #endif | |
323 | 321 |
324 #if defined(OS_LINUX) | 322 #if defined(OS_LINUX) |
325 initialized_gl_context = true; | 323 initialized_gl_context = true; |
326 #if !defined(OS_CHROMEOS) | 324 #if !defined(OS_CHROMEOS) |
327 if (gpu_info.gpu.vendor_id == 0x10de && // NVIDIA | 325 if (gpu_info.gpu.vendor_id == 0x10de && // NVIDIA |
328 gpu_info.driver_vendor == "NVIDIA" && | 326 gpu_info.driver_vendor == "NVIDIA" && |
329 !CanAccessNvidiaDeviceFile()) | 327 !CanAccessNvidiaDeviceFile()) |
330 dead_on_arrival = true; | 328 dead_on_arrival = true; |
331 #endif // !defined(OS_CHROMEOS) | 329 #endif // !defined(OS_CHROMEOS) |
332 #endif // defined(OS_LINUX) | 330 #endif // defined(OS_LINUX) |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 &gpu_info.gpu.vendor_id); | 429 &gpu_info.gpu.vendor_id); |
432 DCHECK(success); | 430 DCHECK(success); |
433 success = base::HexStringToUInt( | 431 success = base::HexStringToUInt( |
434 command_line.GetSwitchValueASCII(switches::kGpuDeviceID), | 432 command_line.GetSwitchValueASCII(switches::kGpuDeviceID), |
435 &gpu_info.gpu.device_id); | 433 &gpu_info.gpu.device_id); |
436 DCHECK(success); | 434 DCHECK(success); |
437 gpu_info.driver_vendor = | 435 gpu_info.driver_vendor = |
438 command_line.GetSwitchValueASCII(switches::kGpuDriverVendor); | 436 command_line.GetSwitchValueASCII(switches::kGpuDriverVendor); |
439 gpu_info.driver_version = | 437 gpu_info.driver_version = |
440 command_line.GetSwitchValueASCII(switches::kGpuDriverVersion); | 438 command_line.GetSwitchValueASCII(switches::kGpuDriverVersion); |
| 439 gpu_info.driver_date = |
| 440 command_line.GetSwitchValueASCII(switches::kGpuDriverDate); |
441 gpu::ParseSecondaryGpuDevicesFromCommandLine(command_line, &gpu_info); | 441 gpu::ParseSecondaryGpuDevicesFromCommandLine(command_line, &gpu_info); |
442 | 442 |
443 // Set active gpu device. | 443 // Set active gpu device. |
444 if (command_line.HasSwitch(switches::kGpuActiveVendorID) && | 444 if (command_line.HasSwitch(switches::kGpuActiveVendorID) && |
445 command_line.HasSwitch(switches::kGpuActiveDeviceID)) { | 445 command_line.HasSwitch(switches::kGpuActiveDeviceID)) { |
446 uint32_t active_vendor_id = 0; | 446 uint32_t active_vendor_id = 0; |
447 uint32_t active_device_id = 0; | 447 uint32_t active_device_id = 0; |
448 success = base::HexStringToUInt( | 448 success = base::HexStringToUInt( |
449 command_line.GetSwitchValueASCII(switches::kGpuActiveVendorID), | 449 command_line.GetSwitchValueASCII(switches::kGpuActiveVendorID), |
450 &active_vendor_id); | 450 &active_vendor_id); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 return true; | 610 return true; |
611 } | 611 } |
612 | 612 |
613 return false; | 613 return false; |
614 } | 614 } |
615 #endif // defined(OS_WIN) | 615 #endif // defined(OS_WIN) |
616 | 616 |
617 } // namespace. | 617 } // namespace. |
618 | 618 |
619 } // namespace content | 619 } // namespace content |
OLD | NEW |