Loading services/surfaceflinger/Layer.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -3264,7 +3264,7 @@ bool Layer::setBuffer(std::shared_ptr<renderengine::ExternalTexture>& buffer, // If the layer had been updated a TextureView, this would make sure the present time could be // same to TextureView update when it's a small dirty, and get the correct heuristic rate. if (mFlinger->mScheduler->supportSmallDirtyDetection()) { if (mFlinger->mScheduler->supportSmallDirtyDetection(mOwnerAppId)) { if (mDrawingState.useVsyncIdForRefreshRateSelection) { mUsedVsyncIdForRefreshRateSelection = true; } Loading Loading @@ -3297,7 +3297,7 @@ void Layer::recordLayerHistoryBufferUpdate(const scheduler::LayerProps& layerPro } } if (!mFlinger->mScheduler->supportSmallDirtyDetection()) { if (!mFlinger->mScheduler->supportSmallDirtyDetection(mOwnerAppId)) { return static_cast<nsecs_t>(0); } Loading Loading @@ -4440,7 +4440,7 @@ void Layer::updateLastLatchTime(nsecs_t latchTime) { void Layer::setIsSmallDirty(const Region& damageRegion, const ui::Transform& layerToDisplayTransform) { mSmallDirty = false; if (!mFlinger->mScheduler->supportSmallDirtyDetection()) { if (!mFlinger->mScheduler->supportSmallDirtyDetection(mOwnerAppId)) { return; } Loading services/surfaceflinger/Scheduler/Scheduler.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1248,7 +1248,7 @@ void Scheduler::updateSmallAreaDetection( } void Scheduler::setSmallAreaDetectionThreshold(int32_t appId, float threshold) { mSmallAreaDetectionAllowMappings.setThesholdForAppId(appId, threshold); mSmallAreaDetectionAllowMappings.setThresholdForAppId(appId, threshold); } bool Scheduler::isSmallDirtyArea(int32_t appId, uint32_t dirtyArea) { Loading services/surfaceflinger/Scheduler/Scheduler.h +4 −3 Original line number Diff line number Diff line Loading @@ -323,9 +323,10 @@ public: bool updateFrameRateOverrides(GlobalSignals, Fps displayRefreshRate) EXCLUDES(mPolicyLock); // Returns true if the small dirty detection is enabled. bool supportSmallDirtyDetection() const { return mFeatures.test(Feature::kSmallDirtyContentDetection); // Returns true if the small dirty detection is enabled for the appId. bool supportSmallDirtyDetection(int32_t appId) { return mFeatures.test(Feature::kSmallDirtyContentDetection) && mSmallAreaDetectionAllowMappings.getThresholdForAppId(appId).has_value(); } // Injects a delay that is a fraction of the predicted frame duration for the next frame. Loading services/surfaceflinger/Scheduler/SmallAreaDetectionAllowMappings.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ void SmallAreaDetectionAllowMappings::update( } } void SmallAreaDetectionAllowMappings::setThesholdForAppId(int32_t appId, float threshold) { void SmallAreaDetectionAllowMappings::setThresholdForAppId(int32_t appId, float threshold) { if (!isValidThreshold(threshold)) return; std::lock_guard lock(mLock); Loading services/surfaceflinger/Scheduler/SmallAreaDetectionAllowMappings.h +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ class SmallAreaDetectionAllowMappings { public: void update(std::vector<std::pair<int32_t, float>>& appIdThresholdMappings); void setThesholdForAppId(int32_t appId, float threshold) EXCLUDES(mLock); void setThresholdForAppId(int32_t appId, float threshold) EXCLUDES(mLock); std::optional<float> getThresholdForAppId(int32_t uid) EXCLUDES(mLock); private: Loading Loading
services/surfaceflinger/Layer.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -3264,7 +3264,7 @@ bool Layer::setBuffer(std::shared_ptr<renderengine::ExternalTexture>& buffer, // If the layer had been updated a TextureView, this would make sure the present time could be // same to TextureView update when it's a small dirty, and get the correct heuristic rate. if (mFlinger->mScheduler->supportSmallDirtyDetection()) { if (mFlinger->mScheduler->supportSmallDirtyDetection(mOwnerAppId)) { if (mDrawingState.useVsyncIdForRefreshRateSelection) { mUsedVsyncIdForRefreshRateSelection = true; } Loading Loading @@ -3297,7 +3297,7 @@ void Layer::recordLayerHistoryBufferUpdate(const scheduler::LayerProps& layerPro } } if (!mFlinger->mScheduler->supportSmallDirtyDetection()) { if (!mFlinger->mScheduler->supportSmallDirtyDetection(mOwnerAppId)) { return static_cast<nsecs_t>(0); } Loading Loading @@ -4440,7 +4440,7 @@ void Layer::updateLastLatchTime(nsecs_t latchTime) { void Layer::setIsSmallDirty(const Region& damageRegion, const ui::Transform& layerToDisplayTransform) { mSmallDirty = false; if (!mFlinger->mScheduler->supportSmallDirtyDetection()) { if (!mFlinger->mScheduler->supportSmallDirtyDetection(mOwnerAppId)) { return; } Loading
services/surfaceflinger/Scheduler/Scheduler.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1248,7 +1248,7 @@ void Scheduler::updateSmallAreaDetection( } void Scheduler::setSmallAreaDetectionThreshold(int32_t appId, float threshold) { mSmallAreaDetectionAllowMappings.setThesholdForAppId(appId, threshold); mSmallAreaDetectionAllowMappings.setThresholdForAppId(appId, threshold); } bool Scheduler::isSmallDirtyArea(int32_t appId, uint32_t dirtyArea) { Loading
services/surfaceflinger/Scheduler/Scheduler.h +4 −3 Original line number Diff line number Diff line Loading @@ -323,9 +323,10 @@ public: bool updateFrameRateOverrides(GlobalSignals, Fps displayRefreshRate) EXCLUDES(mPolicyLock); // Returns true if the small dirty detection is enabled. bool supportSmallDirtyDetection() const { return mFeatures.test(Feature::kSmallDirtyContentDetection); // Returns true if the small dirty detection is enabled for the appId. bool supportSmallDirtyDetection(int32_t appId) { return mFeatures.test(Feature::kSmallDirtyContentDetection) && mSmallAreaDetectionAllowMappings.getThresholdForAppId(appId).has_value(); } // Injects a delay that is a fraction of the predicted frame duration for the next frame. Loading
services/surfaceflinger/Scheduler/SmallAreaDetectionAllowMappings.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ void SmallAreaDetectionAllowMappings::update( } } void SmallAreaDetectionAllowMappings::setThesholdForAppId(int32_t appId, float threshold) { void SmallAreaDetectionAllowMappings::setThresholdForAppId(int32_t appId, float threshold) { if (!isValidThreshold(threshold)) return; std::lock_guard lock(mLock); Loading
services/surfaceflinger/Scheduler/SmallAreaDetectionAllowMappings.h +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ class SmallAreaDetectionAllowMappings { public: void update(std::vector<std::pair<int32_t, float>>& appIdThresholdMappings); void setThesholdForAppId(int32_t appId, float threshold) EXCLUDES(mLock); void setThresholdForAppId(int32_t appId, float threshold) EXCLUDES(mLock); std::optional<float> getThresholdForAppId(int32_t uid) EXCLUDES(mLock); private: Loading