From patchwork Fri Nov 13 17:12:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zanoni, Paulo R" X-Patchwork-Id: 7613051 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2E423BF90C for ; Fri, 13 Nov 2015 17:13:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3D40F20661 for ; Fri, 13 Nov 2015 17:13:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 528DD20658 for ; Fri, 13 Nov 2015 17:13:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 888FF6E637; Fri, 13 Nov 2015 09:13:16 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id A6C276E63A for ; Fri, 13 Nov 2015 09:13:14 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 13 Nov 2015 09:13:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,288,1444719600"; d="scan'208";a="837185237" Received: from jh1011-mobl1.gar.corp.intel.com (HELO panetone.amr.corp.intel.com) ([10.252.192.177]) by fmsmga001.fm.intel.com with ESMTP; 13 Nov 2015 09:13:12 -0800 From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Fri, 13 Nov 2015 15:12:48 -0200 Message-Id: <1447434771-19337-8-git-send-email-paulo.r.zanoni@intel.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1447434771-19337-1-git-send-email-paulo.r.zanoni@intel.com> References: <1447434771-19337-1-git-send-email-paulo.r.zanoni@intel.com> Subject: [Intel-gfx] [PATCH igt 07/10] kms_frontbuffer_tracking: move flip_type to struct test_mode X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Handle it just like we handle t->format. IMHO, it's better. Signed-off-by: Paulo Zanoni --- tests/kms_frontbuffer_tracking.c | 81 ++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 994bb4a..25e6afd 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -115,14 +115,17 @@ struct test_mode { FORMAT_DEFAULT = FORMAT_RGB888, } format; - enum igt_draw_method method; -}; + /* There are multiple APIs where we can do the equivalent of a page flip + * and they exercise slightly different codepaths inside the Kernel. */ + enum flip_type { + FLIP_PAGEFLIP, + FLIP_PAGEFLIP_EVENT, + FLIP_MODESET, + FLIP_PLANES, + FLIP_COUNT, + } flip; -enum flip_type { - FLIP_PAGEFLIP, - FLIP_PAGEFLIP_EVENT, - FLIP_MODESET, - FLIP_PLANES, + enum igt_draw_method method; }; enum color { @@ -2264,7 +2267,7 @@ static void page_flip_for_params(struct modeset_params *params, * On a failure here you need to go directly to the Kernel's flip code and see * how it interacts with the feature being tested. */ -static void flip_subtest(const struct test_mode *t, enum flip_type type) +static void flip_subtest(const struct test_mode *t) { int r; int assertions = 0; @@ -2301,7 +2304,7 @@ static void flip_subtest(const struct test_mode *t, enum flip_type type) draw_rect(pattern, ¶ms->fb, t->method, r); update_wanted_crc(t, &pattern->crcs[t->format][r]); - page_flip_for_params(params, type); + page_flip_for_params(params, t->flip); do_assertions(assertions); } @@ -3105,8 +3108,25 @@ static const char *format_str(enum pixel_format format) } } +static const char *flip_str(enum flip_type flip) +{ + switch (flip) { + case FLIP_PAGEFLIP: + return "pg"; + case FLIP_PAGEFLIP_EVENT: + return "ev"; + case FLIP_MODESET: + return "ms"; + case FLIP_PLANES: + return "pl"; + default: + igt_assert(false); + } +} + #define TEST_MODE_ITER_BEGIN(t) \ t.format = FORMAT_DEFAULT; \ + t.flip = FLIP_PAGEFLIP; \ for (t.feature = 0; t.feature < FEATURE_COUNT; t.feature++) { \ for (t.pipes = 0; t.pipes < PIPE_COUNT; t.pipes++) { \ for (t.screen = 0; t.screen < SCREEN_COUNT; t.screen++) { \ @@ -3162,7 +3182,8 @@ int main(int argc, char *argv[]) t.plane = PLANE_PRI; t.fbs = FBS_INDIVIDUAL; t.format = FORMAT_DEFAULT; - /* Make sure nothing is using this value. */ + /* Make sure nothing is using these values. */ + t.flip = -1; t.method = -1; igt_subtest_f("%s-%s-rte", @@ -3189,37 +3210,15 @@ int main(int argc, char *argv[]) (!opt.show_hidden && t.method != IGT_DRAW_BLT)) continue; - igt_subtest_f("%s-%s-%s-%s-flip-%s", - feature_str(t.feature), - pipes_str(t.pipes), - screen_str(t.screen), - fbs_str(t.fbs), - igt_draw_get_method_name(t.method)) - flip_subtest(&t, FLIP_PAGEFLIP); - - igt_subtest_f("%s-%s-%s-%s-evflip-%s", - feature_str(t.feature), - pipes_str(t.pipes), - screen_str(t.screen), - fbs_str(t.fbs), - igt_draw_get_method_name(t.method)) - flip_subtest(&t, FLIP_PAGEFLIP_EVENT); - - igt_subtest_f("%s-%s-%s-%s-msflip-%s", - feature_str(t.feature), - pipes_str(t.pipes), - screen_str(t.screen), - fbs_str(t.fbs), - igt_draw_get_method_name(t.method)) - flip_subtest(&t, FLIP_MODESET); - - igt_subtest_f("%s-%s-%s-%s-plflip-%s", - feature_str(t.feature), - pipes_str(t.pipes), - screen_str(t.screen), - fbs_str(t.fbs), - igt_draw_get_method_name(t.method)) - flip_subtest(&t, FLIP_PLANES); + for (t.flip = 0; t.flip < FLIP_COUNT; t.flip++) + igt_subtest_f("%s-%s-%s-%s-%sflip-%s", + feature_str(t.feature), + pipes_str(t.pipes), + screen_str(t.screen), + fbs_str(t.fbs), + flip_str(t.flip), + igt_draw_get_method_name(t.method)) + flip_subtest(&t); TEST_MODE_ITER_END TEST_MODE_ITER_BEGIN(t)