From patchwork Thu Mar 2 10:08:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 9599823 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 6E6D2600CB for ; Thu, 2 Mar 2017 10:09:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 571D028599 for ; Thu, 2 Mar 2017 10:09:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C2D72859F; Thu, 2 Mar 2017 10:09:28 +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_SIGNED, 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 0E83E28599 for ; Thu, 2 Mar 2017 10:09:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4123B6EAC3; Thu, 2 Mar 2017 10:09:27 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id B62226EAC3 for ; Thu, 2 Mar 2017 10:09:25 +0000 (UTC) Received: by mail-wr0-x242.google.com with SMTP id l37so8790429wrc.3 for ; Thu, 02 Mar 2017 02:09:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=+mm1cn+Oq/z9IM+eMM4jx1VOcd74W2lwrGkHjjv7ovg=; b=QLtSy9OSdSck1EOEtdVM5AZGfn0IbEyPIDBGF/UzoJEeyHEWJf/Muf9xFF9EJFxkvy jkuEyLhqxPswg8KT95MzkFBc2adzSEqJHDzc9UesAKWzVD68vUDoFjWFd8cAdSSF/vmD UIbb+i3RbhKxdZZBpBa8Pj1WHrs0EHpmv6G8gQlpWR5qqPwAilEGuqj4P258AMbptELA h8oBdHuIueCVmuMKI5Uv2EHNKgRU8vnAJl8br/lX7gSFKBz2ypdApGUra7Yu2deJaZXc FspAsNGFR8iUqhrVhSM63OPE6uZ7yxCTr7zSvDJxyC3RUJ4UTswAiNOeA2R0bP8IcDwD 6ipA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=+mm1cn+Oq/z9IM+eMM4jx1VOcd74W2lwrGkHjjv7ovg=; b=SbwfcZEsB+I81jBqTZoThhCiMj4jj1Qss+PKgvlIhT4hQtys4PTWU12YhtOmSIiiw+ KkbPP8b9EoEC2QGSa2D8wpf0vivdPPw2YrONuZUsIR37gaJaNUjb0oSQanoQyKV1F29P pMVHp4OKKhuMsR6Fl1oHGfCTv+IvsdmhTcvWt0RnIzr+HfqLxpq9PQo6cG4aav/cB4qR mhyOAArhPcjod7ppVqh23VOCIwAssxTpr6FrZwS2B89xrDl5PsNvjqmegsFrlv0nJwcN 7R6TGtmcOt8ZmBEJFOQbE4uhWsNB8XAPQWDjCKZqgD4huojnzshURcIAwjGTFjjdcOlQ 2EuA== X-Gm-Message-State: AMke39mbk2Y3w1Tit92cti6Hrq6emH9i7Ht0FuofSTkkFq4oOWpSnn/ONH5o+GgLzj4kOg== X-Received: by 10.223.130.81 with SMTP id 75mr10841907wrb.59.1488449364364; Thu, 02 Mar 2017 02:09:24 -0800 (PST) Received: from cizrna.lan ([109.72.12.6]) by smtp.gmail.com with ESMTPSA id 127sm10539853wmt.20.2017.03.02.02.09.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Mar 2017 02:09:23 -0800 (PST) From: Tomeu Vizoso To: Intel GFX discussion Date: Thu, 2 Mar 2017 11:08:26 +0100 Message-Id: <20170302100826.740-2-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170302100826.740-1-tomeu.vizoso@collabora.com> References: <20170302100826.740-1-tomeu.vizoso@collabora.com> Cc: Tomeu Vizoso Subject: [Intel-gfx] [PATCH i-g-t 2/2] kms_pipe_crc_basic: Skip sequence tests if the source doesn't provide frame numbers 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 Some frame sources such as sinks aren't able to provide meaningful frame numbers, so in those cases just skip the TEST_SEQUENCE tests. Signed-off-by: Tomeu Vizoso --- tests/kms_pipe_crc_basic.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c index dd2ad3c366bc..6c65cfe6e9d3 100644 --- a/tests/kms_pipe_crc_basic.c +++ b/tests/kms_pipe_crc_basic.c @@ -89,7 +89,7 @@ static void test_bad_source(data_t *data) #define TEST_SEQUENCE (1<<0) #define TEST_NONBLOCK (1<<1) -static void +static bool test_read_crc_for_output(data_t *data, int pipe, igt_output_t *output, unsigned flags) { @@ -163,9 +163,24 @@ test_read_crc_for_output(data_t *data, int pipe, igt_output_t *output, for (j = 0; j < (n_crcs - 1); j++) igt_assert_crc_equal(&crcs[j], &crcs[j + 1]); - if (flags & TEST_SEQUENCE) - for (j = 0; j < (n_crcs - 1); j++) - igt_assert_eq(crcs[j].frame + 1, crcs[j + 1].frame); + if (flags & TEST_SEQUENCE) { + if (!crcs[0].has_valid_frame) { + igt_info("Skipping connector, its 'auto' source doesn't give us frame numbers.\n"); + + free(crcs); + igt_pipe_crc_free(pipe_crc); + igt_remove_fb(data->drm_fd, &data->fb); + igt_plane_set_fb(primary, NULL); + + igt_output_set_pipe(output, PIPE_ANY); + + return false; + } else { + for (j = 0; j < (n_crcs - 1); j++) + igt_assert_eq(crcs[j].frame + 1, + crcs[j + 1].frame); + } + } free(crcs); igt_pipe_crc_free(pipe_crc); @@ -174,6 +189,8 @@ test_read_crc_for_output(data_t *data, int pipe, igt_output_t *output, igt_output_set_pipe(output, PIPE_ANY); } + + return true; } static void test_read_crc(data_t *data, int pipe, unsigned flags) @@ -190,8 +207,8 @@ static void test_read_crc(data_t *data, int pipe, unsigned flags) igt_subtest_name(), igt_output_name(output), kmstest_pipe_name(pipe)); - test_read_crc_for_output(data, pipe, output, flags); - valid_connectors ++; + if (test_read_crc_for_output(data, pipe, output, flags)) + valid_connectors ++; } igt_require_f(valid_connectors, "No connector found for pipe %i\n", pipe);