diff options
author | Zach Reizner <zachr@google.com> | 2015-10-16 19:06:31 -0700 |
---|---|---|
committer | Zach Reizner <zachr@google.com> | 2015-10-23 15:51:01 -0700 |
commit | 5757e82631820372382d3369c54cc3a1ffef812f (patch) | |
tree | 99c1a4f970a1011cf572808249c7a86ad240af8c /drmdisplaycompositor.h | |
parent | 203f954f267d9027260b0d60c9cc842840fdf229 (diff) |
drm_hwcomposer: implement squashing
Change-Id: Ifd4feaa0de303ddfd519d4415ab31d2a72f26022
Diffstat (limited to 'drmdisplaycompositor.h')
-rw-r--r-- | drmdisplaycompositor.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drmdisplaycompositor.h b/drmdisplaycompositor.h index cacaa66..e9b529b 100644 --- a/drmdisplaycompositor.h +++ b/drmdisplaycompositor.h @@ -40,7 +40,7 @@ class GLWorkerCompositor; class SquashState { public: - static const unsigned kHistoryLength = 6; + static const unsigned kHistoryLength = 6; // TODO: make this number not magic static const unsigned kMaxLayers = 64; struct Region { @@ -60,14 +60,14 @@ class SquashState { } void Init(DrmHwcLayer *layers, size_t num_layers); - void GenerateHistory(DrmHwcLayer *layers, + void GenerateHistory(DrmHwcLayer *layers, size_t num_layers, std::vector<bool> &changed_regions) const; void StableRegionsWithMarginalHistory( const std::vector<bool> &changed_regions, std::vector<bool> &stable_regions) const; - void RecordHistory(DrmHwcLayer *layers, + void RecordHistory(DrmHwcLayer *layers, size_t num_layers, const std::vector<bool> &changed_regions); - void RecordSquashed(const std::vector<bool> &squashed_regions); + bool RecordAndCompareSquashed(const std::vector<bool> &squashed_regions); void Dump(std::ostringstream *out) const; @@ -96,7 +96,7 @@ class DrmDisplayCompositor { bool HaveQueuedComposites() const; SquashState *squash_state() { - return NULL; + return &squash_state_; } private: @@ -109,6 +109,7 @@ class DrmDisplayCompositor { int PrepareFramebuffer(DrmFramebuffer &fb, DrmDisplayComposition *display_comp); + int ApplySquash(DrmDisplayComposition *display_comp); int ApplyPreComposite(DrmDisplayComposition *display_comp); int ApplyFrame(DrmDisplayComposition *display_comp); int ApplyDpms(DrmDisplayComposition *display_comp); @@ -132,6 +133,10 @@ class DrmDisplayCompositor { DrmFramebuffer framebuffers_[DRM_DISPLAY_BUFFERS]; std::unique_ptr<GLWorkerCompositor> pre_compositor_; + SquashState squash_state_; + int squash_framebuffer_index_; + DrmFramebuffer squash_framebuffers_[2]; + // mutable since we need to acquire in HaveQueuedComposites mutable pthread_mutex_t lock_; |