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

Commit 0dc7a469 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8704887 from ba95810b to tm-qpr1-release

Change-Id: Iaee87387e889f3b51eaec1f25d1d99129b2f9a3b
parents 0e719e12 ba95810b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@ typedef struct {
    // negative duration.
    uint32_t error_count;

    // Needed to make 32-bit arch struct size match 64-bit BPF arch struct size.
    uint32_t padding0;
} UidTrackingInfo;

typedef struct {
+5 −3
Original line number Diff line number Diff line
@@ -554,11 +554,12 @@ void Scheduler::onTouchHint() {
    }
}

void Scheduler::setDisplayPowerState(bool normal) {
void Scheduler::setDisplayPowerMode(hal::PowerMode powerMode) {
    {
        std::lock_guard<std::mutex> lock(mPolicyLock);
        mPolicy.isDisplayPowerStateNormal = normal;
        mPolicy.displayPowerMode = powerMode;
    }
    mVsyncSchedule->getController().setDisplayPowerMode(powerMode);

    if (mDisplayPowerTimer) {
        mDisplayPowerTimer->reset();
@@ -706,7 +707,8 @@ auto Scheduler::chooseDisplayMode() -> std::pair<DisplayModePtr, GlobalSignals>
    // If Display Power is not in normal operation we want to be in performance mode. When coming
    // back to normal mode, a grace period is given with DisplayPowerTimer.
    if (mDisplayPowerTimer &&
        (!mPolicy.isDisplayPowerStateNormal || mPolicy.displayPowerTimer == TimerState::Reset)) {
        (mPolicy.displayPowerMode != hal::PowerMode::ON ||
         mPolicy.displayPowerTimer == TimerState::Reset)) {
        constexpr GlobalSignals kNoSignals;
        return {configs->getMaxRefreshRateByPolicy(), kNoSignals};
    }
+2 −2
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ public:
    // Indicates that touch interaction is taking place.
    void onTouchHint();

    void setDisplayPowerState(bool normal);
    void setDisplayPowerMode(hal::PowerMode powerMode);

    VSyncDispatch& getVsyncDispatch() { return mVsyncSchedule->getDispatch(); }

@@ -325,7 +325,7 @@ private:
        TimerState idleTimer = TimerState::Reset;
        TouchState touch = TouchState::Inactive;
        TimerState displayPowerTimer = TimerState::Expired;
        bool isDisplayPowerStateNormal = true;
        hal::PowerMode displayPowerMode = hal::PowerMode::ON;

        // Chosen display mode.
        DisplayModePtr mode;
+10 −0
Original line number Diff line number Diff line
@@ -146,6 +146,11 @@ bool VSyncReactor::periodConfirmed(nsecs_t vsync_timestamp, std::optional<nsecs_
        return false;
    }

    if (mDisplayPowerMode == hal::PowerMode::DOZE ||
        mDisplayPowerMode == hal::PowerMode::DOZE_SUSPEND) {
        return true;
    }

    if (!mLastHwVsync && !HwcVsyncPeriod) {
        return false;
    }
@@ -206,6 +211,11 @@ bool VSyncReactor::addHwVsyncTimestamp(nsecs_t timestamp, std::optional<nsecs_t>
    return mMoreSamplesNeeded;
}

void VSyncReactor::setDisplayPowerMode(hal::PowerMode powerMode) {
    std::scoped_lock lock(mMutex);
    mDisplayPowerMode = powerMode;
}

void VSyncReactor::dump(std::string& result) const {
    std::lock_guard lock(mMutex);
    StringAppendF(&result, "VsyncReactor in use\n");
+4 −0
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@ public:
    bool addHwVsyncTimestamp(nsecs_t timestamp, std::optional<nsecs_t> hwcVsyncPeriod,
                             bool* periodFlushed) final;

    void setDisplayPowerMode(hal::PowerMode powerMode) final;

    void dump(std::string& result) const final;

private:
@@ -73,6 +75,8 @@ private:
    std::optional<nsecs_t> mPeriodTransitioningTo GUARDED_BY(mMutex);
    std::optional<nsecs_t> mLastHwVsync GUARDED_BY(mMutex);

    hal::PowerMode mDisplayPowerMode GUARDED_BY(mMutex) = hal::PowerMode::ON;

    const bool mSupportKernelIdleTimer = false;
};

Loading