From patchwork Tue Dec 4 15:51:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10712141 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 34DB413AF for ; Tue, 4 Dec 2018 15:52:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23C8F2C0F4 for ; Tue, 4 Dec 2018 15:52:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 215BB2C1EA; Tue, 4 Dec 2018 15:52:02 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD2F92C0F4 for ; Tue, 4 Dec 2018 15:52:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726421AbeLDPwA (ORCPT ); Tue, 4 Dec 2018 10:52:00 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:33638 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726725AbeLDPv7 (ORCPT ); Tue, 4 Dec 2018 10:51:59 -0500 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B9F77E58; Tue, 4 Dec 2018 16:51:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1543938713; bh=fyWYvjN3xNiFOSSaIFeQbc4FLn5Lyoqx8TexaB+zPag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dIdU5hrirRdfPenaZXca9Dl/clsArOkNKPS6F3vRKXxtTVtyssIOnpvXkGWRyYmVV b3LFmEuqPYLkRFv1gCmLjN8UCJEFcJgYIzQaiKQwNonF8TR+WZrHAx4xhtQFTdTgzF nBmOljkIPg+VNMDp83ZKcthL6o/h9UUuyZIQqLYA= From: Kieran Bingham To: Laurent Pinchart Cc: Kieran Bingham , linux-renesas-soc@vger.kernel.org, Kieran Bingham Subject: [VSP-Tests PATCH 7/7] vsp-lib: Reset controls to defaults on each test run Date: Tue, 4 Dec 2018 15:51:46 +0000 Message-Id: <20181204155146.9726-8-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181204155146.9726-1-kieran.bingham@ideasonboard.com> References: <20181204155146.9726-1-kieran.bingham@ideasonboard.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some of our tests set flipping and rotation controls, and the VSP cell can be used again by later tests. If these controls are not reset, then that operation is applied to later tests incorrectly causing that test to fail. In an ideal world, tests should clean up after themselves, and leave the system in a known state. However the world is not ideal and we would not be able to guarantee any previous system state before a test was run anyway. Therefore it is more effective to reset state at the beginning of a test. To repair this - reset all control values to their defaults at the start of every test during test_init() Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- scripts/vsp-lib.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/vsp-lib.sh b/scripts/vsp-lib.sh index 3d2792707d24..33442816f208 100755 --- a/scripts/vsp-lib.sh +++ b/scripts/vsp-lib.sh @@ -94,6 +94,14 @@ vsp1_set_control() { $yavta --no-query -w "$control $value" $subdev | ./logger.sh "$entity" >> $logfile } +vsp1_reset_controls() { + local entity=$1 + local subdev=$(vsp1_entity_subdev $entity) + + echo "Resetting controls on $subdev" | ./logger.sh "$entity" >> $logfile + $yavta --no-query --reset-controls $subdev | ./logger.sh "$entity" >> $logfile +} + # ----------------------------------------------------------------------------- # Reference frame generation # @@ -1082,6 +1090,9 @@ test_init() { dev=$(vsp1_device $mdev) echo "Using device $mdev ($dev)" | ./logger.sh config >> $logfile + # Reset any rotation or flipping controls + vsp1_reset_controls wpf.0 + vsp_runner=./vsp-runner.sh }