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

Unified Diff: content/gpu/gpu_main.cc

Issue 9844005: Disable GPU features if /dev/nvidiactl is inaccessible (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | content/public/common/gpu_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/gpu_main.cc
===================================================================
--- content/gpu/gpu_main.cc (revision 129207)
+++ content/gpu/gpu_main.cc (working copy)
@@ -81,10 +81,22 @@
LOG(INFO) << "gpu_info_collector::CollectGraphicsInfo failed";
}
+#if defined(OS_LINUX)
+ if (gpu_info.vendor_id == 0x10de) { // NVIDIA
+ base::ThreadRestrictions::AssertIOAllowed();
+ if (access("/dev/nvidiactl", R_OK) != 0) {
+ LOG(INFO) << "NVIDIA device file /dev/nvidiactl access denied";
+ gpu_info.gpu_accessible = false;
+ dead_on_arrival = true;
+ }
+ }
+#endif
+
// Set the GPU info even if it failed.
content::GetContentClient()->SetGpuInfo(gpu_info);
} else {
LOG(INFO) << "gfx::GLSurface::InitializeOneOff failed";
+ gpu_info.gpu_accessible = false;
dead_on_arrival = true;
}
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | content/public/common/gpu_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698