From patchwork Mon Oct 24 16:55:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Praveen Paneri X-Patchwork-Id: 9392655 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 21EE860762 for ; Mon, 24 Oct 2016 16:51:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11B44291AA for ; Mon, 24 Oct 2016 16:51:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 066A9291B1; Mon, 24 Oct 2016 16:51:48 +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 AC278291AA for ; Mon, 24 Oct 2016 16:51:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3021A6E566; Mon, 24 Oct 2016 16:51:47 +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 ESMTPS id 795416E566 for ; Mon, 24 Oct 2016 16:51:45 +0000 (UTC) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP; 24 Oct 2016 09:51:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,542,1473145200"; d="scan'208";a="23025995" Received: from intel-desktop.iind.intel.com ([10.223.82.55]) by fmsmga006.fm.intel.com with ESMTP; 24 Oct 2016 09:51:44 -0700 From: Praveen Paneri To: intel-gfx@lists.freedesktop.org Date: Mon, 24 Oct 2016 22:25:58 +0530 Message-Id: <1477328158-10817-4-git-send-email-praveen.paneri@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1477328158-10817-1-git-send-email-praveen.paneri@intel.com> References: <1477328158-10817-1-git-send-email-praveen.paneri@intel.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 4/4] tests/kms_draw_crc: add support for Y tiling 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: Paulo Zanoni This is the program that's supposed to test lib/igt_draw. We just added Y tiling support for the library, so add the tests now. Change-Id: Id0a805aab2d804cf82c188326a8562f0ec75c874 Signed-off-by: Paulo Zanoni --- tests/kms_draw_crc.c | 55 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c index cb28052..e8c1fe1 100644 --- a/tests/kms_draw_crc.c +++ b/tests/kms_draw_crc.c @@ -47,6 +47,13 @@ static const uint32_t formats[N_FORMATS] = { DRM_FORMAT_XRGB2101010, }; +#define N_TILING_METHODS 3 +static const uint64_t tilings[N_TILING_METHODS] = { + LOCAL_DRM_FORMAT_MOD_NONE, + LOCAL_I915_FORMAT_MOD_X_TILED, + LOCAL_I915_FORMAT_MOD_Y_TILED, +}; + struct base_crc { bool set; igt_crc_t crc; @@ -152,6 +159,9 @@ static void draw_method_subtest(enum igt_draw_method method, { igt_crc_t crc; + if (tiling == LOCAL_I915_FORMAT_MOD_Y_TILED) + igt_require(intel_gen(intel_get_drm_devid(drm_fd)) >= 9); + kmstest_unset_all_crtcs(drm_fd, drm_res); /* Use IGT_DRAW_MMAP_GTT on an untiled buffer as the parameter for @@ -214,6 +224,11 @@ static void fill_fb_subtest(void) get_fill_crc(LOCAL_I915_FORMAT_MOD_X_TILED, &crc); igt_assert_crc_equal(&crc, &base_crc); + if (intel_gen(intel_get_drm_devid(drm_fd)) >= 9) { + get_fill_crc(LOCAL_I915_FORMAT_MOD_Y_TILED, &crc); + igt_assert_crc_equal(&crc, &base_crc); + } + kmstest_unset_all_crtcs(drm_fd, drm_res); igt_remove_fb(drm_fd, &fb); } @@ -272,28 +287,38 @@ static const char *format_str(int format_index) } } +static const char *tiling_str(int tiling_index) +{ + switch (tilings[tiling_index]) { + case LOCAL_DRM_FORMAT_MOD_NONE: + return "untiled"; + case LOCAL_I915_FORMAT_MOD_X_TILED: + return "xtiled"; + case LOCAL_I915_FORMAT_MOD_Y_TILED: + return "ytiled"; + default: + igt_assert(false); + } +} + igt_main { enum igt_draw_method method; - int format_index; + int format_idx, tiling_idx; igt_fixture setup_environment(); - for (format_index = 0; format_index < N_FORMATS; format_index++) { - for (method = 0; method < IGT_DRAW_METHOD_COUNT; method++) { - igt_subtest_f("draw-method-%s-%s-untiled", - format_str(format_index), - igt_draw_get_method_name(method)) - draw_method_subtest(method, format_index, - LOCAL_DRM_FORMAT_MOD_NONE); - igt_subtest_f("draw-method-%s-%s-tiled", - format_str(format_index), - igt_draw_get_method_name(method)) - draw_method_subtest(method, format_index, - LOCAL_I915_FORMAT_MOD_X_TILED); - } - } + for (format_idx = 0; format_idx < N_FORMATS; format_idx++) { + for (method = 0; method < IGT_DRAW_METHOD_COUNT; method++) { + for (tiling_idx = 0; tiling_idx < N_TILING_METHODS; tiling_idx++) { + igt_subtest_f("draw-method-%s-%s-%s", + format_str(format_idx), + igt_draw_get_method_name(method), + tiling_str(tiling_idx)) + draw_method_subtest(method, format_idx, + tilings[tiling_idx]); + } } } igt_subtest("fill-fb") fill_fb_subtest();