Commit a461ff91 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

platforms/drm: replace dpms property hack with proper check

Instead of marking the dpms property as immutable, read the
DRM_MODE_PROP_ATOMIC flag and only add atomic properties to
atomic requests.
parent 18f857b1
......@@ -77,7 +77,7 @@ bool DrmObject::atomicPopulate(drmModeAtomicReq *req) const
bool ret = true;
for (const auto &property : qAsConst(m_props)) {
if (property && !property->isImmutable()) {
if (property && !property->isImmutable() && property->isAtomic()) {
ret &= atomicAddProperty(req, property);
}
}
......@@ -108,6 +108,7 @@ 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()) {
......
......@@ -135,16 +135,12 @@ protected:
const QByteArray &name() const {
return m_propName;
}
/**
* while this is usually automatically set, some properties
* (like DPMS) are not meant to be used in AMS
*/
void setImmutable() {
m_immutable = true;
}
bool isImmutable() const {
return m_immutable;
}
bool isAtomic() const {
return m_atomic;
}
drmModePropertyBlobRes *blob() const {
return m_blob.data();
}
......@@ -157,6 +153,7 @@ protected:
QVector<uint64_t> m_enumMap;
QVector<QByteArray> m_enumNames;
bool m_immutable = false;
bool m_atomic;
DrmScopedPointer<drmModePropertyBlobRes> m_blob;
};
......
......@@ -42,14 +42,6 @@ bool DrmConnector::init()
return false;
}
if (auto dpmsProp = m_props[static_cast<uint32_t>(PropertyIndex::Dpms)]) {
// the dpms property makes atomic commits fail
// for legacy it will be explicitly set
dpmsProp->setImmutable();
} 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