From patchwork Wed Dec 3 17:10:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 5432651 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 238A2BEEA8 for ; Wed, 3 Dec 2014 17:10:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 85739201DD for ; Wed, 3 Dec 2014 17:10:12 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DDDB920295 for ; Wed, 3 Dec 2014 17:10:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D621B89933; Wed, 3 Dec 2014 09:10:06 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by gabe.freedesktop.org (Postfix) with ESMTP id 1BAC189933 for ; Wed, 3 Dec 2014 09:10:04 -0800 (PST) Received: by mail-wi0-f169.google.com with SMTP id r20so33573536wiv.4 for ; Wed, 03 Dec 2014 09:10:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=5jovT8KcPLgKBl+E9RAyQdzXuBfS/fVyHIM7R42OXUY=; b=OnSiouFkexwTqzyyoud4Oa2XUJd6+DukNXM4W9LZWNLtihZi6TLaocffXEYkXl5XCY dvMThNpI3WVMdIWb3HDPrygn9as5KWK1IZqg8SpN6dqxFYVXuUxjx50MNDfEJ0b3iHpK ZIdz475kFqUAOn6oCDtNvduyS0hwgZ0ThP9G1BYRMzOr/UKicPNw0kqtyNeJZASsTu0v yq8NPHQLCzDX4Loy5dYADZ6Pn55rVMrdvGoHm/i5VhOf0hQYwgRbJPfTiduAkvIHzaW3 fmH1Bft0fj/o8EqHH9PZPX1s1bR2PYyHuquTpPhqopLndxf+2hkvlpGp4g4C23NhHUTE Toaw== X-Gm-Message-State: ALoCoQkHK9PrNGdOWAWMGCMYBhPD4IR4BxvFCCxASNNJcJ1vY/57EXqWahW4/cyWhuLIUkiCqU1Z X-Received: by 10.180.74.68 with SMTP id r4mr14560248wiv.33.1417626603939; Wed, 03 Dec 2014 09:10:03 -0800 (PST) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id h2sm37908192wix.5.2014.12.03.09.10.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Dec 2014 09:10:03 -0800 (PST) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Wed, 3 Dec 2014 17:10:02 +0000 Message-Id: <1417626602-1153-1-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 2.1.0 Subject: [Intel-gfx] [PATCH i-g-t] lib: always reset connectors after the state is forced 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Install the exit handler to reset connector states whenever kmstest_force_connector is called, so that the connector states are always reset even if a test fails. Signed-off-by: Thomas Wood --- lib/igt_kms.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index eb8e085..ae7819f 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -256,6 +256,12 @@ void kmstest_set_vt_graphics_mode(void) igt_debug("VT: graphics mode set\n"); } + +static void reset_connectors_at_exit(int sig) +{ + igt_reset_connectors(); +} + /** * kmstest_force_connector: * @fd: drm file descriptor @@ -337,6 +343,7 @@ bool kmstest_force_connector(int drm_fd, drmModeConnector *connector, tmp++; } + igt_install_exit_handler(reset_connectors_at_exit); igt_assert(ret != -1); return (ret == -1) ? false : true; @@ -1659,11 +1666,6 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe) igt_assert(drmWaitVBlank(drm_fd, &wait_vbl) == 0); } -static void reset_connectors_at_exit(int sig) -{ - igt_reset_connectors(); -} - /** * igt_enable_connectors: * @@ -1703,8 +1705,6 @@ void igt_enable_connectors(void) drmModeFreeConnector(c); } close(drm_fd); - - igt_install_exit_handler(reset_connectors_at_exit); } /**