From patchwork Mon Jun 26 13:59:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowki X-Patchwork-Id: 9809751 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 26D65603D7 for ; Mon, 26 Jun 2017 14:00:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C9AD28047 for ; Mon, 26 Jun 2017 14:00:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20C48285D1; Mon, 26 Jun 2017 14:00:31 +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 B2C7428047 for ; Mon, 26 Jun 2017 14:00:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F0816E247; Mon, 26 Jun 2017 14:00:30 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 750A06E247 for ; Mon, 26 Jun 2017 14:00:29 +0000 (UTC) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2017 07:00:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,395,1493708400"; d="scan'208";a="985304250" Received: from linux.intel.com ([10.54.29.200]) by orsmga003.jf.intel.com with ESMTP; 26 Jun 2017 07:00:28 -0700 Received: from workstation.fi.intel.com (workstation.fi.intel.com [10.237.68.144]) by linux.intel.com (Postfix) with ESMTP id 5198D580351; Mon, 26 Jun 2017 07:00:27 -0700 (PDT) From: Paul Kocialkowski To: intel-gfx@lists.freedesktop.org Date: Mon, 26 Jun 2017 16:59:06 +0300 Message-Id: <20170626135906.32708-7-paul.kocialkowski@linux.intel.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170626135906.32708-1-paul.kocialkowski@linux.intel.com> References: <20170626135906.32708-1-paul.kocialkowski@linux.intel.com> Cc: Lyude Subject: [Intel-gfx] [PATCH i-g-t 7/7] tests/chamelium: Disconnect connectors without extra reset 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 This removes the reset call from the reset_state function and renames it to disconnect_connector. Since a call to reset is already done in chamelium_init, there is no need to do an extra reset in each test. This allows reducing the execution time a bit. Signed-off-by: Paul Kocialkowski --- tests/chamelium.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/chamelium.c b/tests/chamelium.c index 01ae4cd7..7d6893da 100644 --- a/tests/chamelium.c +++ b/tests/chamelium.c @@ -144,17 +144,17 @@ wait_for_connector(data_t *data, struct chamelium_port *port, } static void -reset_state(data_t *data, struct chamelium_port *port) +disconnect_connector(data_t *data, struct chamelium_port *port) { int p; - chamelium_reset(data->chamelium); - if (port) { + chamelium_unplug(data->chamelium, port); wait_for_connector(data, port, DRM_MODE_DISCONNECTED, false); } else { for (p = 0; p < data->port_count; p++) { port = data->ports[p]; + chamelium_unplug(data->chamelium, port); wait_for_connector(data, port, DRM_MODE_DISCONNECTED, false); } @@ -167,7 +167,7 @@ test_basic_hotplug(data_t *data, struct chamelium_port *port, int toggle_count) struct udev_monitor *mon = igt_watch_hotplug(); int i; - reset_state(data, NULL); + disconnect_connector(data, NULL); igt_hpd_storm_set_threshold(data->drm_fd, 0); for (i = 0; i < toggle_count; i++) { @@ -201,7 +201,7 @@ test_edid_read(data_t *data, struct chamelium_port *port, data->chamelium, port, false); uint64_t edid_blob_id; - reset_state(data, port); + disconnect_connector(data, port); chamelium_port_set_edid(data->chamelium, port, edid_id); chamelium_plug(data->chamelium, port); @@ -270,7 +270,7 @@ test_suspend_resume_hpd(data_t *data, struct chamelium_port *port, { struct udev_monitor *mon = igt_watch_hotplug(); - reset_state(data, port); + disconnect_connector(data, port); /* Make sure we notice new connectors after resuming */ try_suspend_resume_hpd(data, port, state, test, mon, false); @@ -294,7 +294,7 @@ test_suspend_resume_hpd_common(data_t *data, enum igt_suspend_state state, igt_debug("Testing port %s\n", chamelium_port_get_name(port)); } - reset_state(data, NULL); + disconnect_connector(data, NULL); /* Make sure we notice new connectors after resuming */ try_suspend_resume_hpd(data, NULL, state, test, mon, false); @@ -315,7 +315,7 @@ test_suspend_resume_edid_change(data_t *data, struct chamelium_port *port, struct udev_monitor *mon = igt_watch_hotplug(); int delay = chamelium_get_suspend_resume_delay(data->chamelium); - reset_state(data, port); + disconnect_connector(data, port); igt_set_autoresume_delay(delay); @@ -585,7 +585,7 @@ test_hpd_without_ddc(data_t *data, struct chamelium_port *port) { struct udev_monitor *mon = igt_watch_hotplug(); - reset_state(data, port); + disconnect_connector(data, port); igt_flush_hotplugs(mon); /* Disable the DDC on the connector and make sure we still get a @@ -607,7 +607,7 @@ test_hpd_storm_detect(data_t *data, struct chamelium_port *port, int width) int count = 0; igt_require_hpd_storm_ctl(data->drm_fd); - reset_state(data, port); + disconnect_connector(data, port); igt_hpd_storm_set_threshold(data->drm_fd, 1); chamelium_fire_hpd_pulses(data->chamelium, port, width, 10); @@ -632,7 +632,7 @@ static void test_hpd_storm_disable(data_t *data, struct chamelium_port *port, int width) { igt_require_hpd_storm_ctl(data->drm_fd); - reset_state(data, port); + disconnect_connector(data, port); igt_hpd_storm_set_threshold(data->drm_fd, 0); chamelium_fire_hpd_pulses(data->chamelium, port,