From d675cf3ed7c7099fe8fa42e3f27d8fc200852275 Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Fri, 14 Aug 2015 14:09:08 -0300 Subject: [PATCH] kms_frontbuffer_tracking: split prepare_subtest() in two functions And remove duplicated code by calling prepare_subtest_data() on rte_subtest(). Signed-off-by: Paulo Zanoni --- tests/kms_frontbuffer_tracking.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index c274ea28..18d349da 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -1725,8 +1725,8 @@ static void set_crtc_fbs(const struct test_mode *t) scnd_mode_params.sprite.fb = &s->scnd_spr; } -static void prepare_subtest(const struct test_mode *t, - struct draw_pattern_info *pattern) +static void prepare_subtest_data(const struct test_mode *t, + struct draw_pattern_info *pattern) { check_test_requirements(t); @@ -1745,7 +1745,10 @@ static void prepare_subtest(const struct test_mode *t, init_crcs(t->format, pattern); enable_features_for_test(t); +} +static void prepare_subtest_screens(const struct test_mode *t) +{ enable_prim_screen_and_wait(t); if (t->screen == SCREEN_PRIM) { if (t->plane == PLANE_CUR) @@ -1766,6 +1769,13 @@ static void prepare_subtest(const struct test_mode *t, } } +static void prepare_subtest(const struct test_mode *t, + struct draw_pattern_info *pattern) +{ + prepare_subtest_data(t, pattern); + prepare_subtest_screens(t); +} + /* * rte - the basic sanity test * @@ -1783,13 +1793,8 @@ static void prepare_subtest(const struct test_mode *t, */ static void rte_subtest(const struct test_mode *t) { - check_test_requirements(t); + prepare_subtest_data(t, NULL); - disable_features(); - set_crtc_fbs(t); - init_blue_crc(t->format); - - enable_features_for_test(t); unset_all_crtcs(); do_assertions(ASSERT_FBC_DISABLED | ASSERT_PSR_DISABLED | DONT_ASSERT_CRC);