From patchwork Thu Aug 31 05:58:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Krisman Bertazi X-Patchwork-Id: 9931215 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 6BB59603B5 for ; Thu, 31 Aug 2017 05:58:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CA0528846 for ; Thu, 31 Aug 2017 05:58:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4584828857; Thu, 31 Aug 2017 05:58:50 +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 0290F2884A for ; Thu, 31 Aug 2017 05:58:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8DFA96E698; Thu, 31 Aug 2017 05:58:49 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id 706276E698 for ; Thu, 31 Aug 2017 05:58:48 +0000 (UTC) Received: from localhost (unknown [IPv6:2a00:5f00:102:0:8c39:81ff:fe68:83db]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: krisman) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id D5F3E269D1A; Thu, 31 Aug 2017 06:58:46 +0100 (BST) From: Gabriel Krisman Bertazi To: intel-gfx@lists.freedesktop.org Date: Thu, 31 Aug 2017 02:58:15 -0300 Message-Id: <20170831055818.11796-5-krisman@collabora.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170831055818.11796-1-krisman@collabora.co.uk> References: <20170831055818.11796-1-krisman@collabora.co.uk> Cc: daniel.vetter@intel.com, daniels@collabora.com, tomeu.vizoso@collabora.com Subject: [Intel-gfx] [PATCH v2 4/7] tests/kms_ccs: Test case where the CCS buffer was not provided 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 Signed-off-by: Gabriel Krisman Bertazi --- tests/kms_ccs.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c index 73025a1e019f..cc41c85c4964 100644 --- a/tests/kms_ccs.c +++ b/tests/kms_ccs.c @@ -33,8 +33,12 @@ enum test_flags { TEST_ROTATE_180 = 1 << 2, TEST_BAD_PIXEL_FORMAT = 1 << 3, TEST_BAD_ROTATION_90 = 1 << 4, + TEST_NO_AUX_BUFFER = 1 << 5, }; +#define TEST_FAIL_ON_ADDFB2 \ + (TEST_BAD_PIXEL_FORMAT | TEST_NO_AUX_BUFFER) + enum test_fb_flags { FB_COMPRESSED = 1 << 0, FB_HAS_PLANE = 1 << 1, @@ -321,16 +325,19 @@ static void generate_fb(data_t *data, struct igt_fb *fb, size[1] = f.pitches[1] * ALIGN(ccs_height, 32); f.handles[0] = gem_create(data->drm_fd, size[0] + size[1]); - f.handles[1] = f.handles[0]; - render_ccs(data, f.handles[1], f.offsets[1], size[1], - height, f.pitches[1]); + + if (!(data->flags & TEST_NO_AUX_BUFFER)) { + f.handles[1] = f.handles[0]; + render_ccs(data, f.handles[1], f.offsets[1], size[1], + height, f.pitches[1]); + } } else f.handles[0] = gem_create(data->drm_fd, size[0]); render_fb(data, f.handles[0], size[0], fb_flags, height, f.pitches[0]); ret = drmIoctl(data->drm_fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f); - if (data->flags & TEST_BAD_PIXEL_FORMAT) { + if (data->flags & TEST_FAIL_ON_ADDFB2) { igt_assert_eq(ret, -1); igt_assert_eq(errno, EINVAL); return; @@ -379,7 +386,7 @@ static void try_config(data_t *data, enum test_fb_flags fb_flags) drm_mode->vdisplay, fb_flags); } - if (data->flags & TEST_BAD_PIXEL_FORMAT) + if (data->flags & TEST_FAIL_ON_ADDFB2) return; igt_plane_set_position(primary, 0, 0); @@ -446,7 +453,8 @@ static void test_output(data_t *data) } if (data->flags & TEST_BAD_PIXEL_FORMAT || - data->flags & TEST_BAD_ROTATION_90) { + data->flags & TEST_BAD_ROTATION_90 || + data->flags & TEST_NO_AUX_BUFFER) { try_config(data, fb_flags | FB_COMPRESSED); } @@ -515,6 +523,11 @@ igt_main } data.plane = NULL; + + data.flags = TEST_NO_AUX_BUFFER; + igt_subtest_f("pipe-%s-missing-ccs-buffer", pipe_name) + test_output(&data); + } igt_fixture