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

Commit 52403b95 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5663715 from d87d70a5 to qt-qpr1-release

Change-Id: I8981f4e4ce03b812ede0e26b4a0410e72129289b
parents 98153bca d87d70a5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ cc_binary {
        "libbufferhubservice",
        "libcrypto",
        "libcutils",
        "libhidlbase",
        "libhidltransport",
        "libhwbinder",
        "liblog",
+2 −2
Original line number Diff line number Diff line
@@ -201,7 +201,7 @@ uint64_t BufferQueueLayer::getFrameNumber() const {
    uint64_t frameNumber = mQueueItems[0].mFrameNumber;

    // The head of the queue will be dropped if there are signaled and timely frames behind it
    nsecs_t expectedPresentTime = mFlinger->mScheduler->expectedPresentTime();
    nsecs_t expectedPresentTime = mFlinger->getExpectedPresentTime();

    if (isRemovedFromCurrentState()) {
        expectedPresentTime = 0;
@@ -279,7 +279,7 @@ status_t BufferQueueLayer::updateTexImage(bool& recomputeVisibleRegions, nsecs_t
                    getProducerStickyTransform() != 0, mName.string(), mOverrideScalingMode,
                    getTransformToDisplayInverse(), mFreezeGeometryUpdates);

    nsecs_t expectedPresentTime = mFlinger->mScheduler->expectedPresentTime();
    nsecs_t expectedPresentTime = mFlinger->getExpectedPresentTime();

    if (isRemovedFromCurrentState()) {
        expectedPresentTime = 0;
+7 −0
Original line number Diff line number Diff line
@@ -87,11 +87,18 @@ status_t Client::createWithSurfaceParent(const String8& name, uint32_t w, uint32
                                         LayerMetadata metadata, sp<IBinder>* handle,
                                         sp<IGraphicBufferProducer>* gbp) {
    if (mFlinger->authenticateSurfaceTexture(parent) == false) {
        ALOGE("failed to authenticate surface texture");
        // The extra parent layer check below before returning is to help with debugging
        // b/134888387. Once the bug is fixed the check can be deleted.
        if ((static_cast<MonitoredProducer*>(parent.get()))->getLayer() == nullptr) {
            ALOGE("failed to find parent layer");
        }
        return BAD_VALUE;
    }

    const auto& layer = (static_cast<MonitoredProducer*>(parent.get()))->getLayer();
    if (layer == nullptr) {
        ALOGE("failed to find parent layer");
        return BAD_VALUE;
    }

+6 −0
Original line number Diff line number Diff line
@@ -38,6 +38,12 @@ void LayerInfo::setLastPresentTime(nsecs_t lastPresentTime) {
    mLastUpdatedTime = std::max(lastPresentTime, systemTime());
    mPresentTimeHistory.insertPresentTime(mLastUpdatedTime);

    if (mLastPresentTime == 0) {
        // First frame
        mLastPresentTime = lastPresentTime;
        return;
    }

    const nsecs_t timeDiff = lastPresentTime - mLastPresentTime;
    mLastPresentTime = lastPresentTime;
    // Ignore time diff that are too high - those are stale values
+17 −7
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ class LayerInfo {

        float getRefreshRateAvg() const {
            nsecs_t refreshDuration = mMinRefreshDuration;
            if (mElements.size() == HISTORY_SIZE) {
            if (mElements.size() > 0) {
                refreshDuration = scheduler::calculate_mean(mElements);
            }

@@ -86,21 +86,31 @@ class LayerInfo {
        // Checks whether the present time that was inserted HISTORY_SIZE ago is within a
        // certain threshold: TIME_EPSILON_NS.
        bool isRelevant() const {
            const int64_t obsoleteEpsilon = systemTime() - scheduler::TIME_EPSILON_NS.count();
            // The layer had to publish at least HISTORY_SIZE of updates, and the first
            // update should not be older than TIME_EPSILON_NS nanoseconds.
            if (mElements.size() == HISTORY_SIZE &&
                mElements.at(HISTORY_SIZE - 1) > obsoleteEpsilon) {
                return true;
            if (mElements.size() < 2) {
                return false;
            }

            // The layer had to publish at least HISTORY_SIZE or HISTORY_TIME of updates
            if (mElements.size() != HISTORY_SIZE &&
                mElements.at(mElements.size() - 1) - mElements.at(0) < HISTORY_TIME.count()) {
                return false;
            }

            // The last update should not be older than TIME_EPSILON_NS nanoseconds.
            const int64_t obsoleteEpsilon = systemTime() - scheduler::TIME_EPSILON_NS.count();
            if (mElements.at(mElements.size() - 1) < obsoleteEpsilon) {
                return false;
            }

            return true;
        }

        void clearHistory() { mElements.clear(); }

    private:
        std::deque<nsecs_t> mElements;
        static constexpr size_t HISTORY_SIZE = 10;
        static constexpr std::chrono::nanoseconds HISTORY_TIME = 500ms;
    };

public:
Loading