]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/tests: helpers: Add atomic helpers
authorMaxime Ripard <mripard@kernel.org>
Thu, 22 Feb 2024 18:13:48 +0000 (19:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2025 08:45:07 +0000 (10:45 +0200)
[ Upstream commit 66671944e17644804cb0886489e1b8fde924e9b9 ]

The mock device we were creating was missing any of the driver-wide
helpers. That was fine before since we weren't testing the atomic state
path, but we're going to start, so let's use the default
implementations.

Reviewed-by: MaĆ­ra Canal <mcanal@igalia.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240222-kms-hdmi-connector-state-v7-2-8f4af575fce2@kernel.org
Stable-dep-of: 70f29ca3117a ("drm/tests: cmdline: Fix drm_display_mode memory leak")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/tests/drm_kunit_helpers.c

index bccb33b900f390ff070b7e45241d57603f890cab..272a3ba46d602ab01654687fa8a6cf301d06043f 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 
 #include <drm/drm_atomic.h>
+#include <drm/drm_atomic_helper.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_kunit_helpers.h>
 #include <drm/drm_managed.h>
@@ -13,6 +14,8 @@
 #define KUNIT_DEVICE_NAME      "drm-kunit-mock-device"
 
 static const struct drm_mode_config_funcs drm_mode_config_funcs = {
+       .atomic_check   = drm_atomic_helper_check,
+       .atomic_commit  = drm_atomic_helper_commit,
 };
 
 static int fake_probe(struct platform_device *pdev)