diff options
author | Sean Paul <seanpaul@chromium.org> | 2016-05-11 16:29:45 -0400 |
---|---|---|
committer | Sean Paul <seanpaul@chromium.org> | 2016-05-12 14:20:39 -0400 |
commit | ca699be0bcc162c8748abb63cd4f7158733b1466 (patch) | |
tree | 5de723fa59113e26fa8b4c3741fa24abcbec32ad /drmdisplaycomposition.h | |
parent | 39b3784628eb4169b46e71b30c98daf83c93bb8e (diff) |
drm_hwcomposer: Use a vector for composition source_layers
Instead of a 1:1 mapping of layer:plane, use a vector to store
source layers for a composition plane. This will allow us to
represent squash compositions more easily by adding all source
layers to the vector.
This should also facilitate hardware which allows multiple fbs per plane.
BUG=b/28117135
TEST=Tested on ryu
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: I5d4bfc6e9da022eaab047f948cc874d6a8a25746
Diffstat (limited to 'drmdisplaycomposition.h')
-rw-r--r-- | drmdisplaycomposition.h | 55 |
1 files changed, 49 insertions, 6 deletions
diff --git a/drmdisplaycomposition.h b/drmdisplaycomposition.h index 0362404..768ccfb 100644 --- a/drmdisplaycomposition.h +++ b/drmdisplaycomposition.h @@ -53,11 +53,51 @@ enum class DrmCompositionPlaneType : int32_t { kSquash, }; -struct DrmCompositionPlane { - DrmCompositionPlaneType type; - DrmPlane *plane; - DrmCrtc *crtc; - int source_layer; +class DrmCompositionPlane { + public: + DrmCompositionPlane() = default; + DrmCompositionPlane(DrmCompositionPlane &&rhs) = default; + DrmCompositionPlane &operator=(DrmCompositionPlane &&other) = default; + DrmCompositionPlane(DrmCompositionPlaneType type, DrmPlane *plane, + DrmCrtc *crtc) + : type_(type), plane_(plane), crtc_(crtc) { + } + DrmCompositionPlane(DrmCompositionPlaneType type, DrmPlane *plane, + DrmCrtc *crtc, size_t source_layer) + : type_(type), + plane_(plane), + crtc_(crtc), + source_layers_(1, source_layer) { + } + + DrmCompositionPlaneType type() const { + return type_; + } + + DrmPlane *plane() const { + return plane_; + } + void set_plane(DrmPlane *plane) { + plane_ = plane; + } + + DrmCrtc *crtc() const { + return crtc_; + } + + std::vector<size_t> &source_layers() { + return source_layers_; + } + + const std::vector<size_t> &source_layers() const { + return source_layers_; + } + + private: + DrmCompositionPlaneType type_ = DrmCompositionPlaneType::kDisable; + DrmPlane *plane_ = NULL; + DrmCrtc *crtc_ = NULL; + std::vector<size_t> source_layers_; }; class DrmDisplayComposition { @@ -139,7 +179,10 @@ class DrmDisplayComposition { int IncreaseTimelineToPoint(int point); - void EmplaceCompositionPlane(DrmCompositionPlaneType type, int source_layer, + void EmplaceCompositionPlane(DrmCompositionPlaneType type, + std::vector<DrmPlane *> *primary_planes, + std::vector<DrmPlane *> *overlay_planes); + void EmplaceCompositionPlane(size_t source_layer, std::vector<DrmPlane *> *primary_planes, std::vector<DrmPlane *> *overlay_planes); int CreateAndAssignReleaseFences(); |