From patchwork Fri Nov 13 17:12:51 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: 7613071 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 C2110BF90C for ; Fri, 13 Nov 2015 17:13:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E212F20658 for ; Fri, 13 Nov 2015 17:13:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DF35B20653 for ; Fri, 13 Nov 2015 17:13:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 448DF6E638; Fri, 13 Nov 2015 09:13:21 -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 C5BFE6E63D for ; Fri, 13 Nov 2015 09:13:18 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 13 Nov 2015 09:13:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,288,1444719600"; d="scan'208";a="837185268" 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:17 -0800 From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Fri, 13 Nov 2015 15:12:51 -0200 Message-Id: <1447434771-19337-11-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 10/10] kms_frontbuffer_tracking: add tilingchange 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.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 During the review of a recent FBC patch, Ville pointed a problem that happens when we use the page flip IOCTL to switch between buffers that have different tiling formats. This test should catch the problem introduced by that patch - which was not merged, by the way, so the test should be passing. Signed-off-by: Paulo Zanoni --- tests/kms_frontbuffer_tracking.c | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 5f6f3f1..63a2a0d 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -3006,6 +3006,51 @@ static void stridechange_subtest(const struct test_mode *t) igt_remove_fb(drm.fd, &new_fb); } +/** + * tilingchange - alternate between tiled and untiled in multiple ways + * + * METHOD + * This test alternates between tiled and untiled frontbuffers of the same + * size and format through multiple different APIs: the page flip IOCTL, + * normal modesets and the plane APIs. + * + * EXPECTED RESULTS + * FBC gets properly disabled for the untiled FB and reenabled for the + * tiled FB. + * + * FAILURES + * Bad Kernels may somehow leave FBC enabled, which can cause FIFO underruns + * that lead to CRC assertion failures. + */ +static void tilingchange_subtest(const struct test_mode *t) +{ + struct igt_fb new_fb, *old_fb; + struct modeset_params *params = pick_params(t); + enum flip_type flip_type; + + prepare_subtest(t, NULL); + + old_fb = params->fb.fb; + + create_fb(t->format, params->fb.fb->width, params->fb.fb->height, + LOCAL_DRM_FORMAT_MOD_NONE, t->plane, &new_fb); + fill_fb(&new_fb, COLOR_PRIM_BG); + + for (flip_type = 0; flip_type < FLIP_COUNT; flip_type++) { + igt_debug("Flip type: %d\n", flip_type); + + /* Set a buffer with no tiling. */ + params->fb.fb = &new_fb; + page_flip_for_params(params, flip_type); + do_assertions(ASSERT_FBC_DISABLED); + + /* Put FBC back in a working state. */ + params->fb.fb = old_fb; + page_flip_for_params(params, flip_type); + do_assertions(0); + } +} + static int opt_handler(int option, int option_index, void *data) { switch (option) { @@ -3395,6 +3440,9 @@ int main(int argc, char *argv[]) igt_subtest_f("%s-stridechange", feature_str(t.feature)) stridechange_subtest(&t); + + igt_subtest_f("%s-tilingchange", feature_str(t.feature)) + tilingchange_subtest(&t); } if (t.feature & FEATURE_PSR)