From bef42c50ebda2d63400f92611e1dd857c03bb38c Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 21 Aug 2013 17:45:46 -0700 Subject: [PATCH] handle several vsync signal correctly Change-Id: I34935d2197ce8e914fef2f110896e47b44225ad2 --- .../DisplayHardware/HWComposer.cpp | 22 ++++++++++++++----- .../DisplayHardware/HWComposer.h | 4 ++-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index e7d0d239c..32c55fd1f 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -87,12 +87,17 @@ HWComposer::HWComposer( mFbDev(0), mHwc(0), mNumDisplays(1), mCBContext(new cb_context), mEventHandler(handler), - mVSyncCount(0), mDebugForceFakeVSync(false) + mDebugForceFakeVSync(false) { for (size_t i =0 ; i HWComposer::getDisplayFence(int disp) const { diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h index d901c621e..9f961139b 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.h +++ b/services/surfaceflinger/DisplayHardware/HWComposer.h @@ -342,14 +342,14 @@ private: cb_context* mCBContext; EventHandler& mEventHandler; - size_t mVSyncCount; + size_t mVSyncCounts[HWC_NUM_PHYSICAL_DISPLAY_TYPES]; sp mVSyncThread; bool mDebugForceFakeVSync; BitSet32 mAllocatedDisplayIDs; // protected by mLock mutable Mutex mLock; - mutable nsecs_t mLastHwVSync; + mutable nsecs_t mLastHwVSync[HWC_NUM_PHYSICAL_DISPLAY_TYPES]; // thread-safe mutable Mutex mEventControlLock;