backends/drm: Complain when we are issuing an invalid drm property

The alternative is silent failures and KWin rendering nothing. The
kernel will only be telling us that something went wrong which makes it
hard to debug.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
This commit is contained in:
Aleix Pol Gonzalez 2024-06-05 17:07:56 +02:00
parent cd2d5b07d5
commit 70231f2431

View file

@ -47,6 +47,10 @@ DrmAtomicCommit::DrmAtomicCommit(const QList<DrmPipeline *> &pipelines)
void DrmAtomicCommit::addProperty(const DrmProperty &prop, uint64_t value)
{
if (Q_UNLIKELY(!prop.isValid())) {
qCWarning(KWIN_DRM) << "Trying to add an invalid property" << prop.name();
return;
}
prop.checkValueInRange(value);
m_properties[prop.drmObject()->id()][prop.propId()] = value;
}