Detect some DrmConnector properties and ignore non-desktop displays

BUG: 419032
This commit is contained in:
Xaver Hugl 2020-10-25 19:18:06 +00:00 committed by Vlad Zahorodnii
parent 9cbac6fe3a
commit 4462ecf6ef
5 changed files with 17 additions and 4 deletions

View file

@ -135,6 +135,10 @@ bool DrmGpu::updateOutputs()
delete c;
continue;
}
if (c->isNonDesktop()) {
delete c;
continue;
}
m_connectors << c;
} else {
oldConnectors.removeOne(*it);

View file

@ -47,7 +47,7 @@ void DrmObject::initProp(int n, drmModeObjectProperties *properties, QVector<QBy
}
if (prop->name == m_propsNames[n]) {
qCDebug(KWIN_DRM).nospace() << m_id << ": " << prop->name << "' (id " << prop->prop_id
qCDebug(KWIN_DRM).nospace() << m_id << ": '" << prop->name << "' (id " << prop->prop_id
<< "): " << properties->prop_values[i];
m_props[n] = new Property(prop.data(), properties->prop_values[i], enumNames);
return;
@ -67,7 +67,7 @@ bool DrmObject::doAtomicPopulate(drmModeAtomicReq *req, int firstProperty) const
for (int i = firstProperty; i < m_props.size(); i++) {
auto property = m_props.at(i);
if (!property) {
if (!property || property->isImmutable()) {
continue;
}
ret &= atomicAddProperty(req, property);
@ -113,6 +113,7 @@ DrmObject::Property::Property(drmModePropertyRes *prop, uint64_t val, QVector<QB
: m_propId(prop->prop_id)
, m_propName(prop->name)
, m_value(val)
, m_immutable(prop->flags & DRM_MODE_PROP_IMMUTABLE)
{
if (!enumNames.isEmpty()) {
qCDebug(KWIN_DRM) << m_propName << " can have enums:" << enumNames;

View file

@ -122,6 +122,9 @@ protected:
const QByteArray &name() const {
return m_propName;
}
bool isImmutable() const {
return m_immutable;
}
private:
uint32_t m_propId = 0;
@ -130,6 +133,7 @@ protected:
uint64_t m_value = 0;
QVector<uint64_t> m_enumMap;
QVector<QByteArray> m_enumNames;
bool m_immutable = false;
};
private:

View file

@ -41,6 +41,7 @@ bool DrmConnector::initProps()
{
setPropertyNames( {
QByteArrayLiteral("CRTC_ID"),
QByteArrayLiteral("non-desktop")
});
DrmScopedPointer<drmModeObjectProperties> properties(

View file

@ -25,6 +25,7 @@ public:
enum class PropertyIndex {
CrtcId = 0,
NonDesktop = 1,
Count
};
@ -34,8 +35,10 @@ public:
bool initProps() override;
bool isConnected();
bool isNonDesktop() const {
return m_props.at(static_cast<int>(PropertyIndex::NonDesktop))->value();
}
private:
QVector<uint32_t> m_encoders;
};