summaryrefslogtreecommitdiffstats
path: root/content/gpu
diff options
context:
space:
mode:
authorbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 00:37:17 +0000
committerbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 00:37:17 +0000
commit31583a9d7a477fed25687cef35f046eecf2b5055 (patch)
treee18d7e5e7678f2a251cf5a80147a4b4f2ddc9882 /content/gpu
parent3de9cc2fa2931a9d343f5bb09c74674967ef4c98 (diff)
downloadchromium_src-31583a9d7a477fed25687cef35f046eecf2b5055.zip
chromium_src-31583a9d7a477fed25687cef35f046eecf2b5055.tar.gz
chromium_src-31583a9d7a477fed25687cef35f046eecf2b5055.tar.bz2
CrOS: Add hotkey for disabling the GPU watchdog timer.
This works around the fact that switching to VT1 on CrOS prevents swaps from clearing, which hangs the GPU process, which causes the GPU process to get killed. Sometimes in order to diagnose a problem, we want to switch to VT1. This hotkey allows a developer to do that. TEST=by hand; Ctrl-Shift-Alt-G; then go about://gpuhang; UI should freeze and not unstick after 10 seconds BUG=chromium-os:28253 Review URL: https://chromiumcodereview.appspot.com/11348099 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170309 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/gpu')
-rw-r--r--content/gpu/gpu_child_thread.cc13
-rw-r--r--content/gpu/gpu_child_thread.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
index 48f4dcd..62ddc67 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -106,6 +106,7 @@ bool GpuChildThread::OnControlMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(GpuMsg_Clean, OnClean)
IPC_MESSAGE_HANDLER(GpuMsg_Crash, OnCrash)
IPC_MESSAGE_HANDLER(GpuMsg_Hang, OnHang)
+ IPC_MESSAGE_HANDLER(GpuMsg_DisableWatchdog, OnDisableWatchdog)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP_EX()
@@ -225,6 +226,18 @@ void GpuChildThread::OnHang() {
}
}
+void GpuChildThread::OnDisableWatchdog() {
+ VLOG(1) << "GPU: Disabling watchdog thread";
+ if (watchdog_thread_.get()) {
+ // Disarm the watchdog before shutting down the message loop. This prevents
+ // the future posting of tasks to the message loop.
+ if (watchdog_thread_->message_loop())
+ watchdog_thread_->PostAcknowledge();
+ // Prevent rearming.
+ watchdog_thread_->Stop();
+ }
+}
+
#if defined(OS_WIN)
// Runs on a worker thread. The GPU process never terminates voluntarily so
diff --git a/content/gpu/gpu_child_thread.h b/content/gpu/gpu_child_thread.h
index 9371423..de8d7f7 100644
--- a/content/gpu/gpu_child_thread.h
+++ b/content/gpu/gpu_child_thread.h
@@ -60,6 +60,7 @@ class GpuChildThread : public ChildThread {
void OnClean();
void OnCrash();
void OnHang();
+ void OnDisableWatchdog();
#if defined(USE_TCMALLOC)
void OnGetGpuTcmalloc();