linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-renesas-soc@vger.kernel.org
Cc: Eugeniu Rosca <roscaeugeniu@gmail.com>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>
Subject: [VSP-Tests PATCH] tests: Provide {un,}bind testing
Date: Mon, 25 May 2020 14:21:48 +0100	[thread overview]
Message-ID: <20200525132148.3454488-1-kieran.bingham@ideasonboard.com> (raw)
In-Reply-To: <d4544b1b-a695-bd70-0ccb-e2fb1838f3f8@ideasonboard.com>

Perform unbind-bind testing of the VSP devices to validate
successful removal of the drivers.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 tests/vsp-unit-test-0026.sh | 63 +++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100755 tests/vsp-unit-test-0026.sh

diff --git a/tests/vsp-unit-test-0026.sh b/tests/vsp-unit-test-0026.sh
new file mode 100755
index 000000000000..86c523a65651
--- /dev/null
+++ b/tests/vsp-unit-test-0026.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+#
+# Test unbinding and binding all VSP1 devices, performing a simple
+# copy test to validate the hardware afterwards.
+#
+
+. ./vsp-lib.sh
+
+features="rpf.0 wpf.0"
+
+vsp1_driver=/sys/bus/platform/drivers/vsp1
+vsps=$(cd /sys/bus/platform/devices/; ls | grep vsp)
+
+unbind_vsp() {
+	echo $1 > $vsp1_driver/unbind
+}
+
+bind_vsp() {
+	echo $1 > $vsp1_driver/bind
+}
+
+# Input is directly copied to the output. No change in format or size.
+test_copy() {
+	local format=$1
+	local insize=$2
+
+	test_start "simple hardware validation after unbind/bind cycles"
+
+	pipe_configure rpf-wpf 0 0
+	format_configure rpf-wpf 0 0 $format $insize $format
+
+	vsp_runner rpf.0 &
+	vsp_runner wpf.0
+
+	local result=$(compare_frames)
+
+	test_complete $result
+}
+
+test_main() {
+	local format
+
+	# Unbind and rebind individually
+	for v in $vsps; do
+		unbind_vsp $v;
+		bind_vsp $v;
+	done
+
+	# Unbind, then rebind all VSPs at once
+	for v in $vsps; do
+		unbind_vsp $v;
+	done
+	for v in $vsps; do
+		bind_vsp $v;
+	done;
+
+	# Perform a simple copy test to validate HW is alive
+	test_copy RGB24 128x128
+}
+
+test_init $0 "$features"
+test_run
-- 
2.25.1


  reply	other threads:[~2020-05-25 13:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-23  8:13 [PATCH] media: vsp1: dl: Fix NULL pointer dereference on unbind Eugeniu Rosca
2020-05-25 13:19 ` Kieran Bingham
2020-05-25 13:21   ` Kieran Bingham [this message]
2020-06-07  2:31     ` [VSP-Tests PATCH] tests: Provide {un,}bind testing Laurent Pinchart
2020-05-25 13:31   ` [PATCH] media: vsp1: dl: Fix NULL pointer dereference on unbind Eugeniu Rosca

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200525132148.3454488-1-kieran.bingham@ideasonboard.com \
    --to=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=roscaeugeniu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).