summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/Layer.h
diff options
context:
space:
mode:
author Ady Abraham <adyabr@google.com> 2019-04-08 10:44:56 -0700
committer Ady Abraham <adyabr@google.com> 2019-04-08 10:55:32 -0700
commit09bd3920155f0961b303d1cdd0f6027135aff36d (patch)
treee5f577b8de8661a8801fccb9744f53d91741f9a1 /services/surfaceflinger/Layer.h
parent22488f69b442064261f8764e64e3705fd2e22cb3 (diff)
SF: Updating content FPS tracking
1) Each time SF creates a layer, register it with Scheduler and return handle 2) BufferQueueLayer and BufferStateLayer can now send information about buffers for given layers via layer handle. Algorithm for detecting content fps: 1) Keep the refresh rate per layer (explicit timestamp, or 0). 2) Keep information about last 10 present or update timestamps. This will be an indicator for precedence. 3) Choose the MAX refresh rate among last updated layers. For more info see go/surface-flinger-scheduler and go/content-fps-detection-in-scheduler Test: Updating unit tests. Systrace. Change-Id: I988a7a79e9a9f0f61674c9b637c5142db3336177 Bug: 127727337
Diffstat (limited to 'services/surfaceflinger/Layer.h')
-rw-r--r--services/surfaceflinger/Layer.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 8348ce1f38..66e35b6136 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -311,7 +311,10 @@ public:
virtual bool setTransformToDisplayInverse(bool /*transformToDisplayInverse*/) { return false; };
virtual bool setCrop(const Rect& /*crop*/) { return false; };
virtual bool setFrame(const Rect& /*frame*/) { return false; };
- virtual bool setBuffer(const sp<GraphicBuffer>& /*buffer*/) { return false; };
+ virtual bool setBuffer(const sp<GraphicBuffer>& /*buffer*/, nsecs_t /*postTime*/,
+ nsecs_t /*desiredPresentTime*/) {
+ return false;
+ }
virtual bool setAcquireFence(const sp<Fence>& /*fence*/) { return false; };
virtual bool setDataspace(ui::Dataspace /*dataspace*/) { return false; };
virtual bool setHdrMetadata(const HdrMetadata& /*hdrMetadata*/) { return false; };
@@ -450,9 +453,6 @@ public:
}
virtual Rect getCrop(const Layer::State& s) const { return s.crop_legacy; }
- virtual void setPostTime(nsecs_t /*postTime*/) {}
- virtual void setDesiredPresentTime(nsecs_t /*desiredPresentTime*/) {}
-
protected:
virtual bool prepareClientLayer(const RenderArea& renderArea, const Region& clip,
bool useIdentityTransform, Region& clearRegion,
@@ -885,6 +885,9 @@ protected:
// Can only be accessed with the SF state lock held.
bool mChildrenChanged{false};
+ // This is populated if the layer is registered with Scheduler for tracking purposes.
+ std::unique_ptr<scheduler::LayerHistory::LayerHandle> mSchedulerLayerHandle;
+
private:
/**
* Returns an unsorted vector of all layers that are part of this tree.