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

Commit 41fb681a authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11859356 from ef7f5d11 to 24Q3-release

Change-Id: Ib45756196e7ebb1bc06780155f5d8ba0a7d91874
parents ba38e6de ef7f5d11
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ enum class GameMode : int32_t {
} // namespace android::gui

using android::gui::METADATA_ACCESSIBILITY_ID;
using android::gui::METADATA_CALLING_UID;
using android::gui::METADATA_DEQUEUE_TIME;
using android::gui::METADATA_GAME_MODE;
using android::gui::METADATA_MOUSE_CURSOR;
+1 −3
Original line number Diff line number Diff line
@@ -91,7 +91,6 @@ namespace {
// Debugging settings
static const bool kPrintLayerSettings = false;
static const bool kGaneshFlushAfterEveryLayer = kPrintLayerSettings;
static constexpr bool kEnableLayerBrightening = true;

} // namespace

@@ -714,8 +713,7 @@ void SkiaRenderEngine::drawLayersInternal(

    // ...and compute the dimming ratio if dimming is requested
    const float displayDimmingRatio = display.targetLuminanceNits > 0.f &&
                    maxLayerWhitePoint > 0.f &&
                    (kEnableLayerBrightening || display.targetLuminanceNits > maxLayerWhitePoint)
                    maxLayerWhitePoint > 0.f && display.targetLuminanceNits > maxLayerWhitePoint
            ? maxLayerWhitePoint / display.targetLuminanceNits
            : 1.f;

+24 −0
Original line number Diff line number Diff line
@@ -681,6 +681,15 @@ void SurfaceFrame::onPresent(nsecs_t presentTime, int32_t displayFrameJankType,
    }
}

void SurfaceFrame::onCommitNotComposited(Fps refreshRate, Fps displayFrameRenderRate) {
    std::scoped_lock lock(mMutex);

    mDisplayFrameRenderRate = displayFrameRenderRate;
    mActuals.presentTime = mPredictions.presentTime;
    nsecs_t deadlineDelta = 0;
    classifyJankLocked(JankType::None, refreshRate, displayFrameRenderRate, deadlineDelta);
}

void SurfaceFrame::tracePredictions(int64_t displayFrameToken, nsecs_t monoBootOffset) const {
    int64_t expectedTimelineCookie = mTraceCookieCounter.getCookieForTracing();

@@ -912,6 +921,15 @@ void FrameTimeline::setSfPresent(nsecs_t sfPresentTime,
    finalizeCurrentDisplayFrame();
}

void FrameTimeline::onCommitNotComposited() {
    ATRACE_CALL();
    std::scoped_lock lock(mMutex);
    mCurrentDisplayFrame->onCommitNotComposited();
    mCurrentDisplayFrame.reset();
    mCurrentDisplayFrame = std::make_shared<DisplayFrame>(mTimeStats, mJankClassificationThresholds,
                                                          &mTraceCookieCounter);
}

void FrameTimeline::DisplayFrame::addSurfaceFrame(std::shared_ptr<SurfaceFrame> surfaceFrame) {
    mSurfaceFrames.push_back(surfaceFrame);
}
@@ -1094,6 +1112,12 @@ void FrameTimeline::DisplayFrame::onPresent(nsecs_t signalTime, nsecs_t previous
    }
}

void FrameTimeline::DisplayFrame::onCommitNotComposited() {
    for (auto& surfaceFrame : mSurfaceFrames) {
        surfaceFrame->onCommitNotComposited(mRefreshRate, mRenderRate);
    }
}

void FrameTimeline::DisplayFrame::tracePredictions(pid_t surfaceFlingerPid,
                                                   nsecs_t monoBootOffset) const {
    int64_t expectedTimelineCookie = mTraceCookieCounter.getCookieForTracing();
+9 −0
Original line number Diff line number Diff line
@@ -204,6 +204,8 @@ public:
    void onPresent(nsecs_t presentTime, int32_t displayFrameJankType, Fps refreshRate,
                   Fps displayFrameRenderRate, nsecs_t displayDeadlineDelta,
                   nsecs_t displayPresentDelta);
    // Sets the frame as none janky as there was no real display frame.
    void onCommitNotComposited(Fps refreshRate, Fps displayFrameRenderRate);
    // All the timestamps are dumped relative to the baseTime
    void dump(std::string& result, const std::string& indent, nsecs_t baseTime) const;
    // Dumps only the layer, token, is buffer, jank metadata, prediction and present states.
@@ -318,6 +320,10 @@ public:
    virtual void setSfPresent(nsecs_t sfPresentTime, const std::shared_ptr<FenceTime>& presentFence,
                              const std::shared_ptr<FenceTime>& gpuFence) = 0;

    // Tells FrameTimeline that a frame was committed but not composited. This is used to flush
    // all the associated surface frames.
    virtual void onCommitNotComposited() = 0;

    // Args:
    // -jank : Dumps only the Display Frames that are either janky themselves
    //         or contain janky Surface Frames.
@@ -390,6 +396,8 @@ public:
                        std::optional<TimelineItem> predictions, nsecs_t wakeUpTime);
        // Sets the appropriate metadata and classifies the jank.
        void onPresent(nsecs_t signalTime, nsecs_t previousPresentTime);
        // Flushes all the surface frames as those were not generating any actual display frames.
        void onCommitNotComposited();
        // Adds the provided SurfaceFrame to the current display frame.
        void addSurfaceFrame(std::shared_ptr<SurfaceFrame> surfaceFrame);

@@ -475,6 +483,7 @@ public:
    void setSfWakeUp(int64_t token, nsecs_t wakeupTime, Fps refreshRate, Fps renderRate) override;
    void setSfPresent(nsecs_t sfPresentTime, const std::shared_ptr<FenceTime>& presentFence,
                      const std::shared_ptr<FenceTime>& gpuFence = FenceTime::NO_FENCE) override;
    void onCommitNotComposited() override;
    void parseArgs(const Vector<String16>& args, std::string& result) override;
    void setMaxDisplayFrames(uint32_t size) override;
    float computeFps(const std::unordered_set<int32_t>& layerIds) override;
+6 −4
Original line number Diff line number Diff line
@@ -785,10 +785,12 @@ void LayerSnapshotBuilder::updateSnapshot(LayerSnapshot& snapshot, const Args& a
        }
    }

    if (forceUpdate || snapshot.changes.test(RequestedLayerState::Changes::GameMode)) {
    if (forceUpdate || snapshot.changes.test(RequestedLayerState::Changes::Metadata)) {
        if (snapshot.changes.test(RequestedLayerState::Changes::GameMode)) {
            snapshot.gameMode = requested.metadata.has(gui::METADATA_GAME_MODE)
                    ? requested.gameMode
                    : parentSnapshot.gameMode;
        }
        updateMetadata(snapshot, requested, args);
        if (args.includeMetadata) {
            snapshot.layerMetadata = parentSnapshot.layerMetadata;
Loading