diff options
author | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-28 00:28:55 +0000 |
---|---|---|
committer | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-28 00:28:55 +0000 |
commit | 42dc3c06cb795aa1b10219f33362ef20d330bbd4 (patch) | |
tree | a9f32a9308eccb40754dad6ac3e9b88fe4d605b8 /content/gpu | |
parent | 3e25dc3c954485b068da34a1b2378c6cfda42105 (diff) | |
download | chromium_src-42dc3c06cb795aa1b10219f33362ef20d330bbd4.zip chromium_src-42dc3c06cb795aa1b10219f33362ef20d330bbd4.tar.gz chromium_src-42dc3c06cb795aa1b10219f33362ef20d330bbd4.tar.bz2 |
Disable GPU features if /dev/nvidiactl is inaccessible
BUG=98819
TEST=chmod a-rw /dev/nvidiactl, and then open about:gpu
R=apatrick
Review URL: https://chromiumcodereview.appspot.com/9844005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129314 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/gpu')
-rw-r--r-- | content/gpu/gpu_main.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc index 898c753..09fce82 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc @@ -81,10 +81,22 @@ int GpuMain(const content::MainFunctionParams& parameters) { 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; } |