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

Commit be2a1922 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "SurfaceFlinger: record layer history for TX with eAnimation" into...

Merge "SurfaceFlinger: record layer history for TX with eAnimation" into rvc-dev am: d9f4f889 am: 850fab43

Original change: undetermined

Change-Id: I002979217927a07af460b11d0ca06f7570d8f07c
parents 90a610b5 850fab43
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -31,6 +31,7 @@
#include "SurfaceInterceptor.h"
#include "SurfaceInterceptor.h"


#include "FrameTracer/FrameTracer.h"
#include "FrameTracer/FrameTracer.h"
#include "Scheduler/LayerHistory.h"
#include "TimeStats/TimeStats.h"
#include "TimeStats/TimeStats.h"


namespace android {
namespace android {
@@ -399,7 +400,8 @@ void BufferQueueLayer::onFrameAvailable(const BufferItem& item) {
    // Add this buffer from our internal queue tracker
    // Add this buffer from our internal queue tracker
    { // Autolock scope
    { // Autolock scope
        const nsecs_t presentTime = item.mIsAutoTimestamp ? 0 : item.mTimestamp;
        const nsecs_t presentTime = item.mIsAutoTimestamp ? 0 : item.mTimestamp;
        mFlinger->mScheduler->recordLayerHistory(this, presentTime);
        mFlinger->mScheduler->recordLayerHistory(this, presentTime,
                                                 LayerHistory::LayerUpdateType::Buffer);


        Mutex::Autolock lock(mQueueItemLock);
        Mutex::Autolock lock(mQueueItemLock);
        // Reset the frame number tracker when we receive the first buffer after
        // Reset the frame number tracker when we receive the first buffer after
+2 −1
Original line number Original line Diff line number Diff line
@@ -283,7 +283,8 @@ bool BufferStateLayer::setBuffer(const sp<GraphicBuffer>& buffer, const sp<Fence
    desiredPresentTime = desiredPresentTime <= 0 ? 0 : desiredPresentTime;
    desiredPresentTime = desiredPresentTime <= 0 ? 0 : desiredPresentTime;
    mCurrentState.desiredPresentTime = desiredPresentTime;
    mCurrentState.desiredPresentTime = desiredPresentTime;


    mFlinger->mScheduler->recordLayerHistory(this, desiredPresentTime);
    mFlinger->mScheduler->recordLayerHistory(this, desiredPresentTime,
                                             LayerHistory::LayerUpdateType::Buffer);


    addFrameEvent(acquireFence, postTime, desiredPresentTime);
    addFrameEvent(acquireFence, postTime, desiredPresentTime);
    return true;
    return true;
+2 −1
Original line number Original line Diff line number Diff line
@@ -1399,7 +1399,8 @@ bool Layer::setFrameRate(FrameRate frameRate) {
    }
    }


    // Activate the layer in Scheduler's LayerHistory
    // Activate the layer in Scheduler's LayerHistory
    mFlinger->mScheduler->recordLayerHistory(this, systemTime());
    mFlinger->mScheduler->recordLayerHistory(this, systemTime(),
                                             LayerHistory::LayerUpdateType::SetFrameRate);


    mCurrentState.sequence++;
    mCurrentState.sequence++;
    mCurrentState.frameRate = frameRate;
    mCurrentState.frameRate = frameRate;
+2 −1
Original line number Original line Diff line number Diff line
@@ -79,7 +79,8 @@ void LayerHistory::registerLayer(Layer* layer, float lowRefreshRate, float highR
    mLayerInfos.emplace_back(layer, std::move(info));
    mLayerInfos.emplace_back(layer, std::move(info));
}
}


void LayerHistory::record(Layer* layer, nsecs_t presentTime, nsecs_t now) {
void LayerHistory::record(Layer* layer, nsecs_t presentTime, nsecs_t now,
                          LayerUpdateType /*updateType*/) {
    std::lock_guard lock(mLock);
    std::lock_guard lock(mLock);


    const auto it = std::find_if(mLayerInfos.begin(), mLayerInfos.end(),
    const auto it = std::find_if(mLayerInfos.begin(), mLayerInfos.end(),
+11 −3
Original line number Original line Diff line number Diff line
@@ -52,10 +52,18 @@ public:
    // Sets the display size. Client is responsible for synchronization.
    // Sets the display size. Client is responsible for synchronization.
    virtual void setDisplayArea(uint32_t displayArea) = 0;
    virtual void setDisplayArea(uint32_t displayArea) = 0;


    // Sets whether a config change is pending to be applied
    virtual void setConfigChangePending(bool pending) = 0;
    virtual void setConfigChangePending(bool pending) = 0;


    // Represents which layer activity is recorded
    enum class LayerUpdateType {
        Buffer,       // a new buffer queued
        AnimationTX,  // a new transaction with eAnimation flag set
        SetFrameRate, // setFrameRate API was called
    };

    // Marks the layer as active, and records the given state to its history.
    // Marks the layer as active, and records the given state to its history.
    virtual void record(Layer*, nsecs_t presentTime, nsecs_t now) = 0;
    virtual void record(Layer*, nsecs_t presentTime, nsecs_t now, LayerUpdateType updateType) = 0;


    using Summary = std::vector<RefreshRateConfigs::LayerRequirement>;
    using Summary = std::vector<RefreshRateConfigs::LayerRequirement>;


@@ -83,7 +91,7 @@ public:
    void setConfigChangePending(bool /*pending*/) override {}
    void setConfigChangePending(bool /*pending*/) override {}


    // Marks the layer as active, and records the given state to its history.
    // Marks the layer as active, and records the given state to its history.
    void record(Layer*, nsecs_t presentTime, nsecs_t now) override;
    void record(Layer*, nsecs_t presentTime, nsecs_t now, LayerUpdateType updateType) override;


    // Rebuilds sets of active/inactive layers, and accumulates stats for active layers.
    // Rebuilds sets of active/inactive layers, and accumulates stats for active layers.
    android::scheduler::LayerHistory::Summary summarize(nsecs_t now) override;
    android::scheduler::LayerHistory::Summary summarize(nsecs_t now) override;
@@ -141,7 +149,7 @@ public:
    void setConfigChangePending(bool pending) override { mConfigChangePending = pending; }
    void setConfigChangePending(bool pending) override { mConfigChangePending = pending; }


    // Marks the layer as active, and records the given state to its history.
    // Marks the layer as active, and records the given state to its history.
    void record(Layer*, nsecs_t presentTime, nsecs_t now) override;
    void record(Layer*, nsecs_t presentTime, nsecs_t now, LayerUpdateType updateType) override;


    // Rebuilds sets of active/inactive layers, and accumulates stats for active layers.
    // Rebuilds sets of active/inactive layers, and accumulates stats for active layers.
    android::scheduler::LayerHistory::Summary summarize(nsecs_t /*now*/) override;
    android::scheduler::LayerHistory::Summary summarize(nsecs_t /*now*/) override;
Loading