From patchwork Fri Mar 17 19:15:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Praveen Paneri X-Patchwork-Id: 9631487 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 91971602D6 for ; Fri, 17 Mar 2017 19:08:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 819512856B for ; Fri, 17 Mar 2017 19:08:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 767E028593; Fri, 17 Mar 2017 19:08:32 +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 C95AD2856B for ; Fri, 17 Mar 2017 19:08:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DB296ED98; Fri, 17 Mar 2017 19:08:31 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id DEFEB6ED98 for ; Fri, 17 Mar 2017 19:08:29 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP; 17 Mar 2017 12:08:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,177,1486454400"; d="scan'208";a="61796200" Received: from intel-desktop.iind.intel.com ([10.223.82.55]) by orsmga002.jf.intel.com with ESMTP; 17 Mar 2017 12:08:27 -0700 From: Praveen Paneri To: intel-gfx@lists.freedesktop.org Date: Sat, 18 Mar 2017 00:45:25 +0530 Message-Id: <1489778126-11988-7-git-send-email-praveen.paneri@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1489778126-11988-1-git-send-email-praveen.paneri@intel.com> References: <1489778126-11988-1-git-send-email-praveen.paneri@intel.com> Cc: paulo.r.zanoni@intel.com, Praveen Paneri Subject: [Intel-gfx] [PATCH 6/7] igt/kms_frontbuffer_tracking: Add Y-tiling support 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 Allow tests to create Y-tiled bufferes using a separate argument to the test without increasing the number of subtests. Signed-off-by: Praveen Paneri --- tests/kms_frontbuffer_tracking.c | 46 +++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 03c7710..0597f10 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -250,6 +250,7 @@ struct { int only_pipes; int shared_fb_x_offset; int shared_fb_y_offset; + uint64_t tiling; } opt = { .check_status = true, .check_crc = true, @@ -262,6 +263,7 @@ struct { .only_pipes = PIPE_COUNT, .shared_fb_x_offset = 500, .shared_fb_y_offset = 500, + .tiling = LOCAL_I915_FORMAT_MOD_X_TILED, }; struct modeset_params { @@ -576,7 +578,7 @@ static void create_fb(enum pixel_format pformat, int width, int height, if (plane == PLANE_CUR) tiling_for_size = LOCAL_DRM_FORMAT_MOD_NONE; else - tiling_for_size = LOCAL_I915_FORMAT_MOD_X_TILED; + tiling_for_size = opt.tiling; igt_calc_fb_size(drm.fd, width, height, bpp, tiling_for_size, &size, &stride); @@ -708,7 +710,7 @@ static void create_shared_fb(enum pixel_format format) big_h = prim_h + scnd_h + offs_h + opt.shared_fb_y_offset; - create_fb(format, big_w, big_h, LOCAL_I915_FORMAT_MOD_X_TILED, + create_fb(format, big_w, big_h, opt.tiling, PLANE_PRI, &s->big); } @@ -742,16 +744,16 @@ static void create_fbs(enum pixel_format format) create_fb(format, prim_mode_params.mode->hdisplay, prim_mode_params.mode->vdisplay, - LOCAL_I915_FORMAT_MOD_X_TILED, PLANE_PRI, &s->prim_pri); + opt.tiling, PLANE_PRI, &s->prim_pri); create_fb(format, prim_mode_params.cursor.w, prim_mode_params.cursor.h, LOCAL_DRM_FORMAT_MOD_NONE, PLANE_CUR, &s->prim_cur); create_fb(format, prim_mode_params.sprite.w, - prim_mode_params.sprite.h, LOCAL_I915_FORMAT_MOD_X_TILED, + prim_mode_params.sprite.h, opt.tiling, PLANE_SPR, &s->prim_spr); create_fb(format, offscreen_fb.w, offscreen_fb.h, - LOCAL_I915_FORMAT_MOD_X_TILED, PLANE_PRI, &s->offscreen); + opt.tiling, PLANE_PRI, &s->offscreen); create_shared_fb(format); @@ -760,11 +762,11 @@ static void create_fbs(enum pixel_format format) create_fb(format, scnd_mode_params.mode->hdisplay, scnd_mode_params.mode->vdisplay, - LOCAL_I915_FORMAT_MOD_X_TILED, PLANE_PRI, &s->scnd_pri); + opt.tiling, PLANE_PRI, &s->scnd_pri); create_fb(format, scnd_mode_params.cursor.w, scnd_mode_params.cursor.h, LOCAL_DRM_FORMAT_MOD_NONE, PLANE_CUR, &s->scnd_cur); create_fb(format, scnd_mode_params.sprite.w, scnd_mode_params.sprite.h, - LOCAL_I915_FORMAT_MOD_X_TILED, PLANE_SPR, &s->scnd_spr); + opt.tiling, PLANE_SPR, &s->scnd_spr); } static bool set_mode_for_params(struct modeset_params *params) @@ -1241,7 +1243,7 @@ static void init_blue_crc(enum pixel_format format, bool mandatory_sink_crc) create_fb(format, prim_mode_params.mode->hdisplay, prim_mode_params.mode->vdisplay, - LOCAL_I915_FORMAT_MOD_X_TILED, PLANE_PRI, &blue); + opt.tiling, PLANE_PRI, &blue); fill_fb(&blue, COLOR_PRIM_BG); @@ -1276,7 +1278,7 @@ static void init_crcs(enum pixel_format format, for (r = 0; r < pattern->n_rects; r++) create_fb(format, prim_mode_params.mode->hdisplay, prim_mode_params.mode->vdisplay, - LOCAL_I915_FORMAT_MOD_X_TILED, PLANE_PRI, &tmp_fbs[r]); + opt.tiling, PLANE_PRI, &tmp_fbs[r]); for (r = 0; r < pattern->n_rects; r++) fill_fb(&tmp_fbs[r], COLOR_PRIM_BG); @@ -2374,7 +2376,7 @@ static void flip_subtest(const struct test_mode *t) prepare_subtest(t, pattern); create_fb(t->format, params->fb.fb->width, params->fb.fb->height, - LOCAL_I915_FORMAT_MOD_X_TILED, t->plane, &fb2); + opt.tiling, t->plane, &fb2); fill_fb(&fb2, bg_color); orig_fb = params->fb.fb; @@ -2420,7 +2422,7 @@ static void fliptrack_subtest(const struct test_mode *t, enum flip_type type) prepare_subtest(t, pattern); create_fb(t->format, params->fb.fb->width, params->fb.fb->height, - LOCAL_I915_FORMAT_MOD_X_TILED, t->plane, &fb2); + opt.tiling, t->plane, &fb2); fill_fb(&fb2, COLOR_PRIM_BG); orig_fb = params->fb.fb; @@ -2631,7 +2633,7 @@ static void fullscreen_plane_subtest(const struct test_mode *t) prepare_subtest(t, pattern); rect = pattern->get_rect(¶ms->fb, 0); - create_fb(t->format, rect.w, rect.h, LOCAL_I915_FORMAT_MOD_X_TILED, + create_fb(t->format, rect.w, rect.h, opt.tiling, t->plane, &fullscreen_fb); /* Call pick_color() again since PRI and SPR may not support the same * pixel formats. */ @@ -2710,7 +2712,7 @@ static void scaledprimary_subtest(const struct test_mode *t) old_fb = params->fb.fb; create_fb(t->format, params->fb.fb->width, params->fb.fb->height, - LOCAL_I915_FORMAT_MOD_X_TILED, + opt.tiling, t->plane, &new_fb); fill_fb(&new_fb, COLOR_BLUE); @@ -2820,7 +2822,7 @@ static void modesetfrombusy_subtest(const struct test_mode *t) prepare_subtest(t, NULL); create_fb(t->format, params->fb.fb->width, params->fb.fb->height, - LOCAL_I915_FORMAT_MOD_X_TILED, t->plane, &fb2); + opt.tiling, t->plane, &fb2); fill_fb(&fb2, COLOR_PRIM_BG); start_busy_thread(params->fb.fb); @@ -2925,7 +2927,7 @@ static void farfromfence_subtest(const struct test_mode *t) target = pick_target(t, params); create_fb(t->format, params->mode->hdisplay, max_height, - LOCAL_I915_FORMAT_MOD_X_TILED, t->plane, &tall_fb); + opt.tiling, t->plane, &tall_fb); fill_fb(&tall_fb, COLOR_PRIM_BG); @@ -3000,7 +3002,7 @@ static void badstride_subtest(const struct test_mode *t) 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); + opt.tiling, t->plane, &wide_fb); igt_assert(wide_fb.stride > 16384); fill_fb(&wide_fb, COLOR_PRIM_BG); @@ -3067,7 +3069,7 @@ static void stridechange_subtest(const struct test_mode *t) 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); + opt.tiling, t->plane, &new_fb); fill_fb(&new_fb, COLOR_PRIM_BG); igt_assert(old_fb->stride != new_fb.stride); @@ -3186,7 +3188,7 @@ static void basic_subtest(const struct test_mode *t) prepare_subtest(t, pattern); create_fb(t->format, params->fb.fb->width, params->fb.fb->height, - LOCAL_I915_FORMAT_MOD_X_TILED, t->plane, &fb2); + opt.tiling, t->plane, &fb2); fb1 = params->fb.fb; for (r = 0, method = 0; method < IGT_DRAW_METHOD_COUNT; method++, r++) { @@ -3255,6 +3257,10 @@ static int opt_handler(int option, int option_index, void *data) igt_assert_eq(opt.only_pipes, PIPE_COUNT); opt.only_pipes = PIPE_DUAL; break; + case 'l': + igt_assert_eq(strtol(optarg, NULL, 0), I915_TILING_Y); + opt.tiling = igt_fb_tiling_to_mod((uint64_t)strtol(optarg, NULL, 0)); + break; default: igt_assert(false); } @@ -3274,7 +3280,8 @@ const char *help_str = " --shared-fb-x offset Use 'offset' as the X offset for the shared FB\n" " --shared-fb-y offset Use 'offset' as the Y offset for the shared FB\n" " --1p-only Only run subtests that use 1 pipe\n" -" --2p-only Only run subtests that use 2 pipes\n"; +" --2p-only Only run subtests that use 2 pipes\n" +" --tiling give 2 for y-tiled, default is x-tiled\n"; static const char *pipes_str(int pipes) { @@ -3413,6 +3420,7 @@ int main(int argc, char *argv[]) { "shared-fb-y", 1, 0, 'y'}, { "1p-only", 0, 0, '1'}, { "2p-only", 0, 0, '2'}, + { "tiling", 1, 0, 'l'}, { 0, 0, 0, 0 } };