From patchwork Fri Nov 13 17:12:49 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: 7613041 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id ABC9C9F2E2 for ; Fri, 13 Nov 2015 17:13:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C92C12065D for ; Fri, 13 Nov 2015 17:13:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DC67920653 for ; Fri, 13 Nov 2015 17:13:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 264DC6E62F; 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 CD64E6E62F for ; Fri, 13 Nov 2015 09:13:15 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 13 Nov 2015 09:13:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,288,1444719600"; d="scan'208";a="837185243" 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:14 -0800 From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Fri, 13 Nov 2015 15:12:49 -0200 Message-Id: <1447434771-19337-9-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 08/10] kms_frontbuffer_tracking: expand badstride and stridechange 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 Make those subtests try to change the stride using multiple APIs so we can catch errors that affect full modesets, fast modesets and page flips. Signed-off-by: Paulo Zanoni --- tests/kms_frontbuffer_tracking.c | 52 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 25e6afd..436f1ec 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -2898,24 +2898,47 @@ static void try_invalid_strides(void) */ static void badstride_subtest(const struct test_mode *t) { - struct igt_fb wide_fb; + struct igt_fb wide_fb, *old_fb; struct modeset_params *params = pick_params(t); + int rc; try_invalid_strides(); prepare_subtest(t, NULL); + old_fb = params->fb.fb; + create_fb(t->format, params->fb.fb->width + 4096, params->fb.fb->height, LOCAL_I915_FORMAT_MOD_X_TILED, t->plane, &wide_fb); igt_assert(wide_fb.stride > 16384); fill_fb(&wide_fb, COLOR_PRIM_BG); + /* Try a simple modeset with the new fb. */ params->fb.fb = &wide_fb; set_mode_for_params(params); + do_assertions(ASSERT_FBC_DISABLED); + + /* Go back to the old fb so FBC works again. */ + params->fb.fb = old_fb; + set_mode_for_params(params); + do_assertions(0); + /* We're doing the equivalent of a modeset, but with the planes API. */ + params->fb.fb = &wide_fb; + set_prim_plane_for_params(params); do_assertions(ASSERT_FBC_DISABLED); + params->fb.fb = old_fb; + set_mode_for_params(params); + do_assertions(0); + + /* We can't use the page flip IOCTL to flip to a buffer with a different + * stride. */ + rc = drmModePageFlip(drm.fd, params->crtc_id, wide_fb.fb_id, 0, NULL); + igt_assert(rc == -EINVAL); + do_assertions(0); + igt_remove_fb(drm.fd, &wide_fb); } @@ -2941,22 +2964,43 @@ static void badstride_subtest(const struct test_mode *t) */ static void stridechange_subtest(const struct test_mode *t) { - struct igt_fb new_fb; + struct igt_fb new_fb, *old_fb; struct modeset_params *params = pick_params(t); + int rc; prepare_subtest(t, NULL); + old_fb = params->fb.fb; + create_fb(t->format, params->fb.fb->width + 512, params->fb.fb->height, LOCAL_I915_FORMAT_MOD_X_TILED, t->plane, &new_fb); fill_fb(&new_fb, COLOR_PRIM_BG); + /* We can't assert that FBC will be enabled since there may not be + * enough space for the CFB, but we can check the CRC. */ params->fb.fb = &new_fb; set_mode_for_params(params); + do_assertions(DONT_ASSERT_FEATURE_STATUS); - /* We can't assert that FBC will be enabled since there may not be - * enough space for the CFB, but we can check the CRC. */ + /* Go back to the fb that can have FBC. */ + params->fb.fb = old_fb; + set_mode_for_params(params); + do_assertions(0); + + /* This operation is the same as above, but with the planes API. */ + params->fb.fb = &new_fb; + set_prim_plane_for_params(params); do_assertions(DONT_ASSERT_FEATURE_STATUS); + params->fb.fb = old_fb; + set_prim_plane_for_params(params); + do_assertions(0); + + /* We just can't page flip with a new stride. */ + rc = drmModePageFlip(drm.fd, params->crtc_id, new_fb.fb_id, 0, NULL); + igt_assert(rc == -EINVAL); + do_assertions(0); + igt_remove_fb(drm.fd, &new_fb); }