Commit 7a9676dc authored by Xaver Hugl's avatar Xaver Hugl
Browse files

Introduce the legacy flag for drm properties

There are properties like for example rotation
that don't have the atomic flag, yet work and
are needed in atomic mode setting.
parent 5839e59e
......@@ -77,7 +77,7 @@ bool DrmObject::atomicPopulate(drmModeAtomicReq *req) const
bool ret = true;
for (const auto &property : qAsConst(m_props)) {
if (property && !property->isImmutable() && property->isAtomic()) {
if (property && !property->isImmutable() && !property->isLegacy()) {
ret &= atomicAddProperty(req, property);
}
}
......@@ -108,7 +108,6 @@ DrmObject::Property::Property(drmModePropertyRes *prop, uint64_t val, const QVec
, m_propName(prop->name)
, m_value(val)
, m_immutable(prop->flags & DRM_MODE_PROP_IMMUTABLE)
, m_atomic(prop->flags & DRM_MODE_PROP_ATOMIC)
, m_blob(blob)
{
if (!enumNames.isEmpty()) {
......
......@@ -138,12 +138,18 @@ protected:
bool isImmutable() const {
return m_immutable;
}
bool isAtomic() const {
return m_atomic;
}
drmModePropertyBlobRes *blob() const {
return m_blob.data();
}
bool isLegacy() const {
return m_legacy;
}
/**
* Makes this property be ignored by DrmObject::atomicPopulate
*/
void setLegacy() {
m_legacy = true;
}
private:
uint32_t m_propId = 0;
......@@ -153,7 +159,7 @@ protected:
QVector<uint64_t> m_enumMap;
QVector<QByteArray> m_enumNames;
const bool m_immutable;
const bool m_atomic;
bool m_legacy = false;
DrmScopedPointer<drmModePropertyBlobRes> m_blob;
};
......
......@@ -67,6 +67,12 @@ bool DrmConnector::init()
return false;
}
if (auto dpmsProp = m_props[static_cast<uint32_t>(PropertyIndex::Dpms)]) {
dpmsProp->setLegacy();
} else {
qCDebug(KWIN_DRM) << "Could not find DPMS property!";
}
// parse edid
if (auto edidProp = m_props[static_cast<uint32_t>(PropertyIndex::Edid)]) {
m_edid = Edid(edidProp->blob()->data, edidProp->blob()->length);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment