From patchwork Tue Jul 18 17:23:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Praveen Paneri X-Patchwork-Id: 9849171 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1A25E600CC for ; Tue, 18 Jul 2017 17:13:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFD67285D3 for ; Tue, 18 Jul 2017 17:13:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4D79285D1; Tue, 18 Jul 2017 17:13:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8ADCF285D1 for ; Tue, 18 Jul 2017 17:13:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 324AC89F6F; Tue, 18 Jul 2017 17:13:38 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 997986E38F for ; Tue, 18 Jul 2017 17:13:33 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 18 Jul 2017 10:13:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,378,1496127600"; d="scan'208";a="880154478" Received: from intel-desktop.iind.intel.com ([10.223.26.163]) by FMSMGA003.fm.intel.com with ESMTP; 18 Jul 2017 10:13:32 -0700 From: Praveen Paneri To: intel-gfx@lists.freedesktop.org Date: Tue, 18 Jul 2017 22:53:00 +0530 Message-Id: <1500398580-15846-6-git-send-email-praveen.paneri@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500398580-15846-1-git-send-email-praveen.paneri@intel.com> References: <1500398580-15846-1-git-send-email-praveen.paneri@intel.com> Cc: paulo.r.zanoni@intel.com, Praveen Paneri Subject: [Intel-gfx] [PATCH i-g-t v3 5/5] igt/kms_fbc_crc.c : Add Y-tile tests 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-Virus-Scanned: ClamAV using ClamSMTP From: Praveen Paneri Now that we have support for Y-tiled buffers, add another iteration of tests for Y-tiled buffers. v3: - Iterate over tiling modifier instead of tiling constant (Paulo) - Improved logging and fixed indentation (Paulo) Signed-off-by: Praveen Paneri --- tests/kms_fbc_crc.c | 69 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 25 deletions(-) diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c index 7964e05..74debfb 100644 --- a/tests/kms_fbc_crc.c +++ b/tests/kms_fbc_crc.c @@ -318,12 +318,10 @@ static void prepare_crtc(data_t *data) igt_output_set_pipe(output, data->pipe); } -static void create_fbs(data_t *data, bool tiled, struct igt_fb *fbs) +static void create_fbs(data_t *data, uint64_t tiling, struct igt_fb *fbs) { int rc; drmModeModeInfo *mode = igt_output_get_mode(data->output); - uint64_t tiling = tiled ? LOCAL_I915_FORMAT_MOD_X_TILED : - LOCAL_DRM_FORMAT_MOD_NONE; rc = igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888, tiling, @@ -344,8 +342,8 @@ static void get_ref_crcs(data_t *data) struct igt_fb fbs[4]; int i; - create_fbs(data, false, &fbs[0]); - create_fbs(data, false, &fbs[2]); + create_fbs(data, LOCAL_DRM_FORMAT_MOD_NONE, &fbs[0]); + create_fbs(data, LOCAL_DRM_FORMAT_MOD_NONE, &fbs[2]); fill_mmap_gtt(data, fbs[2].gem_handle, 0xff); fill_mmap_gtt(data, fbs[3].gem_handle, 0xff); @@ -366,7 +364,7 @@ static void get_ref_crcs(data_t *data) igt_remove_fb(data->drm_fd, &fbs[i]); } -static bool prepare_test(data_t *data, enum test_mode test_mode) +static bool prepare_test(data_t *data, enum test_mode test_mode, uint64_t tiling) { igt_display_t *display = &data->display; igt_output_t *output = data->output; @@ -374,7 +372,7 @@ static bool prepare_test(data_t *data, enum test_mode test_mode) data->primary = igt_output_get_plane_type(data->output, DRM_PLANE_TYPE_PRIMARY); - create_fbs(data, true, data->fb); + create_fbs(data, tiling, data->fb); igt_pipe_crc_free(data->pipe_crc); data->pipe_crc = NULL; @@ -475,6 +473,7 @@ static void run_test(data_t *data, enum test_mode mode) { igt_display_t *display = &data->display; int valid_tests = 0; + uint64_t tiling_methods[] = {LOCAL_I915_FORMAT_MOD_X_TILED, LOCAL_I915_FORMAT_MOD_Y_TILED}; if (mode == TEST_CONTEXT || mode == TEST_PAGE_FLIP_AND_CONTEXT) { drm_intel_context *ctx = drm_intel_gem_context_create(data->bufmgr); @@ -484,32 +483,52 @@ static void run_test(data_t *data, enum test_mode mode) reset_display(data); - for_each_pipe_with_valid_output(display, data->pipe, data->output) { - prepare_crtc(data); + for (int i=0; i < (sizeof(tiling_methods)/sizeof(tiling_methods[0])); + i++) { + uint64_t tiling = tiling_methods[i]; - igt_info("Beginning %s on pipe %s, connector %s\n", - igt_subtest_name(), - kmstest_pipe_name(data->pipe), - igt_output_name(data->output)); + if(intel_gen(intel_get_drm_devid(data->drm_fd)) < 9 && + tiling == LOCAL_I915_FORMAT_MOD_Y_TILED) { + igt_info("Y-tiling not supported for this platform\n"); + continue; + } + + for_each_pipe_with_valid_output(display, + data->pipe, data->output) { + const char *tiling_name = + (tiling == LOCAL_I915_FORMAT_MOD_Y_TILED) ? "x":"y"; + prepare_crtc(data); - if (!prepare_test(data, mode)) { - igt_info("%s on pipe %s, connector %s: SKIPPED\n", + igt_info("Beginning %s on pipe %s, connector " + "%s, %s-tiled\n", igt_subtest_name(), kmstest_pipe_name(data->pipe), - igt_output_name(data->output)); - continue; - } + igt_output_name(data->output), + tiling_name); - valid_tests++; + if (!prepare_test(data, mode, tiling)) { + igt_info("%s on pipe %s, connector " + "%s, %s-tiled: SKIPPED\n", + igt_subtest_name(), + kmstest_pipe_name(data->pipe), + igt_output_name(data->output), + tiling_name); + continue; + } - test_crc(data, mode); + valid_tests++; - igt_info("%s on pipe %s, connector %s: PASSED\n", - igt_subtest_name(), - kmstest_pipe_name(data->pipe), - igt_output_name(data->output)); + test_crc(data, mode); - finish_crtc(data, mode); + igt_info("%s on pipe %s, connector %s," + "%s-tiled: PASSED\n", + igt_subtest_name(), + kmstest_pipe_name(data->pipe), + igt_output_name(data->output), + tiling_name); + + finish_crtc(data, mode); + } } igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");