summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-10-18 20:23:22 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-10-18 20:23:22 -0700
commitf7613743f29f38cbbaf4ae09996c380845a17daf (patch)
tree05c50117a60046ac06c986332a4cf62d54d18f6f /services
parent23bf250522b7dff9acd14c5900b66b1df9c76745 (diff)
parent0d0fba4587df36846baa80463490befdcef38e98 (diff)
downloadframeworks_base-f7613743f29f38cbbaf4ae09996c380845a17daf.zip
frameworks_base-f7613743f29f38cbbaf4ae09996c380845a17daf.tar.gz
frameworks_base-f7613743f29f38cbbaf4ae09996c380845a17daf.tar.bz2
Merge "Don't call hwc set() if there is nothing new to do" into ics-mr0
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 3c48b7e..595ec1e 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -445,6 +445,11 @@ bool SurfaceFlinger::threadLoop()
// post surfaces (if needed)
handlePageFlip();
+ if (mDirtyRegion.isEmpty()) {
+ // nothing new to do.
+ return true;
+ }
+
if (UNLIKELY(mHwWorkListDirty)) {
// build the h/w work list
handleWorkList();
@@ -478,6 +483,9 @@ bool SurfaceFlinger::threadLoop()
void SurfaceFlinger::postFramebuffer()
{
+ // this should never happen. we do the flip anyways so we don't
+ // risk to cause a deadlock with hwc
+ LOGW_IF(mSwapRegion.isEmpty(), "mSwapRegion is empty");
const DisplayHardware& hw(graphicPlane(0).displayHardware());
const nsecs_t now = systemTime();
mDebugInSwapBuffers = now;
@@ -938,7 +946,7 @@ void SurfaceFlinger::setupHardwareComposer(Region& dirtyInOut)
// data.
//
// Also we want to make sure to not clear areas that belong to
- // layers above that won't redraw (we would just erasing them),
+ // layers above that won't redraw (we would just be erasing them),
// that is, we can't erase anything outside the dirty region.
Region transparent;
@@ -1769,7 +1777,7 @@ status_t SurfaceFlinger::onTransact(
void SurfaceFlinger::repaintEverything() {
Mutex::Autolock _l(mStateLock);
const DisplayHardware& hw(graphicPlane(0).displayHardware());
- mDirtyRegion.set(hw.bounds()); // careful that's not thread-safe
+ mDirtyRegion.set(hw.bounds());
signalEvent();
}