Loading services/surfaceflinger/DisplayHardware/HWComposer.cpp +0 −1 Original line number Original line Diff line number Diff line Loading @@ -109,7 +109,6 @@ public: android::Hwc2::Display display, int64_t timestamp, android::Hwc2::Display display, int64_t timestamp, android::Hwc2::VsyncPeriodNanos vsyncPeriodNanos) override { android::Hwc2::VsyncPeriodNanos vsyncPeriodNanos) override { if (mVsyncSwitchingSupported) { if (mVsyncSwitchingSupported) { // TODO(b/140201379): use vsyncPeriodNanos in the new DispSync mCallback->onVsyncReceived(mSequenceId, display, timestamp, mCallback->onVsyncReceived(mSequenceId, display, timestamp, std::make_optional(vsyncPeriodNanos)); std::make_optional(vsyncPeriodNanos)); } else { } else { Loading services/surfaceflinger/Scheduler/DispSync.cpp +2 −1 Original line number Original line Diff line number Diff line Loading @@ -542,7 +542,8 @@ void DispSync::beginResync() { resetLocked(); resetLocked(); } } bool DispSync::addResyncSample(nsecs_t timestamp, bool* periodFlushed) { bool DispSync::addResyncSample(nsecs_t timestamp, std::optional<nsecs_t> /*hwcVsyncPeriod*/, bool* periodFlushed) { Mutex::Autolock lock(mMutex); Mutex::Autolock lock(mMutex); ALOGV("[%s] addResyncSample(%" PRId64 ")", mName, ns2us(timestamp)); ALOGV("[%s] addResyncSample(%" PRId64 ")", mName, ns2us(timestamp)); Loading services/surfaceflinger/Scheduler/DispSync.h +4 −2 Original line number Original line Diff line number Diff line Loading @@ -49,7 +49,8 @@ public: virtual void reset() = 0; virtual void reset() = 0; virtual bool addPresentFence(const std::shared_ptr<FenceTime>&) = 0; virtual bool addPresentFence(const std::shared_ptr<FenceTime>&) = 0; virtual void beginResync() = 0; virtual void beginResync() = 0; virtual bool addResyncSample(nsecs_t timestamp, bool* periodFlushed) = 0; virtual bool addResyncSample(nsecs_t timestamp, std::optional<nsecs_t> hwcVsyncPeriod, bool* periodFlushed) = 0; virtual void endResync() = 0; virtual void endResync() = 0; virtual void setPeriod(nsecs_t period) = 0; virtual void setPeriod(nsecs_t period) = 0; virtual nsecs_t getPeriod() = 0; virtual nsecs_t getPeriod() = 0; Loading Loading @@ -125,7 +126,8 @@ public: // down the DispSync model, and false otherwise. // down the DispSync model, and false otherwise. // periodFlushed will be set to true if mPendingPeriod is flushed to // periodFlushed will be set to true if mPendingPeriod is flushed to // mIntendedPeriod, and false otherwise. // mIntendedPeriod, and false otherwise. bool addResyncSample(nsecs_t timestamp, bool* periodFlushed) override; bool addResyncSample(nsecs_t timestamp, std::optional<nsecs_t> hwcVsyncPeriod, bool* periodFlushed) override; void endResync() override; void endResync() override; // The setPeriod method sets the vsync event model's period to a specific // The setPeriod method sets the vsync event model's period to a specific Loading services/surfaceflinger/Scheduler/Scheduler.cpp +4 −2 Original line number Original line Diff line number Diff line Loading @@ -338,13 +338,15 @@ void Scheduler::setVsyncPeriod(nsecs_t period) { } } } } void Scheduler::addResyncSample(nsecs_t timestamp, bool* periodFlushed) { void Scheduler::addResyncSample(nsecs_t timestamp, std::optional<nsecs_t> hwcVsyncPeriod, bool* periodFlushed) { bool needsHwVsync = false; bool needsHwVsync = false; *periodFlushed = false; *periodFlushed = false; { // Scope for the lock { // Scope for the lock std::lock_guard<std::mutex> lock(mHWVsyncLock); std::lock_guard<std::mutex> lock(mHWVsyncLock); if (mPrimaryHWVsyncEnabled) { if (mPrimaryHWVsyncEnabled) { needsHwVsync = mPrimaryDispSync->addResyncSample(timestamp, periodFlushed); needsHwVsync = mPrimaryDispSync->addResyncSample(timestamp, hwcVsyncPeriod, periodFlushed); } } } } Loading services/surfaceflinger/Scheduler/Scheduler.h +2 −1 Original line number Original line Diff line number Diff line Loading @@ -109,7 +109,8 @@ public: // Passes a vsync sample to DispSync. periodFlushed will be true if // Passes a vsync sample to DispSync. periodFlushed will be true if // DispSync detected that the vsync period changed, and false otherwise. // DispSync detected that the vsync period changed, and false otherwise. void addResyncSample(nsecs_t timestamp, bool* periodFlushed); void addResyncSample(nsecs_t timestamp, std::optional<nsecs_t> hwcVsyncPeriod, bool* periodFlushed); void addPresentFence(const std::shared_ptr<FenceTime>&); void addPresentFence(const std::shared_ptr<FenceTime>&); void setIgnorePresentFences(bool ignore); void setIgnorePresentFences(bool ignore); nsecs_t getDispSyncExpectedPresentTime(); nsecs_t getDispSyncExpectedPresentTime(); Loading Loading
services/surfaceflinger/DisplayHardware/HWComposer.cpp +0 −1 Original line number Original line Diff line number Diff line Loading @@ -109,7 +109,6 @@ public: android::Hwc2::Display display, int64_t timestamp, android::Hwc2::Display display, int64_t timestamp, android::Hwc2::VsyncPeriodNanos vsyncPeriodNanos) override { android::Hwc2::VsyncPeriodNanos vsyncPeriodNanos) override { if (mVsyncSwitchingSupported) { if (mVsyncSwitchingSupported) { // TODO(b/140201379): use vsyncPeriodNanos in the new DispSync mCallback->onVsyncReceived(mSequenceId, display, timestamp, mCallback->onVsyncReceived(mSequenceId, display, timestamp, std::make_optional(vsyncPeriodNanos)); std::make_optional(vsyncPeriodNanos)); } else { } else { Loading
services/surfaceflinger/Scheduler/DispSync.cpp +2 −1 Original line number Original line Diff line number Diff line Loading @@ -542,7 +542,8 @@ void DispSync::beginResync() { resetLocked(); resetLocked(); } } bool DispSync::addResyncSample(nsecs_t timestamp, bool* periodFlushed) { bool DispSync::addResyncSample(nsecs_t timestamp, std::optional<nsecs_t> /*hwcVsyncPeriod*/, bool* periodFlushed) { Mutex::Autolock lock(mMutex); Mutex::Autolock lock(mMutex); ALOGV("[%s] addResyncSample(%" PRId64 ")", mName, ns2us(timestamp)); ALOGV("[%s] addResyncSample(%" PRId64 ")", mName, ns2us(timestamp)); Loading
services/surfaceflinger/Scheduler/DispSync.h +4 −2 Original line number Original line Diff line number Diff line Loading @@ -49,7 +49,8 @@ public: virtual void reset() = 0; virtual void reset() = 0; virtual bool addPresentFence(const std::shared_ptr<FenceTime>&) = 0; virtual bool addPresentFence(const std::shared_ptr<FenceTime>&) = 0; virtual void beginResync() = 0; virtual void beginResync() = 0; virtual bool addResyncSample(nsecs_t timestamp, bool* periodFlushed) = 0; virtual bool addResyncSample(nsecs_t timestamp, std::optional<nsecs_t> hwcVsyncPeriod, bool* periodFlushed) = 0; virtual void endResync() = 0; virtual void endResync() = 0; virtual void setPeriod(nsecs_t period) = 0; virtual void setPeriod(nsecs_t period) = 0; virtual nsecs_t getPeriod() = 0; virtual nsecs_t getPeriod() = 0; Loading Loading @@ -125,7 +126,8 @@ public: // down the DispSync model, and false otherwise. // down the DispSync model, and false otherwise. // periodFlushed will be set to true if mPendingPeriod is flushed to // periodFlushed will be set to true if mPendingPeriod is flushed to // mIntendedPeriod, and false otherwise. // mIntendedPeriod, and false otherwise. bool addResyncSample(nsecs_t timestamp, bool* periodFlushed) override; bool addResyncSample(nsecs_t timestamp, std::optional<nsecs_t> hwcVsyncPeriod, bool* periodFlushed) override; void endResync() override; void endResync() override; // The setPeriod method sets the vsync event model's period to a specific // The setPeriod method sets the vsync event model's period to a specific Loading
services/surfaceflinger/Scheduler/Scheduler.cpp +4 −2 Original line number Original line Diff line number Diff line Loading @@ -338,13 +338,15 @@ void Scheduler::setVsyncPeriod(nsecs_t period) { } } } } void Scheduler::addResyncSample(nsecs_t timestamp, bool* periodFlushed) { void Scheduler::addResyncSample(nsecs_t timestamp, std::optional<nsecs_t> hwcVsyncPeriod, bool* periodFlushed) { bool needsHwVsync = false; bool needsHwVsync = false; *periodFlushed = false; *periodFlushed = false; { // Scope for the lock { // Scope for the lock std::lock_guard<std::mutex> lock(mHWVsyncLock); std::lock_guard<std::mutex> lock(mHWVsyncLock); if (mPrimaryHWVsyncEnabled) { if (mPrimaryHWVsyncEnabled) { needsHwVsync = mPrimaryDispSync->addResyncSample(timestamp, periodFlushed); needsHwVsync = mPrimaryDispSync->addResyncSample(timestamp, hwcVsyncPeriod, periodFlushed); } } } } Loading
services/surfaceflinger/Scheduler/Scheduler.h +2 −1 Original line number Original line Diff line number Diff line Loading @@ -109,7 +109,8 @@ public: // Passes a vsync sample to DispSync. periodFlushed will be true if // Passes a vsync sample to DispSync. periodFlushed will be true if // DispSync detected that the vsync period changed, and false otherwise. // DispSync detected that the vsync period changed, and false otherwise. void addResyncSample(nsecs_t timestamp, bool* periodFlushed); void addResyncSample(nsecs_t timestamp, std::optional<nsecs_t> hwcVsyncPeriod, bool* periodFlushed); void addPresentFence(const std::shared_ptr<FenceTime>&); void addPresentFence(const std::shared_ptr<FenceTime>&); void setIgnorePresentFences(bool ignore); void setIgnorePresentFences(bool ignore); nsecs_t getDispSyncExpectedPresentTime(); nsecs_t getDispSyncExpectedPresentTime(); Loading