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

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

Issue 2725873007: gpu/config: Use angle::GetSystemInfo on Linux (Closed)
Patch Set: "Fix" gn check Created 3 years, 9 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
« no previous file with comments | « gpu/config/gpu_info_collector_ozone.cc ('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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <X11/Xlib.h>
6
7 #include "base/logging.h"
8 #include "gpu/config/gpu_info_collector_linux.h"
9 #include "third_party/libXNVCtrl/NVCtrl.h"
10 #include "third_party/libXNVCtrl/NVCtrlLib.h"
11 #include "ui/gfx/x/x11_types.h"
12
13 namespace gpu {
14
15 // Use NVCtrl extention to query NV driver version.
16 // Return empty string on failing.
17 std::string CollectDriverVersionNVidia() {
18 Display* display = gfx::GetXDisplay();
19 if (!display) {
20 LOG(ERROR) << "XOpenDisplay failed.";
21 return std::string();
22 }
23 int event_base = 0, error_base = 0;
24 if (!XNVCTRLQueryExtension(display, &event_base, &error_base)) {
25 VLOG(1) << "NVCtrl extension does not exist.";
26 return std::string();
27 }
28 int screen_count = ScreenCount(display);
29 for (int screen = 0; screen < screen_count; ++screen) {
30 char* buffer = NULL;
31 if (XNVCTRLIsNvScreen(display, screen) &&
32 XNVCTRLQueryStringAttribute(display, screen, 0,
33 NV_CTRL_STRING_NVIDIA_DRIVER_VERSION,
34 &buffer)) {
35 std::string driver_version(buffer);
36 XFree(buffer);
37 return driver_version;
38 }
39 }
40 return std::string();
41 }
42
43 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/config/gpu_info_collector_ozone.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698