From patchwork Wed Nov 15 19:36:57 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: 10060097 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 7EEC0604D4 for ; Wed, 15 Nov 2017 19:37:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FDF22A288 for ; Wed, 15 Nov 2017 19:37:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64FE62A289; Wed, 15 Nov 2017 19:37:26 +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 0AB622A286 for ; Wed, 15 Nov 2017 19:37:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A021589D8D; Wed, 15 Nov 2017 19:37:24 +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 [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5DB286E6C3 for ; Wed, 15 Nov 2017 19:37:23 +0000 (UTC) Received: from localhost (unknown [IPv6:2a00:5f00:102:0:bc15:48ff:fe3a:91d2]) (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 9DCFB26F12A; Wed, 15 Nov 2017 19:37:21 +0000 (GMT) From: Gabriel Krisman Bertazi To: intel-gfx@lists.freedesktop.org Date: Wed, 15 Nov 2017 17:36:57 -0200 Message-Id: <20171115193701.12781-3-krisman@collabora.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171115193701.12781-1-krisman@collabora.co.uk> References: <20171115193701.12781-1-krisman@collabora.co.uk> Cc: ben@bwidawsk.net, daniel.vetter@intel.com Subject: [Intel-gfx] [PATCH i-g-t v5 2/6] lib/igt_kms: Fix off-by-one bug on skip of missing pipe 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 display->n_pipes is zero-indexed, so N returned in igt_display_get_n_pipes is already not a valid pipe. This patch prevents kms_ccs from going nuts when testing the first unexisting pipe. Signed-off-by: Gabriel Krisman Bertazi Reviewed-by: Maarten Lankhorst Reviewed-by: Arkadiusz Hiler Reviewed-by: Ben Widawsky --- lib/igt_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 1d26b8ddbf43..e161f4309439 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1817,7 +1817,7 @@ void igt_display_require_output_on_pipe(igt_display_t *display, enum pipe pipe) { igt_output_t *output; - igt_skip_on_f(igt_display_get_n_pipes(display) < pipe, + igt_skip_on_f(pipe >= igt_display_get_n_pipes(display), "Pipe %s does not exist.\n", kmstest_pipe_name(pipe)); for_each_valid_output_on_pipe(display, pipe, output)