Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be35e6e9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove app vsync pausing" into qt-dev

parents ea17f777 ecf2e0f5
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -87,19 +87,7 @@ void DispSyncSource::setPhaseOffset(nsecs_t phaseOffset) {
    }
}

void DispSyncSource::pauseVsyncCallback(bool pause) {
    std::lock_guard lock(mVsyncMutex);
    mCallbackPaused = pause;
}

void DispSyncSource::onDispSyncEvent(nsecs_t when) {
    {
        std::lock_guard lock(mVsyncMutex);
        if (mCallbackPaused) {
            return;
        }
    }

    VSyncSource::Callback* callback;
    {
        std::lock_guard lock(mCallbackMutex);
+0 −2
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ public:
    void setVSyncEnabled(bool enable) override;
    void setCallback(VSyncSource::Callback* callback) override;
    void setPhaseOffset(nsecs_t phaseOffset) override;
    void pauseVsyncCallback(bool pause) override;

private:
    // The following method is the implementation of the DispSync::Callback.
@@ -55,7 +54,6 @@ private:
    std::mutex mVsyncMutex;
    nsecs_t mPhaseOffset GUARDED_BY(mVsyncMutex);
    bool mEnabled GUARDED_BY(mVsyncMutex) = false;
    bool mCallbackPaused GUARDED_BY(mVsyncMutex) = false;
};

} // namespace android
 No newline at end of file
+0 −6
Original line number Diff line number Diff line
@@ -210,12 +210,6 @@ void EventThread::setPhaseOffset(nsecs_t phaseOffset) {
    mVSyncSource->setPhaseOffset(phaseOffset);
}

void EventThread::pauseVsyncCallback(bool pause) {
    std::lock_guard<std::mutex> lock(mMutex);
    ATRACE_INT("vsyncPaused", pause);
    mVSyncSource->pauseVsyncCallback(pause);
}

sp<EventThreadConnection> EventThread::createEventConnection(
        ResyncCallback resyncCallback, ResetIdleTimerCallback resetIdleTimerCallback) const {
    return new EventThreadConnection(const_cast<EventThread*>(this), std::move(resyncCallback),
+0 −7
Original line number Diff line number Diff line
@@ -66,9 +66,6 @@ public:
    virtual void setVSyncEnabled(bool enable) = 0;
    virtual void setCallback(Callback* callback) = 0;
    virtual void setPhaseOffset(nsecs_t phaseOffset) = 0;

    // pause/resume vsync callback generation
    virtual void pauseVsyncCallback(bool pause) = 0;
};

class EventThreadConnection : public BnDisplayEventConnection {
@@ -125,8 +122,6 @@ public:
    // Requests the next vsync. If resetIdleTimer is set to true, it resets the idle timer.
    virtual void requestNextVsync(const sp<EventThreadConnection>& connection,
                                  bool resetIdleTimer) = 0;

    virtual void pauseVsyncCallback(bool pause) = 0;
};

namespace impl {
@@ -162,8 +157,6 @@ public:

    void setPhaseOffset(nsecs_t phaseOffset) override;

    void pauseVsyncCallback(bool pause) override;

private:
    friend EventThreadTest;

+0 −6
Original line number Diff line number Diff line
@@ -178,12 +178,6 @@ void Scheduler::setPhaseOffset(const sp<Scheduler::ConnectionHandle>& handle, ns
    mConnections[handle->id]->thread->setPhaseOffset(phaseOffset);
}

void Scheduler::pauseVsyncCallback(const android::sp<android::Scheduler::ConnectionHandle>& handle,
                                   bool pause) {
    RETURN_IF_INVALID();
    mConnections[handle->id]->thread->pauseVsyncCallback(pause);
}

void Scheduler::getDisplayStatInfo(DisplayStatInfo* stats) {
    stats->vsyncTime = mPrimaryDispSync->computeNextRefresh(0);
    stats->vsyncPeriod = mPrimaryDispSync->getPeriod();
Loading