From patchwork Mon Dec 4 13:21:22 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: 10090235 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 0206F60580 for ; Mon, 4 Dec 2017 13:22:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F00FD28E2C for ; Mon, 4 Dec 2017 13:22:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E536D28E2D; Mon, 4 Dec 2017 13:22:51 +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 96E0028E2F for ; Mon, 4 Dec 2017 13:22:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 223816E343; Mon, 4 Dec 2017 13:22:51 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6A0EC6E343 for ; Mon, 4 Dec 2017 13:22:50 +0000 (UTC) Received: by mail-pg0-x243.google.com with SMTP id k15so8179812pgr.7 for ; Mon, 04 Dec 2017 05:22:50 -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=jnm+oUCLlq2H1bFKQIhVzymDVuPB1UuFhWkqYVtlJ18=; b=gCgOTTcrfTG3PuNQ/xv3A+VGNxlrtvDOpXvMch9jnVWQ3x1yGE8rT3lYLWzDT3EXO5 sCnn1ykJmAuquBQZ5CxRXYxtfFmHUcx1TRG2tm1pXiko6ghIK6nF17RAvpyIY8eI9x7t 5czONhXVh2KkkJHYXbVAoLzu9cWdN8RhC2iwoOoRyd7fy7DqpcQwZLYu4I+uRxRuWG/v bUaTVz/eOxzEIxq4EHI9uqqFb8bGXN0Jknmooo9mp8FUllFvMzFUDct41+y0OYI8QmIq FDt27r8Kj0uY6JTe5SLSOajhmJtx0t5FNt4GTzmeugHZooxqTNcrpdoQrAwg6cboHD/w 65Zw== 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=jnm+oUCLlq2H1bFKQIhVzymDVuPB1UuFhWkqYVtlJ18=; b=Jjf407e/2AYScC39ACjS8pVB5TfEMDebVHlYznuW4NT6RhLjo5BP/q/T4fd2lhhU2b Rl99pzj4rUhWxejUGBQ1Yjqe2zm/yZJ2ntkbKmadwV5Zxb1UsEy9b32hBT/cLrap8wdM yEXaU0cnB28XuP7b/s18FP83s0fFFcftGO/DObtM1LqTxYLP0pJmk1DR5L5of+e3VsBg aThKHWx6f03YEbx190wF0jKjkLG6XiaFdXWx2YJtr5wjyv3f3euqK9SIcS9wd9/gcW9F xlYeSBDwTCWOF7dpBLMP+P2Pu8JRtcTEUeaFVfdSB55jm6lfHybv3gMwVbonX8/VEPGa lUcw== X-Gm-Message-State: AJaThX52m/HXfvonfTVCOaLyKqwbY+wrHWl5/PAs/NYQ73vtD+Oj1Of3 bm9usSgUScyfV3x+vcYCyoQgqw== X-Google-Smtp-Source: AGs4zMZISTzP0cLNaZKfozEF5uLbUn9PY2bwgWY6qqBmqANHkBdKEEBOmQT1INYFGS1ScZWbIp8lng== X-Received: by 10.84.245.142 with SMTP id j14mr14763210pll.328.1512393769276; Mon, 04 Dec 2017 05:22:49 -0800 (PST) Received: from jheikkil-mobl.fi.intel.com ([192.55.54.41]) by smtp.gmail.com with ESMTPSA id w9sm25120936pfk.16.2017.12.04.05.22.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Dec 2017 05:22:48 -0800 (PST) From: Juha-Pekka Heikkila To: intel-gfx@lists.freedesktop.org Date: Mon, 4 Dec 2017 15:21:22 +0200 Message-Id: <1512393683-18787-2-git-send-email-juhapekka.heikkila@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512393683-18787-1-git-send-email-juhapekka.heikkila@gmail.com> References: <1512393683-18787-1-git-send-email-juhapekka.heikkila@gmail.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 1/2] igt/kms_rotation_crc: Change bad-pixel-format to use DRM_FORMAT_C8 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. v3 (Ville Syrjälä): repurpose test_plane_rotation_ytiled_obj() function for bad pixel testing with DRM_FORMAT_C8 as igt doesn't support this format. v4 (Maarten Lankhorst): Separate inclusion of RGB565 90 degree rotation into its own patch. Signed-off-by: Juha-Pekka Heikkila --- tests/kms_rotation_crc.c | 50 +++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c index 27d1f80..f3b9d61 100644 --- a/tests/kms_rotation_crc.c +++ b/tests/kms_rotation_crc.c @@ -376,10 +376,6 @@ 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) { - igt_assert_eq(ret, -EINVAL); - continue; - } /* Verify commit was ok. */ igt_assert_eq(ret, 0); @@ -421,14 +417,13 @@ 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, +static void test_bad_pixel_format(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); + uint32_t format = DRM_FORMAT_C8; enum igt_commit_style commit = COMMIT_LEGACY; int fd = data->gfx_fd; igt_plane_t *plane; @@ -453,7 +448,7 @@ static void test_plane_rotation_ytiled_obj(data_t *data, w = mode->hdisplay; h = mode->vdisplay; - for (stride = 512; stride < (w * bpp / 8); stride *= 2) + for (stride = 512; stride < w; stride *= 2) ; for (size = 1024*1024; size < stride * h; size *= 2) ; @@ -482,7 +477,9 @@ static void test_plane_rotation_ytiled_obj(data_t *data, kmstest_restore_vt_mode(); igt_remove_fb(fd, &data->fb); - igt_assert_eq(ret, 0); + data->fb.fb_id = 0; + + igt_assert_eq(ret, -EINVAL); } static void test_plane_rotation_exhaust_fences(data_t *data, @@ -693,12 +690,25 @@ igt_main } igt_subtest_f("bad-pixel-format") { + enum pipe pipe; + igt_output_t *output; + int valid_tests = 0; + igt_require(gen >= 9); data.pos_x = 0, data.pos_y = 0; data.rotation = IGT_ROTATION_90; - data.override_fmt = DRM_FORMAT_RGB565; - test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY); + + for_each_pipe_with_valid_output(&data.display, pipe, output) { + igt_output_set_pipe(output, pipe); + + test_bad_pixel_format(&data, output, DRM_PLANE_TYPE_PRIMARY); + + valid_tests++; + break; + } + + igt_require_f(valid_tests, "invalid pixel format accepted for rotation\n"); } igt_subtest_f("bad-tiling") { @@ -710,23 +720,11 @@ igt_main } igt_subtest_f("primary-rotation-90-Y-tiled") { - enum pipe pipe; - igt_output_t *output; - int valid_tests = 0; - 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; + data.override_tiling = LOCAL_I915_FORMAT_MOD_Y_TILED; + test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY); } igt_subtest_f("exhaust-fences") {