Skip to content

Commit 991eb53

Browse files
ChristianKoenigAMDbbrezillon
authored andcommitted
drm/exec: add test case for using a drm_exec multiple times
Not really a common use case, but let's make sure that we don't accidentially break that somehow. CC: Boris Brezillon <[email protected]> Signed-off-by: Christian König <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 616bcea commit 991eb53

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

drivers/gpu/drm/tests/drm_exec_test.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,34 @@ static void test_prepare_array(struct kunit *test)
167167
drm_exec_fini(&exec);
168168
}
169169

170+
static void test_multiple_loops(struct kunit *test)
171+
{
172+
struct drm_exec exec;
173+
174+
drm_exec_init(&exec, DRM_EXEC_INTERRUPTIBLE_WAIT);
175+
drm_exec_until_all_locked(&exec)
176+
{
177+
break;
178+
}
179+
drm_exec_fini(&exec);
180+
181+
drm_exec_init(&exec, DRM_EXEC_INTERRUPTIBLE_WAIT);
182+
drm_exec_until_all_locked(&exec)
183+
{
184+
break;
185+
}
186+
drm_exec_fini(&exec);
187+
KUNIT_SUCCEED(test);
188+
}
189+
170190
static struct kunit_case drm_exec_tests[] = {
171191
KUNIT_CASE(sanitycheck),
172192
KUNIT_CASE(test_lock),
173193
KUNIT_CASE(test_lock_unlock),
174194
KUNIT_CASE(test_duplicates),
175195
KUNIT_CASE(test_prepare),
176196
KUNIT_CASE(test_prepare_array),
197+
KUNIT_CASE(test_multiple_loops),
177198
{}
178199
};
179200

0 commit comments

Comments
 (0)