summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMaxime Ripard <mripard@kernel.org>2023-07-28 11:06:19 +0200
committerMaxime Ripard <mripard@kernel.org>2023-07-31 14:19:57 +0200
commit394ba10e476d092111ebb3419f771bde419a037e (patch)
tree1cec1613bf01828a5dc45c588a7b4bc2b0847d3c /include
parent6e193f9fbbb02e1bde88510a71823e5bf83c2010 (diff)
drm/tests: helpers: Create a helper to allocate an atomic state
As we gain more tests, boilerplate to allocate an atomic state and free it starts to be there more and more as well. In order to reduce the allocation boilerplate, we can create a helper to create that atomic state, and call an action when the test is done. This will also clean up the exit path. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: MaĆ­ra Canal <mairacanal@riseup.net> Link: https://lore.kernel.org/r/20230728-kms-kunit-actions-rework-v3-6-952565ccccfe@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/drm/drm_kunit_helpers.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/drm/drm_kunit_helpers.h b/include/drm/drm_kunit_helpers.h
index 4ba5e10653c6..514c8a7a32f0 100644
--- a/include/drm/drm_kunit_helpers.h
+++ b/include/drm/drm_kunit_helpers.h
@@ -90,4 +90,9 @@ __drm_kunit_helper_alloc_drm_device(struct kunit *test,
struct drm_modeset_acquire_ctx *
drm_kunit_helper_acquire_ctx_alloc(struct kunit *test);
+struct drm_atomic_state *
+drm_kunit_helper_atomic_state_alloc(struct kunit *test,
+ struct drm_device *drm,
+ struct drm_modeset_acquire_ctx *ctx);
+
#endif // DRM_KUNIT_HELPERS_H_