aboutsummaryrefslogtreecommitdiff
path: root/compositor
diff options
context:
space:
mode:
authorRoman Stratiienko <roman.o.stratiienko@globallogic.com>2022-01-30 20:28:46 +0200
committerRoman Stratiienko <roman.o.stratiienko@globallogic.com>2022-01-31 21:31:32 +0200
commit10be875de071672e61a52ab0679bbc6803df8c51 (patch)
tree0bbe92cbdb37e83745e2bc03a3a1048d8fa989c5 /compositor
parentedb97ed8b58952641aae12f77225df305acead53 (diff)
downloaddrm_hwcomposer-10be875de071672e61a52ab0679bbc6803df8c51.tar.gz
drm_hwcomposer: Tidy-up DrmCrtc class
Implement DrmCrtc instantiation through CreateInstance() static method, which helps to reduce complexity of DrmDevice::Init() function. Move CRTC-to-Display binding information to the DrmDevice class. Move drm/DrmCrtc.h to Normal clang-tidy checks list by fixing clang-tidy findings. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
Diffstat (limited to 'compositor')
-rw-r--r--compositor/DrmDisplayCompositor.cpp15
-rw-r--r--compositor/Planner.cpp2
2 files changed, 9 insertions, 8 deletions
diff --git a/compositor/DrmDisplayCompositor.cpp b/compositor/DrmDisplayCompositor.cpp
index c2e51ee..0cb1d39 100644
--- a/compositor/DrmDisplayCompositor.cpp
+++ b/compositor/DrmDisplayCompositor.cpp
@@ -99,15 +99,15 @@ auto DrmDisplayCompositor::CommitFrame(AtomicCommitArgs &args) -> int {
}
int64_t out_fence = -1;
- if (crtc->out_fence_ptr_property() &&
- !crtc->out_fence_ptr_property().AtomicSet(*pset, (uint64_t)&out_fence)) {
+ if (crtc->GetOutFencePtrProperty() &&
+ !crtc->GetOutFencePtrProperty().AtomicSet(*pset, (uint64_t)&out_fence)) {
return -EINVAL;
}
if (args.active) {
new_frame_state.crtc_active_state = *args.active;
- if (!crtc->active_property().AtomicSet(*pset, *args.active) ||
- !connector->crtc_id_property().AtomicSet(*pset, crtc->id())) {
+ if (!crtc->GetActiveProperty().AtomicSet(*pset, *args.active) ||
+ !connector->crtc_id_property().AtomicSet(*pset, crtc->GetId())) {
return -EINVAL;
}
}
@@ -121,7 +121,7 @@ auto DrmDisplayCompositor::CommitFrame(AtomicCommitArgs &args) -> int {
return -EINVAL;
}
- if (!crtc->mode_property().AtomicSet(*pset, *new_frame_state.mode_blob)) {
+ if (!crtc->GetModeProperty().AtomicSet(*pset, *new_frame_state.mode_blob)) {
return -EINVAL;
}
}
@@ -154,7 +154,8 @@ auto DrmDisplayCompositor::CommitFrame(AtomicCommitArgs &args) -> int {
auto &v = unused_planes;
v.erase(std::remove(v.begin(), v.end(), plane), v.end());
- if (plane->AtomicSetState(*pset, layer, source_layer, crtc->id()) != 0) {
+ if (plane->AtomicSetState(*pset, layer, source_layer, crtc->GetId()) !=
+ 0) {
return -EINVAL;
}
}
@@ -193,7 +194,7 @@ auto DrmDisplayCompositor::CommitFrame(AtomicCommitArgs &args) -> int {
active_frame_state_ = std::move(new_frame_state);
- if (crtc->out_fence_ptr_property()) {
+ if (crtc->GetOutFencePtrProperty()) {
args.out_fence = UniqueFd((int)out_fence);
}
}
diff --git a/compositor/Planner.cpp b/compositor/Planner.cpp
index 24b43ba..d875b4b 100644
--- a/compositor/Planner.cpp
+++ b/compositor/Planner.cpp
@@ -46,7 +46,7 @@ std::tuple<int, std::vector<DrmCompositionPlane>> Planner::ProvisionPlanes(
std::vector<DrmPlane *> planes = GetUsablePlanes(crtc, primary_planes,
overlay_planes);
if (planes.empty()) {
- ALOGE("Display %d has no usable planes", crtc->display());
+ ALOGE("Crtc %d has no usable planes", crtc->GetId());
return std::make_tuple(-ENODEV, std::vector<DrmCompositionPlane>());
}