From patchwork Tue Nov 14 14:58:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Juha-Pekka Heikkila X-Patchwork-Id: 10057819 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 21077601D3 for ; Tue, 14 Nov 2017 14:58:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A008297C3 for ; Tue, 14 Nov 2017 14:58:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F08C297E9; Tue, 14 Nov 2017 14:58:55 +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.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 A77D9297C3 for ; Tue, 14 Nov 2017 14:58:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 20C326E0C7; Tue, 14 Nov 2017 14:58:54 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9AAD46E0C7 for ; Tue, 14 Nov 2017 14:58:52 +0000 (UTC) Received: by mail-pg0-x242.google.com with SMTP id z184so10145785pgd.13 for ; Tue, 14 Nov 2017 06:58:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cYAq4CpALXO3MU6TtGX16BI5yZwbTygYlDKsGQGit+s=; b=JBzqZqQE96mPNXOQuQPexWKf/LtUA3SgaJ0BCqme6pFb3ve62kEvNh+vaD38zX23vk Rf2kIjvzB/jxcAXaaOw0GoLJoXs6D0kjY9nce+x0YuUsORHMZJ8YtjoN77EXOsXKwYvk GFSsbWkO3ktyUT71Q2Z8ZLfFNA+etVVJtWLCsBk04u1UkEPauObTg+8667K0N7f+W21p uhPjdxnGtPujAQyLQKiq4M7zu2osbc+nmN58YtxuYceejENt76Ja9aQgsCQiwYqEJ18A OjLRLhWs46CqsBq/DZ7aynEM2Gsm0GsZ1d5mYCfQKghfhaTsPE+9xajcOUZUDWtRp7oR yK7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cYAq4CpALXO3MU6TtGX16BI5yZwbTygYlDKsGQGit+s=; b=sV6BAKnPPBMxmVEK9BEPGYS3QMyhEfhrJW8Lr2NoiAbHHXduP0mJE/bBEIvUs6P2H7 jSoLHdRT4ufCIAgJcPm6f6S4pGYsWZQQc/R3TLZBqjgbW9qV1y9MZ/0Wji1cxkl9DA85 M00IaDMmHBniOFJkSvKfzv5sx/oytu/eIp4NKE4J0kg8+pxhVxKW0EETizNNKcHHT27M xVG2QISejMcpChXohvTFO+SPaVo5y5cQF2EBTqTiy3rYU9qfotmm5Pxg9eIQCrNJV38P 8GNZDrnBDVSm+bMWbBPXLNnff+dLP5d19x88/mZ0WWUCJ1dkLWJAF3aX2hfpwXWrJWvs 3U7g== X-Gm-Message-State: AJaThX507brZR3SwREa7vXuTv3u/r/Tq9Mb9VFyFd1I6CRgdLwsyuLH6 tRHhyuAQR8IbuzEc12ygwwnzNA== X-Google-Smtp-Source: AGs4zMaSRA9MnyIh2h7L6fZALuw37Tb3YzKJuf6fUeSiCjdkakDwI05SpRaj8476/5eU4951OCqjpw== X-Received: by 10.159.251.129 with SMTP id m1mr9923970pls.89.1510671531680; Tue, 14 Nov 2017 06:58:51 -0800 (PST) Received: from jheikkil-mobl.fi.intel.com (jfdmzpr05-ext.jf.intel.com. [134.134.139.74]) by smtp.gmail.com with ESMTPSA id w64sm25920942pfj.62.2017.11.14.06.58.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Nov 2017 06:58:51 -0800 (PST) From: Juha-Pekka Heikkila To: intel-gfx@lists.freedesktop.org Date: Tue, 14 Nov 2017 16:58:35 +0200 Message-Id: <1510671515-522-3-git-send-email-juhapekka.heikkila@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510671515-522-1-git-send-email-juhapekka.heikkila@gmail.com> References: <1510671515-522-1-git-send-email-juhapekka.heikkila@gmail.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 2/2] igt/kms_rotation_crc: Add RGB565 90 degree test for gen>9 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Gen10 onwards 90 and 270 degree rotations are supported for RGB565 format. v2 (Ville Syrjälä): As a side effect to keep bad-pixel-format test valid on all supported platforms it need to use DRM_FORMAT_C8 now. While at it clean up kms_rotation_crc test a bit, take out test_plane_rotation_ytiled_obj() function as test_plane_rotation() can basically do the same. Signed-off-by: Juha-Pekka Heikkila --- tests/kms_rotation_crc.c | 101 ++++++++++------------------------------------- 1 file changed, 20 insertions(+), 81 deletions(-) diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c index 27d1f80..0ed2ce3 100644 --- a/tests/kms_rotation_crc.c +++ b/tests/kms_rotation_crc.c @@ -376,7 +376,7 @@ static void test_plane_rotation(data_t *data, int plane_type) igt_plane_set_size(plane, data->fb.height, data->fb.width); ret = igt_display_try_commit2(display, commit); - if (data->override_fmt || data->override_tiling) { + if (data->override_fmt == DRM_FORMAT_C8) { igt_assert_eq(ret, -EINVAL); continue; } @@ -421,70 +421,6 @@ static void test_plane_rotation(data_t *data, int plane_type) igt_require_f(valid_tests, "no valid crtc/connector combinations found\n"); } -static void test_plane_rotation_ytiled_obj(data_t *data, - igt_output_t *output, - int plane_type) -{ - igt_display_t *display = &data->display; - uint64_t tiling = LOCAL_I915_FORMAT_MOD_Y_TILED; - uint32_t format = DRM_FORMAT_XRGB8888; - int bpp = igt_drm_format_to_bpp(format); - enum igt_commit_style commit = COMMIT_LEGACY; - int fd = data->gfx_fd; - igt_plane_t *plane; - drmModeModeInfo *mode; - unsigned int stride, size, w, h; - uint32_t gem_handle; - int ret; - - plane = igt_output_get_plane_type(output, plane_type); - igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION)); - - if (plane_type == DRM_PLANE_TYPE_PRIMARY || plane_type == DRM_PLANE_TYPE_CURSOR) - commit = COMMIT_UNIVERSAL; - - if (plane_type == DRM_PLANE_TYPE_CURSOR) - igt_require(display->has_cursor_plane); - - if (data->display.is_atomic) - commit = COMMIT_ATOMIC; - - mode = igt_output_get_mode(output); - w = mode->hdisplay; - h = mode->vdisplay; - - for (stride = 512; stride < (w * bpp / 8); stride *= 2) - ; - for (size = 1024*1024; size < stride * h; size *= 2) - ; - - gem_handle = gem_create(fd, size); - ret = __gem_set_tiling(fd, gem_handle, I915_TILING_Y, stride); - igt_assert_eq(ret, 0); - - do_or_die(__kms_addfb(fd, gem_handle, w, h, stride, - format, tiling, LOCAL_DRM_MODE_FB_MODIFIERS, - &data->fb.fb_id)); - data->fb.width = w; - data->fb.height = h; - data->fb.gem_handle = gem_handle; - - igt_plane_set_fb(plane, NULL); - igt_display_commit(display); - - igt_plane_set_rotation(plane, data->rotation); - igt_plane_set_fb(plane, &data->fb); - igt_plane_set_size(plane, h, w); - - ret = igt_display_try_commit2(display, commit); - - igt_output_set_pipe(output, PIPE_NONE); - - kmstest_restore_vt_mode(); - igt_remove_fb(fd, &data->fb); - igt_assert_eq(ret, 0); -} - static void test_plane_rotation_exhaust_fences(data_t *data, igt_output_t *output, int plane_type) @@ -697,7 +633,12 @@ igt_main data.pos_x = 0, data.pos_y = 0; data.rotation = IGT_ROTATION_90; - data.override_fmt = DRM_FORMAT_RGB565; + /* + * Inside test_plane_rotation() there's + * check for DRM_FORMAT_C8 to make this + * test work correctly. + */ + data.override_fmt = DRM_FORMAT_C8; test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY); } @@ -709,24 +650,22 @@ igt_main test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY); } - igt_subtest_f("primary-rotation-90-Y-tiled") { - enum pipe pipe; - igt_output_t *output; - int valid_tests = 0; + igt_subtest_f("primary-rotation-90-Y-tiled-16bpp") { + /* + * this test requires hw greater than gen9 + */ + igt_require(gen > 9); + data.rotation = IGT_ROTATION_90; + data.override_fmt = DRM_FORMAT_RGB565; + data.override_tiling = LOCAL_I915_FORMAT_MOD_Y_TILED; + test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY); + } + igt_subtest_f("primary-rotation-90-Y-tiled") { igt_require(gen >= 9); data.rotation = IGT_ROTATION_90; - - for_each_pipe_with_valid_output(&data.display, pipe, output) { - igt_output_set_pipe(output, pipe); - - test_plane_rotation_ytiled_obj(&data, output, DRM_PLANE_TYPE_PRIMARY); - - valid_tests++; - break; - } - - igt_require_f(valid_tests, "no valid crtc/connector combinations found\n"); + data.override_fmt = DRM_FORMAT_XRGB8888; + test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY); } igt_subtest_f("exhaust-fences") {