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

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

Snap for 8722206 from d951dd2b to tm-qpr1-release

Change-Id: Ie3fc6301d44a6760954a9258460bcc6101e16003
parents 0dc7a469 d951dd2b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -897,6 +897,10 @@ void SurfaceComposerClient::Transaction::clear() {
    mApplyToken = nullptr;
}

uint64_t SurfaceComposerClient::Transaction::getId() {
    return mId;
}

void SurfaceComposerClient::doUncacheBufferTransaction(uint64_t cacheId) {
    sp<ISurfaceComposer> sf(ComposerService::getComposerService());

+4 −0
Original line number Diff line number Diff line
@@ -461,6 +461,10 @@ public:
        // Clears the contents of the transaction without applying it.
        void clear();

        // Returns the current id of the transaction.
        // The id is updated every time the transaction is applied.
        uint64_t getId();

        status_t apply(bool synchronous = false, bool oneWay = false);
        // Merge another transaction in to this one, clearing other
        // as if it had been applied.
+22 −0
Original line number Diff line number Diff line
@@ -211,6 +211,7 @@ status_t DisplayDevice::initiateModeChange(const ActiveModeInfo& info,
              to_string(getId()).c_str());
        return BAD_VALUE;
    }
    mNumModeSwitchesInPolicy++;
    mUpcomingActiveMode = info;
    ATRACE_INT(mActiveModeFPSHwcTrace.c_str(), info.mode->getFps().getIntValue());
    return mHwComposer.setActiveModeWithConstraints(getPhysicalId(), info.mode->getHwcId(),
@@ -537,6 +538,27 @@ void DisplayDevice::clearDesiredActiveModeState() {
    mDesiredActiveModeChanged = false;
}

status_t DisplayDevice::setRefreshRatePolicy(
        const std::optional<scheduler::RefreshRateConfigs::Policy>& policy, bool overridePolicy) {
    const auto oldPolicy = mRefreshRateConfigs->getCurrentPolicy();
    const status_t setPolicyResult = overridePolicy
            ? mRefreshRateConfigs->setOverridePolicy(policy)
            : mRefreshRateConfigs->setDisplayManagerPolicy(*policy);

    if (setPolicyResult == OK) {
        const int numModeChanges = mNumModeSwitchesInPolicy.exchange(0);

        ALOGI("Display %s policy changed\n"
              "Previous: {%s}\n"
              "Current:  {%s}\n"
              "%d mode changes were performed under the previous policy",
              to_string(getId()).c_str(), oldPolicy.toString().c_str(),
              policy ? policy->toString().c_str() : "null", numModeChanges);
    }

    return setPolicyResult;
}

std::atomic<int32_t> DisplayDeviceState::sNextSequenceId(1);

}  // namespace android
+6 −0
Original line number Diff line number Diff line
@@ -249,6 +249,10 @@ public:
    nsecs_t getVsyncPeriodFromHWC() const;
    nsecs_t getRefreshTimestamp() const;

    status_t setRefreshRatePolicy(
            const std::optional<scheduler::RefreshRateConfigs::Policy>& policy,
            bool overridePolicy);

    // release HWC resources (if any) for removable displays
    void disconnect();

@@ -303,6 +307,8 @@ private:
    TracedOrdinal<bool> mDesiredActiveModeChanged
            GUARDED_BY(mActiveModeLock) = {"DesiredActiveModeChanged", false};
    ActiveModeInfo mUpcomingActiveMode GUARDED_BY(kMainThreadContext);

    std::atomic_int mNumModeSwitchesInPolicy = 0;
};

struct DisplayDeviceState {
+1 −3
Original line number Diff line number Diff line
@@ -6913,9 +6913,7 @@ status_t SurfaceFlinger::setDesiredDisplayModeSpecsInternal(
        return NO_ERROR;
    }

    status_t setPolicyResult = overridePolicy
            ? display->refreshRateConfigs().setOverridePolicy(policy)
            : display->refreshRateConfigs().setDisplayManagerPolicy(*policy);
    const status_t setPolicyResult = display->setRefreshRatePolicy(policy, overridePolicy);
    if (setPolicyResult < 0) {
        return BAD_VALUE;
    }