From patchwork Tue Nov 10 14:32:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 7591341 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A4D789F392 for ; Tue, 10 Nov 2015 14:42:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CFAA0205BB for ; Tue, 10 Nov 2015 14:42:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id F1CA62052A for ; Tue, 10 Nov 2015 14:42:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 99DA06E867; Tue, 10 Nov 2015 06:42:56 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A0326E867 for ; Tue, 10 Nov 2015 06:42:55 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 10 Nov 2015 06:42:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,270,1444719600"; d="scan'208";a="816315947" Received: from otc-vmt1.isw.intel.com ([10.237.224.80]) by orsmga001.jf.intel.com with ESMTP; 10 Nov 2015 06:42:35 -0800 From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Tue, 10 Nov 2015 14:32:06 +0000 Message-Id: <1447165926-9637-2-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447165926-9637-1-git-send-email-thomas.wood@intel.com> References: <1447165926-9637-1-git-send-email-thomas.wood@intel.com> Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ Subject: [Intel-gfx] [PATCH i-g-t 2/2] tests/kms_force_connector: reset connectors and edid on exit 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-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Thomas Wood --- tests/kms_force_connector.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c index a79c974..cf918a7 100644 --- a/tests/kms_force_connector.c +++ b/tests/kms_force_connector.c @@ -31,7 +31,7 @@ IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work" igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \ igt_assert_eq(m.vrefresh, r); -static void __attribute__((noreturn)) reset_connectors() +static void reset_connectors() { int drm_fd = 0; drmModeRes *res; @@ -51,8 +51,6 @@ static void __attribute__((noreturn)) reset_connectors() drmModeFreeConnector(connector); } - - exit(0); } static int opt_handler(int opt, int opt_index, void *data) @@ -60,6 +58,7 @@ static int opt_handler(int opt, int opt_index, void *data) switch (opt) { case 'r': reset_connectors(); + exit(0); break; } @@ -172,6 +171,9 @@ int main(int argc, char **argv) igt_fixture { drmModeFreeConnector(vga_connector); + close(drm_fd); + + reset_connectors(); } igt_exit();