drm_hwcomposer: Tidy-up DrmDevice class
1. Move drm/DrmConnector.h to Normal clang-tidy checks list by fixing
clang-tidy findings.
2. Remove DrmDevice self-reference.
3. Replace shared_ptr reference to DrmDevice in DrmFbImporter with a
pointer, making ResourceManager only owner of DrmDevice and its
chilren.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
diff --git a/hwc2_device/DrmHwcTwo.cpp b/hwc2_device/DrmHwcTwo.cpp
index 698c1e5..31c1440 100644
--- a/hwc2_device/DrmHwcTwo.cpp
+++ b/hwc2_device/DrmHwcTwo.cpp
@@ -42,7 +42,7 @@
return HWC2::Error::BadDisplay;
}
auto display_planes = std::vector<DrmPlane *>();
- for (const auto &plane : drm->planes()) {
+ for (const auto &plane : drm->GetPlanes()) {
if (plane->IsCrtcSupported(*crtc))
display_planes.push_back(plane.get());
}
@@ -164,7 +164,7 @@
}
void DrmHwcTwo::HandleInitialHotplugState(DrmDevice *drmDevice) {
- for (const auto &conn : drmDevice->connectors()) {
+ for (const auto &conn : drmDevice->GetConnectors()) {
int display_id = drmDevice->GetDisplayId(conn.get());
auto &display = displays_.at(display_id);
@@ -178,7 +178,7 @@
void DrmHwcTwo::HandleHotplugUEvent() {
for (const auto &drm : resource_manager_.GetDrmDevices()) {
- for (const auto &conn : drm->connectors()) {
+ for (const auto &conn : drm->GetConnectors()) {
int display_id = drm->GetDisplayId(conn.get());
bool old_state = conn->IsConnected();
diff --git a/hwc2_device/HwcDisplay.cpp b/hwc2_device/HwcDisplay.cpp
index 54cf867..ea3957c 100644
--- a/hwc2_device/HwcDisplay.cpp
+++ b/hwc2_device/HwcDisplay.cpp
@@ -258,8 +258,8 @@
HWC2::Error HwcDisplay::GetClientTargetSupport(uint32_t width, uint32_t height,
int32_t /*format*/,
int32_t dataspace) {
- std::pair<uint32_t, uint32_t> min = drm_->min_resolution();
- std::pair<uint32_t, uint32_t> max = drm_->max_resolution();
+ std::pair<uint32_t, uint32_t> min = drm_->GetMinResolution();
+ std::pair<uint32_t, uint32_t> max = drm_->GetMaxResolution();
if (IsInHeadlessMode()) {
return HWC2::Error::None;
}