From patchwork Tue Mar 21 08:56:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 9636263 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 EE3AB602CC for ; Tue, 21 Mar 2017 08:56:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5BCD27CF9 for ; Tue, 21 Mar 2017 08:56:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA82427F07; Tue, 21 Mar 2017 08:56:41 +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 2345B27CF9 for ; Tue, 21 Mar 2017 08:56:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7F5596E0A6; Tue, 21 Mar 2017 08:56:40 +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 36BBB6E0A6 for ; Tue, 21 Mar 2017 08:56:39 +0000 (UTC) Received: by mail-wr0-x242.google.com with SMTP id g10so21525115wrg.0 for ; Tue, 21 Mar 2017 01:56:39 -0700 (PDT) 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=rwAwDQm1AxNCDnL0L+XMwC1vDxGt7jJBxJ8O4i5l+7c=; b=TAOp5m5h0PLXHK4bTXXmC1s8ETYGu8JzwWGBK6I2tHKxFNHcKutDAziyH3lCYw3ue9 VuMXEmD332ol1JjDwYB1mni19CW5pmsa5ui06/89DaMmLVCUJXKXvA0KNHD9u0bODSsg n75yVcZMK4m8efrCjwYsRWYXvEA9ZCjMQ8xgcrG9igmvgj7BPruSGbenmRd4t5Yv1VIA fgEK57P4eytYhABJkzlLH+Y9bXmdQtxArFbq0ptKVHAF4VIoTEjrrgZwYJYNlMVd260K lilrn4xuOW6apUahQB47KUZF0XUEqqQ+sGLxh7T1VLhvlrrmOGa5hk1NJyRV/MqMc0Is tlCw== 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=rwAwDQm1AxNCDnL0L+XMwC1vDxGt7jJBxJ8O4i5l+7c=; b=MX3r91MoiIXtTu/9QcJJev4dcbfV6OwTqZwH5agQBV8aRY4nAPfBY3sq8+3IX8jdML YIRV085aBCIIQdfT8oLStnbjeB/Wp8DjNIh9tKooZgzsaQIZvuU9QhXhXciy8nvJPO1n nBSFcjGoBHFOpbrDj5XaGBD49PUfniiyfHIP1eOYfYp3wm1rJOLLiOHavQQd4nRTBgK9 qhV2CPMd99yuJmylcSWVGan3W/K9uPED87OqnKVgkcvKBw1Dz+vkjD8b36+rt8nyb2H/ Xo6aMfyENzupl/e1qg73T/1F/aJztvckQHzs4gUpucrGVf5hjN9CS+a6MYvPLhqhy6L8 rq3g== X-Gm-Message-State: AFeK/H0lTE55YSvWxOti8rxigRqA1sVoSTK6mErpU16j5jpVi7rftfRaB9lgJW6l9oMryw== X-Received: by 10.223.164.216 with SMTP id h24mr28033690wrb.128.1490086597937; Tue, 21 Mar 2017 01:56:37 -0700 (PDT) Received: from cizrna.lan ([109.72.12.21]) by smtp.gmail.com with ESMTPSA id y4sm16676419wmy.5.2017.03.21.01.56.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Mar 2017 01:56:37 -0700 (PDT) From: Tomeu Vizoso To: Intel GFX discussion Date: Tue, 21 Mar 2017 09:56:04 +0100 Message-Id: <20170321085604.24319-2-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170321085604.24319-1-tomeu.vizoso@collabora.com> References: <20170321085604.24319-1-tomeu.vizoso@collabora.com> Cc: Tomeu Vizoso Subject: [Intel-gfx] [PATCH i-g-t v3 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. v2: Rebased Signed-off-by: Tomeu Vizoso --- tests/kms_pipe_crc_basic.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c index 49e856abbf4c..5a01fc6c2777 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) { @@ -167,9 +167,23 @@ 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_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_remove_fb(data->drm_fd, &data->fb); @@ -177,6 +191,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) @@ -193,8 +209,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);