From patchwork Tue Feb 16 20:47:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zanoni, Paulo R" X-Patchwork-Id: 8331821 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 8634FC02AA for ; Tue, 16 Feb 2016 20:47:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E397920272 for ; Tue, 16 Feb 2016 20:47:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 41E1920268 for ; Tue, 16 Feb 2016 20:47:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 985926E881; Tue, 16 Feb 2016 20:47:44 +0000 (UTC) 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 5CDCC6E881 for ; Tue, 16 Feb 2016 20:47:41 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 16 Feb 2016 12:47:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,456,1449561600"; d="scan'208";a="903878499" Received: from cstseng-mobl1.amr.corp.intel.com (HELO panetone.amr.corp.intel.com) ([10.252.200.181]) by fmsmga001.fm.intel.com with ESMTP; 16 Feb 2016 12:47:41 -0800 From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Tue, 16 Feb 2016 18:47:23 -0200 Message-Id: <1455655643-2535-3-git-send-email-paulo.r.zanoni@intel.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455655643-2535-1-git-send-email-paulo.r.zanoni@intel.com> References: <1455655643-2535-1-git-send-email-paulo.r.zanoni@intel.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH igt 2/2] kms_frontbuffer_tracking: add basic subtest 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.2 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 This test executes one of each of the very basic operations with whatever features are enabled by default in the Kernel, without checking their statuses: we only care about the CRCs. Although it's completely redundant, it will be ran by the CI so we can spot regressions both in the specific features and in the frontbuffer tracking subsystem. We're not checking sink CRCs since they're still unreliable and we don't want false negatives in the CI. It takes 5 seconds to run this test on my machines. Signed-off-by: Paulo Zanoni --- tests/kms_frontbuffer_tracking.c | 83 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 80 insertions(+), 3 deletions(-) diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 4d40e24..26e12d0 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -97,12 +97,15 @@ struct test_mode { FBS_COUNT, } fbs; - /* Which features are we going to test now? This is a mask! */ + /* Which features are we going to test now? This is a mask! + * FEATURE_DEFAULT is a special value which instruct the test to just + * keep what's already enabled by default in the Kernel. */ enum { FEATURE_NONE = 0, FEATURE_FBC = 1, FEATURE_PSR = 2, FEATURE_COUNT = 4, + FEATURE_DEFAULT = 4, } feature; /* Possible pixel formats. We just use FORMAT_DEFAULT for most tests and @@ -1103,8 +1106,11 @@ static void unset_all_crtcs(void) } } -static void disable_features(void) +static void disable_features(const struct test_mode *t) { + if (t->feature == FEATURE_DEFAULT) + return; + fbc_disable(); psr_disable(); } @@ -1727,6 +1733,9 @@ static void set_sprite_for_test(const struct test_mode *t, static void enable_features_for_test(const struct test_mode *t) { + if (t->feature == FEATURE_DEFAULT) + return; + if (t->feature & FEATURE_FBC) fbc_enable(); if (t->feature & FEATURE_PSR) @@ -1806,7 +1815,7 @@ static void prepare_subtest_data(const struct test_mode *t, stop_busy_thread(); - disable_features(); + disable_features(t); set_crtc_fbs(t); if (t->screen == SCREEN_OFFSCREEN) @@ -3063,6 +3072,64 @@ static void tilingchange_subtest(const struct test_mode *t) } } +/* + * basic - do some basic operations regardless of which features are enabled + * + * METHOD + * This subtest does page flips and draw operations and checks the CRCs of the + * results. The big difference between this and the others is that here we + * don't enable/disable any features such as FBC or PSR: we go with whatever + * the Kernel has enabled by default for us. This subtest only does things + * that are exercised by the other subtests and in a less exhaustive way: it's + * completely redundant. On the other hand, it is very quick and was created + * with the CI system in mind: it's a quick way to detect regressions, so if + * it fails, then we can run the other subtests to find out why. + * + * EXPECTED RESULTS + * Passed CRC assertions. + * + * FAILURES + * If you get a failure here, you should run the more specific draw and flip + * subtests of each feature in order to discover what exactly is failing and + * why. + * + * TODO: do sink CRC assertions in case sink_crc.supported. Only do this after + * our sink CRC code gets 100% reliable, in order to avoid CI false negatives. + */ +static void basic_subtest(const struct test_mode *t) +{ + struct draw_pattern_info *pattern = &pattern1; + struct modeset_params *params = pick_params(t); + enum igt_draw_method method; + struct igt_fb *fb1, fb2; + int r; + int assertions = DONT_ASSERT_FEATURE_STATUS; + + prepare_subtest(t, pattern); + + create_fb(t->format, params->fb.fb->width, params->fb.fb->height, + LOCAL_I915_FORMAT_MOD_X_TILED, t->plane, &fb2); + fb1 = params->fb.fb; + + for (r = 0, method = 0; method < IGT_DRAW_METHOD_COUNT; method++, r++) { + if (r == pattern->n_rects) { + params->fb.fb = (params->fb.fb == fb1) ? &fb2 : fb1; + + fill_fb_region(¶ms->fb, COLOR_PRIM_BG); + update_wanted_crc(t, &blue_crcs[t->format].crc); + + page_flip_for_params(params, t->flip); + do_assertions(assertions); + + r = 0; + } + + draw_rect(pattern, ¶ms->fb, method, r); + update_wanted_crc(t, &pattern->crcs[t->format][r]); + do_assertions(assertions); + } +} + static int opt_handler(int option, int option_index, void *data) { switch (option) { @@ -3466,6 +3533,16 @@ if (0) suspend_subtest(&t); TEST_MODE_ITER_END + t.pipes = PIPE_SINGLE; + t.screen = SCREEN_PRIM; + t.plane = PLANE_PRI; + t.fbs = FBS_INDIVIDUAL; + t.feature = FEATURE_DEFAULT; + t.format = FORMAT_DEFAULT; + t.flip = FLIP_PAGEFLIP; + igt_subtest("basic") + basic_subtest(&t); + igt_fixture teardown_environment();