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

Side by Side Diff: chrome/gpu/gpu_info_collector_linux.cc

Issue 6531023: Collect as much GPU information as possible without creating a GL/D3D context... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: For the records Created 9 years, 10 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 | « chrome/gpu/gpu_info_collector.h ('k') | chrome/gpu/gpu_info_collector_mac.mm » ('j') | 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) 2006-2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2010 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 "chrome/gpu/gpu_info_collector.h" 5 #include "chrome/gpu/gpu_info_collector.h"
6 6
7 #include <dlfcn.h> 7 #include <dlfcn.h>
8 #include <vector> 8 #include <vector>
9 9
10 #include "app/gfx/gl/gl_bindings.h" 10 #include "app/gfx/gl/gl_bindings.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 DCHECK(gpu_info); 130 DCHECK(gpu_info);
131 131
132 // TODO(zmo): need to consider the case where we are running on top of 132 // TODO(zmo): need to consider the case where we are running on top of
133 // desktop GL and GL_ARB_robustness extension is available. 133 // desktop GL and GL_ARB_robustness extension is available.
134 gpu_info->SetCanLoseContext( 134 gpu_info->SetCanLoseContext(
135 gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2); 135 gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2);
136 gpu_info->SetLevel(GPUInfo::kComplete); 136 gpu_info->SetLevel(GPUInfo::kComplete);
137 return CollectGraphicsInfoGL(gpu_info); 137 return CollectGraphicsInfoGL(gpu_info);
138 } 138 }
139 139
140 bool CollectPreliminaryGraphicsInfo(GPUInfo* gpu_info) {
141 DCHECK(gpu_info);
142
143 gpu_info->SetLevel(GPUInfo::kPartial);
144
145 bool rt = true;
146 if (!CollectVideoCardInfo(gpu_info))
147 rt = false;
148
149 // TODO(zmo): if vendor is ATI, consider passing /etc/ati/amdpcsdb.default
150 // for driver information.
151
152 return rt;
153 }
154
140 bool CollectVideoCardInfo(GPUInfo* gpu_info) { 155 bool CollectVideoCardInfo(GPUInfo* gpu_info) {
141 DCHECK(gpu_info); 156 DCHECK(gpu_info);
142 157
143 // TODO(zmo): be more flexible about library name. 158 // TODO(zmo): be more flexible about library name.
144 PciInterface* interface = InitializeLibPci("libpci.so.3"); 159 PciInterface* interface = InitializeLibPci("libpci.so.3");
145 if (interface == NULL) 160 if (interface == NULL)
146 return false; 161 return false;
147 162
148 PciAccess* access = (interface->pci_alloc)(); 163 PciAccess* access = (interface->pci_alloc)();
149 DCHECK(access != NULL); 164 DCHECK(access != NULL);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 if (pos == 0) 248 if (pos == 0)
234 return false; 249 return false;
235 if (pos != std::string::npos) 250 if (pos != std::string::npos)
236 driver_version = driver_version.substr(0, pos); 251 driver_version = driver_version.substr(0, pos);
237 252
238 gpu_info->SetDriverInfo(pieces[1], driver_version); 253 gpu_info->SetDriverInfo(pieces[1], driver_version);
239 return true; 254 return true;
240 } 255 }
241 256
242 } // namespace gpu_info_collector 257 } // namespace gpu_info_collector
OLDNEW
« no previous file with comments | « chrome/gpu/gpu_info_collector.h ('k') | chrome/gpu/gpu_info_collector_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698