Loading services/surfaceflinger/Scheduler/LayerHistory.cpp +21 −0 Original line number Diff line number Diff line Loading @@ -167,6 +167,27 @@ void LayerHistory::setDefaultFrameRateCompatibility(int32_t id, info->setDefaultLayerVote(getVoteType(frameRateCompatibility, contentDetectionEnabled)); } void LayerHistory::setLayerProperties(int32_t id, const LayerProps& properties) { std::lock_guard lock(mLock); auto [found, layerPair] = findLayer(id); if (found == LayerStatus::NotFound) { // Offscreen layer ALOGV("%s: %d not registered", __func__, id); return; } const auto& info = layerPair->second; info->setProperties(properties); // Activate layer if inactive and visible. if (found == LayerStatus::LayerInInactiveMap && info->isVisible()) { mActiveLayerInfos.insert( {id, std::make_pair(layerPair->first, std::move(layerPair->second))}); mInactiveLayerInfos.erase(id); } } auto LayerHistory::summarize(const RefreshRateSelector& selector, nsecs_t now) -> Summary { ATRACE_CALL(); Summary summary; Loading services/surfaceflinger/Scheduler/LayerHistory.h +1 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ public: // does not set a preference for refresh rate. void setDefaultFrameRateCompatibility(int32_t id, FrameRateCompatibility frameRateCompatibility, bool contentDetectionEnabled); void setLayerProperties(int32_t id, const LayerProps&); using Summary = std::vector<RefreshRateSelector::LayerRequirement>; // Rebuilds sets of active/inactive layers, and accumulates stats for active layers. Loading services/surfaceflinger/Scheduler/LayerInfo.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,10 @@ void LayerInfo::setLastPresentTime(nsecs_t lastPresentTime, nsecs_t now, LayerUp } } void LayerInfo::setProperties(const android::scheduler::LayerProps& properties) { *mLayerProps = properties; } bool LayerInfo::isFrameTimeValid(const FrameTimeData& frameTime) const { return frameTime.queueTime >= std::chrono::duration_cast<std::chrono::nanoseconds>( mFrameTimeValidSince.time_since_epoch()) Loading services/surfaceflinger/Scheduler/LayerInfo.h +2 −0 Original line number Diff line number Diff line Loading @@ -182,6 +182,8 @@ public: // layer can go back to whatever vote it had before the app voted for it. void setDefaultLayerVote(LayerHistory::LayerVoteType type) { mDefaultVote = type; } void setProperties(const LayerProps&); // Resets the layer vote to its default. void resetLayerVote() { mLayerVote = {mDefaultVote, Fps(), Seamlessness::Default, FrameRateCategory::Default}; Loading services/surfaceflinger/Scheduler/Scheduler.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -654,6 +654,10 @@ void Scheduler::setDefaultFrameRateCompatibility( mFeatures.test(Feature::kContentDetection)); } void Scheduler::setLayerProperties(int32_t id, const android::scheduler::LayerProps& properties) { mLayerHistory.setLayerProperties(id, properties); } void Scheduler::chooseRefreshRateForContent( const surfaceflinger::frontend::LayerHierarchy* hierarchy, bool updateAttachedChoreographer) { Loading Loading
services/surfaceflinger/Scheduler/LayerHistory.cpp +21 −0 Original line number Diff line number Diff line Loading @@ -167,6 +167,27 @@ void LayerHistory::setDefaultFrameRateCompatibility(int32_t id, info->setDefaultLayerVote(getVoteType(frameRateCompatibility, contentDetectionEnabled)); } void LayerHistory::setLayerProperties(int32_t id, const LayerProps& properties) { std::lock_guard lock(mLock); auto [found, layerPair] = findLayer(id); if (found == LayerStatus::NotFound) { // Offscreen layer ALOGV("%s: %d not registered", __func__, id); return; } const auto& info = layerPair->second; info->setProperties(properties); // Activate layer if inactive and visible. if (found == LayerStatus::LayerInInactiveMap && info->isVisible()) { mActiveLayerInfos.insert( {id, std::make_pair(layerPair->first, std::move(layerPair->second))}); mInactiveLayerInfos.erase(id); } } auto LayerHistory::summarize(const RefreshRateSelector& selector, nsecs_t now) -> Summary { ATRACE_CALL(); Summary summary; Loading
services/surfaceflinger/Scheduler/LayerHistory.h +1 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ public: // does not set a preference for refresh rate. void setDefaultFrameRateCompatibility(int32_t id, FrameRateCompatibility frameRateCompatibility, bool contentDetectionEnabled); void setLayerProperties(int32_t id, const LayerProps&); using Summary = std::vector<RefreshRateSelector::LayerRequirement>; // Rebuilds sets of active/inactive layers, and accumulates stats for active layers. Loading
services/surfaceflinger/Scheduler/LayerInfo.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,10 @@ void LayerInfo::setLastPresentTime(nsecs_t lastPresentTime, nsecs_t now, LayerUp } } void LayerInfo::setProperties(const android::scheduler::LayerProps& properties) { *mLayerProps = properties; } bool LayerInfo::isFrameTimeValid(const FrameTimeData& frameTime) const { return frameTime.queueTime >= std::chrono::duration_cast<std::chrono::nanoseconds>( mFrameTimeValidSince.time_since_epoch()) Loading
services/surfaceflinger/Scheduler/LayerInfo.h +2 −0 Original line number Diff line number Diff line Loading @@ -182,6 +182,8 @@ public: // layer can go back to whatever vote it had before the app voted for it. void setDefaultLayerVote(LayerHistory::LayerVoteType type) { mDefaultVote = type; } void setProperties(const LayerProps&); // Resets the layer vote to its default. void resetLayerVote() { mLayerVote = {mDefaultVote, Fps(), Seamlessness::Default, FrameRateCategory::Default}; Loading
services/surfaceflinger/Scheduler/Scheduler.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -654,6 +654,10 @@ void Scheduler::setDefaultFrameRateCompatibility( mFeatures.test(Feature::kContentDetection)); } void Scheduler::setLayerProperties(int32_t id, const android::scheduler::LayerProps& properties) { mLayerHistory.setLayerProperties(id, properties); } void Scheduler::chooseRefreshRateForContent( const surfaceflinger::frontend::LayerHierarchy* hierarchy, bool updateAttachedChoreographer) { Loading