diff --git a/src/backends/drm/drm_connector.cpp b/src/backends/drm/drm_connector.cpp index 82ee8090ee..6b94836ac8 100644 --- a/src/backends/drm/drm_connector.cpp +++ b/src/backends/drm/drm_connector.cpp @@ -127,7 +127,7 @@ DrmConnector::DrmConnector(DrmGpu *gpu, uint32_t connectorId) bool DrmConnector::init() { - return m_conn && initProps(); + return updateProperties(); } bool DrmConnector::isConnected() const diff --git a/src/backends/drm/drm_crtc.cpp b/src/backends/drm/drm_crtc.cpp index ad5b1d8c3a..4e1652e6ff 100644 --- a/src/backends/drm/drm_crtc.cpp +++ b/src/backends/drm/drm_crtc.cpp @@ -30,10 +30,7 @@ DrmCrtc::DrmCrtc(DrmGpu *gpu, uint32_t crtcId, int pipeIndex, DrmPlane *primaryP bool DrmCrtc::init() { - if (!m_crtc) { - return false; - } - return initProps(); + return m_crtc && updateProperties(); } void DrmCrtc::flipBuffer() diff --git a/src/backends/drm/drm_object.cpp b/src/backends/drm/drm_object.cpp index a28cebc491..64eb549752 100644 --- a/src/backends/drm/drm_object.cpp +++ b/src/backends/drm/drm_object.cpp @@ -27,42 +27,6 @@ DrmObject::DrmObject(DrmGpu *gpu, uint32_t objectId, const QVector 0) { - debug << ", "; - } - const auto &prop = m_props[i]; - if (prop) { - debug << prop->name() << "=" << prop->valueString(prop->current()); - } else { - debug << m_propertyDefinitions[i].name << " not found"; - } - } - } - return true; -} - bool DrmObject::updateProperties() { DrmUniquePtr properties(drmModeObjectGetProperties(m_gpu->fd(), m_id, m_objectType)); diff --git a/src/backends/drm/drm_object.h b/src/backends/drm/drm_object.h index 72b1d44bcb..df3ce37bd4 100644 --- a/src/backends/drm/drm_object.h +++ b/src/backends/drm/drm_object.h @@ -58,12 +58,6 @@ public: return m_props[static_cast(propIndex)].get(); } - enum class PrintMode { - OnlyChanged, - All - }; - void printProps(PrintMode mode); - protected: enum class Requirement { Required, @@ -85,8 +79,6 @@ protected: DrmObject(DrmGpu *gpu, uint32_t objectId, const QVector &&vector, uint32_t objectType); - bool initProps(); - std::vector> m_props; private: diff --git a/src/backends/drm/drm_plane.cpp b/src/backends/drm/drm_plane.cpp index 4537fa9682..cc1257ad30 100644 --- a/src/backends/drm/drm_plane.cpp +++ b/src/backends/drm/drm_plane.cpp @@ -53,7 +53,7 @@ bool DrmPlane::init() m_possibleCrtcs = p->possible_crtcs; - bool success = initProps(); + bool success = updateProperties(); if (success) { if (const auto prop = getProp(PropertyIndex::Rotation)) { m_supportedTransformations = Transformations(); diff --git a/src/backends/drm/drm_property.cpp b/src/backends/drm/drm_property.cpp index 3a67c8e976..7b187a8de2 100644 --- a/src/backends/drm/drm_property.cpp +++ b/src/backends/drm/drm_property.cpp @@ -144,45 +144,6 @@ drmModePropertyBlobRes *DrmProperty::immutableBlob() const return m_immutableBlob.get(); } -QString DrmProperty::valueString(uint64_t value) const -{ - if (m_isBitmask) { - QString ret; - bool first = true; - for (uint64_t mask = 1; mask >= value && mask != 0; mask <<= 1) { - if (value & mask) { - if (!first) { - ret += " | "; - } - first = false; - uint64_t enumValue = enumForValue(mask); - int enumIndex = 0; - while (!(enumValue & (1ull << enumIndex)) && enumIndex < 64) { - enumIndex++; - } - if (enumIndex < m_enumNames.size()) { - ret += m_enumNames[enumIndex]; - } - } - } - return ret; - } else if (!m_enumNames.isEmpty()) { - if (const uint64_t index = enumForValue(value); index < (uint)m_enumNames.size()) { - return m_enumNames[index]; - } else { - return QStringLiteral("invalid value: %d").arg(value); - } - } else if (m_propName == QStringLiteral("SRC_X") || m_propName == QStringLiteral("SRC_Y") || m_propName == QStringLiteral("SRC_W") || m_propName == QStringLiteral("SRC_H")) { - QString ret; - ret.setNum(value / (float)(1ul << 16)); - return ret; - } else { - QString ret; - ret.setNum(value); - return ret; - } -} - const DrmObject *DrmProperty::drmObject() const { return m_obj; diff --git a/src/backends/drm/drm_property.h b/src/backends/drm/drm_property.h index 57cf17a719..04c208ebf6 100644 --- a/src/backends/drm/drm_property.h +++ b/src/backends/drm/drm_property.h @@ -93,7 +93,6 @@ public: return false; } - QString valueString(uint64_t value) const; const DrmObject *drmObject() const; private: