diff options
author | Vishal Bhoj <vishal.bhoj@linaro.org> | 2012-07-16 14:28:03 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@betelgeuse.canonical.com> | 2012-07-16 14:28:03 +0000 |
commit | 3f7a4ac5c3d24b6427f78967754bbb28b91faa42 (patch) | |
tree | 64ee5075af54f5cbfeb6f27d9f884d9b4044ee12 | |
parent | 5eb7d892f1ba5db68fe814009e8e320cbe42211f (diff) | |
parent | 48cdb95459a52ecf46ed2190d9def16520e178c8 (diff) | |
download | base-linaro_android_4.0.4.tar.gz |
Merge "frameworks/base: Fix 100% cpu usage with no early suspend" into linaro_android_4.0.4linaro_android_4.0.4
-rw-r--r-- | services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp b/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp index 0c7e66598b38..9c728123a2ba 100644 --- a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp +++ b/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp @@ -72,8 +72,10 @@ bool DisplayHardwareBase::DisplayEventThread::threadLoop() int fd; fd = open(kSleepFileName, O_RDONLY, 0); - if (fd == -1 && errno == ENOENT) + if (fd == -1 && errno == ENOENT) { + usleep(166667); // Sleep to avoid 100% CPU usage. return true; // End silently if FB_EARLYSUSPEND appears to be missing, as on kernels >= 3.3 + } do { err = read(fd, &buf, 1); } while (err < 0 && errno == EINTR); |