summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-21 01:18:21 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-21 01:18:21 +0000
commite2827d03c170101a3bb827739da06aae02f0b291 (patch)
tree24bb22c38fd0c9ed627bff63aaa82c4f3a372c10
parente89744ef0965568d3e5ca1fbbfb267f094f6f9cc (diff)
downloadchromium_src-e2827d03c170101a3bb827739da06aae02f0b291.zip
chromium_src-e2827d03c170101a3bb827739da06aae02f0b291.tar.gz
chromium_src-e2827d03c170101a3bb827739da06aae02f0b291.tar.bz2
Revert 143323 - Use nv contrl x extension to query nvidia driver version.
[Failed checkdeps. No try jobs?!? Nice.] So we can do it in browser process, not wait until gpu process launches and a gl context is created. This is tested on my linux box with NVIDIA driver. We need to put more code to tell chrome (Linux/NVIDIA) that we have enough information for blacklisting, so at GPU launch time we don't need to collect GPUInfo. Will do it in a followup CL. BUG=122912 TEST=tree green TBR=jam Review URL: https://chromiumcodereview.appspot.com/10536232 TBR=zmo@chromium.org Review URL: https://chromiumcodereview.appspot.com/10606005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143325 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/content_gpu.gypi5
-rw-r--r--content/gpu/gpu_info_collector_linux.cc55
2 files changed, 6 insertions, 54 deletions
diff --git a/content/content_gpu.gypi b/content/content_gpu.gypi
index 6d9d587..b98d991 100644
--- a/content/content_gpu.gypi
+++ b/content/content_gpu.gypi
@@ -90,10 +90,5 @@
},
],
}],
- ['OS=="linux"', {
- 'dependencies': [
- '../third_party/libXNVCtrl/libXNVCtrl.gyp:libXNVCtrl',
- ],
- }],
],
}
diff --git a/content/gpu/gpu_info_collector_linux.cc b/content/gpu/gpu_info_collector_linux.cc
index 2916414..0c53478 100644
--- a/content/gpu/gpu_info_collector_linux.cc
+++ b/content/gpu/gpu_info_collector_linux.cc
@@ -5,7 +5,6 @@
#include "content/gpu/gpu_info_collector.h"
#include <dlfcn.h>
-#include <X11/Xlib.h>
#include <vector>
#include "base/command_line.h"
@@ -13,14 +12,10 @@
#include "base/file_util.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-#include "base/message_loop.h"
#include "base/string_piece.h"
#include "base/string_split.h"
#include "base/string_tokenizer.h"
#include "base/string_util.h"
-#include "content/public/browser/browser_thread.h"
-#include "third_party/libXNVCtrl/NVCtrl.h"
-#include "third_party/libXNVCtrl/NVCtrlLib.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_implementation.h"
@@ -170,33 +165,6 @@ std::string CollectDriverVersionATI() {
return "";
}
-// Use NVCtrl extention to query NV driver version.
-std::string CollectDriverVersionNVidia() {
- Display* display = base::MessagePumpForUI::GetDefaultXDisplay();
- if (!display) {
- LOG(ERROR) << "XOpenDisplay failed.";
- return "";
- }
- int event_base = 0, error_base = 0;
- if (!XNVCTRLQueryExtension(display, &event_base, &error_base)) {
- LOG(INFO) << "NVCtrl extension does not exits.";
- return "";
- }
- int screen_count = ScreenCount(display);
- for (int screen = 0; screen < screen_count; ++screen) {
- char* buffer = NULL;
- if (XNVCTRLIsNvScreen(display, screen) &&
- XNVCTRLQueryStringAttribute(display, screen, 0,
- NV_CTRL_STRING_NVIDIA_DRIVER_VERSION,
- &buffer)) {
- std::string driver_version(buffer);
- XFree(buffer);
- return driver_version;
- }
- }
- return "";
-}
-
const uint32 kVendorIDIntel = 0x8086;
const uint32 kVendorIDNVidia = 0x10de;
const uint32 kVendorIDAMD = 0x1002;
@@ -228,26 +196,15 @@ bool CollectGraphicsInfo(content::GPUInfo* gpu_info) {
bool CollectPreliminaryGraphicsInfo(content::GPUInfo* gpu_info) {
DCHECK(gpu_info);
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
bool rt = CollectVideoCardInfo(gpu_info);
- std::string driver_version;
- switch (gpu_info->gpu.vendor_id) {
- case kVendorIDAMD:
- driver_version = CollectDriverVersionATI();
- if (!driver_version.empty()) {
- gpu_info->driver_vendor = "ATI / AMD";
- gpu_info->driver_version = driver_version;
- }
- break;
- case kVendorIDNVidia:
- driver_version = CollectDriverVersionNVidia();
- if (!driver_version.empty()) {
- gpu_info->driver_vendor = "NVIDIA";
- gpu_info->driver_version = driver_version;
- }
- break;
+ if (gpu_info->gpu.vendor_id == kVendorIDAMD) {
+ std::string ati_driver_version = CollectDriverVersionATI();
+ if (!ati_driver_version.empty()) {
+ gpu_info->driver_vendor = "ATI / AMD";
+ gpu_info->driver_version = ati_driver_version;
+ }
}
return rt;