backends/drm: drop some unused logging

We're using drm_info to get property values from users. If property logging
in KWin is needed, it will be different from what we had until now
This commit is contained in:
Xaver Hugl 2023-04-11 00:57:31 +02:00
parent 8a0a91fea1
commit 2c86866876
7 changed files with 3 additions and 90 deletions

View file

@ -127,7 +127,7 @@ DrmConnector::DrmConnector(DrmGpu *gpu, uint32_t connectorId)
bool DrmConnector::init()
{
return m_conn && initProps();
return updateProperties();
}
bool DrmConnector::isConnected() const

View file

@ -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()

View file

@ -27,42 +27,6 @@ DrmObject::DrmObject(DrmGpu *gpu, uint32_t objectId, const QVector<PropertyDefin
m_props.resize(m_propertyDefinitions.count());
}
bool DrmObject::initProps()
{
if (!updateProperties()) {
return false;
}
if (KWIN_DRM().isDebugEnabled()) {
auto debug = QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, KWIN_DRM().categoryName()).debug().nospace().noquote();
switch (m_objectType) {
case DRM_MODE_OBJECT_CONNECTOR:
debug << "Connector ";
break;
case DRM_MODE_OBJECT_CRTC:
debug << "Crtc ";
break;
case DRM_MODE_OBJECT_PLANE:
debug << "Plane ";
break;
default:
Q_UNREACHABLE();
}
debug << m_id << " has properties ";
for (size_t i = 0; i < m_props.size(); i++) {
if (i > 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<drmModeObjectProperties> properties(drmModeObjectGetProperties(m_gpu->fd(), m_id, m_objectType));

View file

@ -58,12 +58,6 @@ public:
return m_props[static_cast<uint32_t>(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<PropertyDefinition> &&vector, uint32_t objectType);
bool initProps();
std::vector<std::unique_ptr<DrmProperty>> m_props;
private:

View file

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

View file

@ -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<uint64_t>(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<uint64_t>(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;

View file

@ -93,7 +93,6 @@ public:
return false;
}
QString valueString(uint64_t value) const;
const DrmObject *drmObject() const;
private: