From patchwork Tue Sep 20 08:22:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Vlad X-Patchwork-Id: 9341149 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 42416601C2 for ; Tue, 20 Sep 2016 08:23:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 365F429CD3 for ; Tue, 20 Sep 2016 08:23:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AF2F29CFB; Tue, 20 Sep 2016 08:23: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.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 84D6C29CD3 for ; Tue, 20 Sep 2016 08:23:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 128216E66F; Tue, 20 Sep 2016 08:23:26 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id CBB3A6E66F for ; Tue, 20 Sep 2016 08:23:23 +0000 (UTC) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 20 Sep 2016 01:23:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,366,1470726000"; d="scan'208";a="170892806" Received: from mcvlad-wk.rb.intel.com ([10.237.105.57]) by fmsmga004.fm.intel.com with ESMTP; 20 Sep 2016 01:23:22 -0700 From: Marius Vlad To: intel-gfx@lists.freedesktop.org Date: Tue, 20 Sep 2016 11:22:56 +0300 Message-Id: <1474359776-30667-1-git-send-email-marius.c.vlad@intel.com> X-Mailer: git-send-email 2.8.1 Cc: Rodrigo Vivi Subject: [Intel-gfx] [PATCH i-g-t] tests/kms_psr_sink_crc: Assert if we don't have a valid crtc. 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 In the fixture block for the test we receive a segfault with the following trace: 0 setup_output (data=) at kms_psr_sink_crc.c:115 1 display_init (data=0x7ffd46833cf0) at kms_psr_sink_crc.c:126 2 main (argc=1, argv=) at kms_psr_sink_crc.c:528 And in setup_output(), output.config is: $2 = {crtc = 0x0, connector = 0x6ad460, encoder = 0x0, default_mode = {clock = 361310, hdisplay = 3200, hsync_start = 3248, hsync_end = 3280, htotal = 3316, hskew = 0, vdisplay = 1800, vsync_start = 1802, vsync_end = 1807, vtotal = 1816, vscan = 0, vrefresh = 60, flags = 10, type = 72, name = "3200x1800", '\000' }, connector_scaling_mode = 0, connector_scaling_mode_changed = false, pipe_changed = true, atomic_props_connector = {44, 0}, pipe = -1, valid_crtc_idx_mask = 7} Also, include some warnings in _kmstest_connector_config() in case we fail to retrieve the connector or the crtc. Signed-off-by: Marius Vlad CC: Maarten Lankhorst CC: Rodrigo Vivi CC: Daniel Vetter --- lib/igt_kms.c | 10 +++++++++- tests/kms_psr_sink_crc.c | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 960ecbd..32cd5cf 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -862,8 +862,10 @@ static bool _kmstest_connector_config(int drm_fd, uint32_t connector_id, else connector = drmModeGetConnectorCurrent(drm_fd, connector_id); - if (!connector) + if (!connector) { + igt_warn("drmModeGetConnector(Current) failed\n"); goto err2; + } if (connector->connector_id != connector_id) { igt_warn("connector id doesn't match (%d != %d)\n", @@ -896,6 +898,12 @@ static bool _kmstest_connector_config(int drm_fd, uint32_t connector_id, config->encoder = _kmstest_connector_config_find_encoder(drm_fd, connector, config->pipe); config->crtc = drmModeGetCrtc(drm_fd, resources->crtcs[config->pipe]); + if (!config->crtc) { + igt_warn("drmModeGetCrtc for pipe %s failed\n", + kmstest_pipe_name(config->pipe)); + goto err2; + } + if (connector->connection != DRM_MODE_CONNECTED) goto err2; diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c index 8aafedb..0890d5b 100644 --- a/tests/kms_psr_sink_crc.c +++ b/tests/kms_psr_sink_crc.c @@ -112,6 +112,7 @@ static void setup_output(data_t *data) continue; igt_output_set_pipe(output, pipe); + igt_assert(output->config.crtc != NULL); data->crtc_id = output->config.crtc->crtc_id; data->output = output; data->mode = igt_output_get_mode(output);