OSDN Git Service

drm/tests: helpers: Create a helper to allocate an atomic state
authorMaxime Ripard <mripard@kernel.org>
Fri, 28 Jul 2023 09:06:19 +0000 (11:06 +0200)
committerMaxime Ripard <mripard@kernel.org>
Mon, 31 Jul 2023 12:19:57 +0000 (14:19 +0200)
commit394ba10e476d092111ebb3419f771bde419a037e
tree1cec1613bf01828a5dc45c588a7b4bc2b0847d3c
parent6e193f9fbbb02e1bde88510a71823e5bf83c2010
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>
drivers/gpu/drm/tests/drm_kunit_helpers.c
include/drm/drm_kunit_helpers.h