From patchwork Mon Jul 23 18:25:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Sripada, Radhakrishna" X-Patchwork-Id: 10540725 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E7EE1184F for ; Mon, 23 Jul 2018 18:24:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1DBA27861 for ; Mon, 23 Jul 2018 18:24:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C071B27CF9; Mon, 23 Jul 2018 18:24:18 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 A04F727CF3 for ; Mon, 23 Jul 2018 18:24:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8A23E6E320; Mon, 23 Jul 2018 18:24:16 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id C734D6E30C; Mon, 23 Jul 2018 18:24:13 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jul 2018 11:24:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,394,1526367600"; d="scan'208";a="242625873" Received: from invictus.jf.intel.com ([10.54.75.152]) by orsmga005.jf.intel.com with ESMTP; 23 Jul 2018 11:24:12 -0700 From: Radhakrishna Sripada To: igt-dev@lists.freedesktop.org Date: Mon, 23 Jul 2018 11:25:45 -0700 Message-Id: <20180723182545.19461-1-radhakrishna.sripada@intel.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t v7] tests/kms_rotation_crc: Move platform checks to one place for non exhaust fence cases X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, Daniel Vetter Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Anusha Srivatsa Cleanup the testcases by moving the platform checks to a single function. The earlier version of the path is posted here [1] v2: Make use of the property enums to get the supported rotations v3: Move hardcodings to a single function(Ville) v4: Include the cherryview exception for reflect subtest(Maarten) v5: Rebase and move the check from CNL to ICL for reflect-x case v6: Fix the CI regression v7: rebase [1]: https://patchwork.freedesktop.org/patch/209647/ Cc: Radhakrishna Sripada Cc: Ville Syrjälä Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Mika Kahola Signed-off-by: Anusha Srivatsa Signed-off-by: Radhakrishna Sripada --- tests/kms_rotation_crc.c | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c index 6cb5858adb0f..f20b8a6d4ba1 100644 --- a/tests/kms_rotation_crc.c +++ b/tests/kms_rotation_crc.c @@ -43,6 +43,7 @@ typedef struct { uint32_t override_fmt; uint64_t override_tiling; int devid; + int gen; } data_t; typedef struct { @@ -284,6 +285,17 @@ static void prepare_fbs(data_t *data, igt_output_t *output, igt_plane_set_position(plane, data->pos_x, data->pos_y); } +static void igt_check_rotation(data_t *data) +{ + if (data->rotation & (IGT_ROTATION_90 | IGT_ROTATION_270)) + igt_require(data->gen >= 9); + if (data->rotation & IGT_REFLECT_X) + igt_require(data->gen >= 11 || + (IS_CHERRYVIEW(data->devid) && (data->rotation & IGT_ROTATION_0))); + if (data->rotation & IGT_ROTATION_180) + igt_require(data->gen >= 4); +} + static void test_single_case(data_t *data, enum pipe pipe, igt_output_t *output, igt_plane_t *plane, enum rectangle_type rect, @@ -352,15 +364,18 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form igt_display_require_output(display); + igt_check_rotation(data); + for_each_pipe_with_valid_output(display, pipe, output) { igt_plane_t *plane; int i, j; - if (IS_CHERRYVIEW(data->devid) && pipe != PIPE_B) - continue; - igt_output_set_pipe(output, pipe); + if (IS_CHERRYVIEW(data->devid) && (data->rotation & IGT_REFLECT_X) && + pipe != kmstest_pipe_to_index('B')) + continue; + plane = igt_output_get_plane_type(output, plane_type); igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION)); @@ -521,14 +536,13 @@ igt_main }; data_t data = {}; - int gen = 0; igt_skip_on_simulation(); igt_fixture { data.gfx_fd = drm_open_driver_master(DRIVER_INTEL); data.devid = intel_get_drm_devid(data.gfx_fd); - gen = intel_gen(data.devid); + data.gen = intel_gen(data.devid); kmstest_set_vt_graphics_mode(); @@ -541,16 +555,12 @@ igt_main igt_subtest_f("%s-rotation-%s", plane_test_str(subtest->plane), rot_test_str(subtest->rot)) { - igt_require(!(subtest->rot & - (IGT_ROTATION_90 | IGT_ROTATION_270)) || - gen >= 9); data.rotation = subtest->rot; test_plane_rotation(&data, subtest->plane, false); } } igt_subtest_f("sprite-rotation-90-pos-100-0") { - igt_require(gen >= 9); data.rotation = IGT_ROTATION_90; data.pos_x = 100, data.pos_y = 0; @@ -560,7 +570,6 @@ igt_main data.pos_y = 0; igt_subtest_f("bad-pixel-format") { - igt_require(gen >= 9); data.rotation = IGT_ROTATION_90; data.override_fmt = DRM_FORMAT_RGB565; test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY, true); @@ -568,7 +577,6 @@ igt_main data.override_fmt = 0; igt_subtest_f("bad-tiling") { - igt_require(gen >= 9); data.rotation = IGT_ROTATION_90; data.override_tiling = LOCAL_I915_FORMAT_MOD_X_TILED; test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY, true); @@ -579,9 +587,6 @@ igt_main igt_subtest_f("primary-%s-reflect-x-%s", tiling_test_str(reflect_x->tiling), rot_test_str(reflect_x->rot)) { - igt_require(gen >= 10 || - (IS_CHERRYVIEW(data.devid) && reflect_x->rot == IGT_ROTATION_0 - && reflect_x->tiling == LOCAL_I915_FORMAT_MOD_X_TILED)); data.rotation = (IGT_REFLECT_X | reflect_x->rot); data.override_tiling = reflect_x->tiling; test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY, false); @@ -596,7 +601,7 @@ igt_main enum pipe pipe; igt_output_t *output; - igt_require(gen >= 9); + igt_require(data.gen >= 9); igt_display_require_output(&data.display); for_each_pipe_with_valid_output(&data.display, pipe, output) {