drm_hwcomposer: Tidy-up DrmConnector class
Implement DrmConnector instantiation through CreateInstance() static method,
which helps to reduce complexity of DrmDevice::Init() function.
Move Connector-to-CRTC binding information to the DrmDevice class.
Move drm/DrmConnector.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/hwc2_device/HwcDisplay.cpp b/hwc2_device/HwcDisplay.cpp
index f18e00d..54cf867 100644
--- a/hwc2_device/HwcDisplay.cpp
+++ b/hwc2_device/HwcDisplay.cpp
@@ -69,7 +69,7 @@
}
std::stringstream ss;
- ss << "- Display on: " << connector_->name() << "\n"
+ ss << "- Display on: " << connector_->GetName() << "\n"
<< " Flattening state: " << flattening_state_str << "\n"
<< "Statistics since system boot:\n"
<< DumpDelta(total_stats_) << "\n\n"
@@ -363,7 +363,7 @@
HWC2::Error HwcDisplay::GetDisplayName(uint32_t *size, char *name) {
std::ostringstream stream;
- stream << "display-" << connector_->id();
+ stream << "display-" << connector_->GetId();
std::string string = stream.str();
size_t length = string.length();
if (!name) {
@@ -715,9 +715,9 @@
/* Primary display should be always internal,
* otherwise SF will be unhappy and will crash
*/
- if (connector_->internal() || handle_ == kPrimaryDisplay)
+ if (connector_->IsInternal() || handle_ == kPrimaryDisplay)
*outType = static_cast<uint32_t>(HWC2::DisplayConnectionType::Internal);
- else if (connector_->external())
+ else if (connector_->IsExternal())
*outType = static_cast<uint32_t>(HWC2::DisplayConnectionType::External);
else
return HWC2::Error::BadConfig;
@@ -785,7 +785,7 @@
} else {
*outDataSize = blob->length;
}
- *outPort = connector_->id();
+ *outPort = connector_->GetId();
return HWC2::Error::None;
}