summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tests/drm_kunit_helpers.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2025-04-16 07:03:04 +0200
committerIngo Molnar <mingo@kernel.org>2025-04-16 07:03:58 +0200
commit06e09002bc1d46505d6b3bd947ebaf3cec7acab8 (patch)
treeda8b8a243b23ed3e5d9d790878924d65bc463b14 /drivers/gpu/drm/tests/drm_kunit_helpers.c
parent3aba0b40cacdfba4a604dd09315fa6cdbeb0ed90 (diff)
parent1a1d569a75f3ab2923cb62daf356d102e4df2b86 (diff)
Merge branch 'linus' into x86/cpu, to resolve conflicts
Conflicts: tools/arch/x86/include/asm/cpufeatures.h Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/tests/drm_kunit_helpers.c')
-rw-r--r--drivers/gpu/drm/tests/drm_kunit_helpers.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tests/drm_kunit_helpers.c b/drivers/gpu/drm/tests/drm_kunit_helpers.c
index a4eb68f0decc..6f6616cf4966 100644
--- a/drivers/gpu/drm/tests/drm_kunit_helpers.c
+++ b/drivers/gpu/drm/tests/drm_kunit_helpers.c
@@ -279,6 +279,28 @@ static void kunit_action_drm_mode_destroy(void *ptr)
}
/**
+ * drm_kunit_add_mode_destroy_action() - Add a drm_destroy_mode kunit action
+ * @test: The test context object
+ * @mode: The drm_display_mode to destroy eventually
+ *
+ * Registers a kunit action that will destroy the drm_display_mode at
+ * the end of the test.
+ *
+ * If an error occurs, the drm_display_mode will be destroyed.
+ *
+ * Returns:
+ * 0 on success, an error code otherwise.
+ */
+int drm_kunit_add_mode_destroy_action(struct kunit *test,
+ struct drm_display_mode *mode)
+{
+ return kunit_add_action_or_reset(test,
+ kunit_action_drm_mode_destroy,
+ mode);
+}
+EXPORT_SYMBOL_GPL(drm_kunit_add_mode_destroy_action);
+
+/**
* drm_kunit_display_mode_from_cea_vic() - return a mode for CEA VIC for a KUnit test
* @test: The test context object
* @dev: DRM device