diff options
author | Jesse Hall <jessehall@google.com> | 2013-10-15 05:05:36 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-15 05:05:36 -0700 |
commit | adbb3062e1a3d675531367c055572664fc46280d (patch) | |
tree | 355c3b3ea2ef06eefbe54e1a2379b63491824713 /services/surfaceflinger/DisplayHardware | |
parent | c60f1ad0fa0dd31a774517d1c0081465e4169f91 (diff) | |
parent | a04fd39cb88bb6df5f639464f70795f58cd0aefa (diff) | |
download | frameworks_native-adbb3062e1a3d675531367c055572664fc46280d.zip frameworks_native-adbb3062e1a3d675531367c055572664fc46280d.tar.gz frameworks_native-adbb3062e1a3d675531367c055572664fc46280d.tar.bz2 |
am a04fd39c: am 8e26b28b: Filter out vsync events from HWC with duplicate timestamps
* commit 'a04fd39cb88bb6df5f639464f70795f58cd0aefa':
Filter out vsync events from HWC with duplicate timestamps
Diffstat (limited to 'services/surfaceflinger/DisplayHardware')
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWComposer.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index 56b0f49..6a35efa 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -283,13 +283,27 @@ void HWComposer::invalidate() { void HWComposer::vsync(int disp, int64_t timestamp) { if (uint32_t(disp) < HWC_NUM_PHYSICAL_DISPLAY_TYPES) { + { + Mutex::Autolock _l(mLock); + + // There have been reports of HWCs that signal several vsync events + // with the same timestamp when turning the display off and on. This + // is a bug in the HWC implementation, but filter the extra events + // out here so they don't cause havoc downstream. + if (timestamp == mLastHwVSync[disp]) { + ALOGW("Ignoring duplicate VSYNC event from HWC (t=%lld)", + timestamp); + return; + } + + mLastHwVSync[disp] = timestamp; + } + char tag[16]; snprintf(tag, sizeof(tag), "HW_VSYNC_%1u", disp); ATRACE_INT(tag, ++mVSyncCounts[disp] & 1); mEventHandler.onVSyncReceived(disp, timestamp); - Mutex::Autolock _l(mLock); - mLastHwVSync[disp] = timestamp; } } |