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>
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 @@
}
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 @@
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 &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 @@
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::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>());
}