From 70231f2431fcef2045a5d8d3a8e0bd82521a12b4 Mon Sep 17 00:00:00 2001 From: Aleix Pol Gonzalez Date: Wed, 5 Jun 2024 17:07:56 +0200 Subject: [PATCH] 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 --- src/backends/drm/drm_commit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backends/drm/drm_commit.cpp b/src/backends/drm/drm_commit.cpp index 963e4f9fed..bc2be4f7f9 100644 --- a/src/backends/drm/drm_commit.cpp +++ b/src/backends/drm/drm_commit.cpp @@ -47,6 +47,10 @@ DrmAtomicCommit::DrmAtomicCommit(const QList &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; }