mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Detlev Casanova <detlev.casanova@collabora.com>
To: linux-kernel@vger.kernel.org
Cc: linux-media@vger.kernel.org, Hans Verkuil <hverkuil@xs4all.nl>,
	Detlev Casanova <detlev.casanova@collabora.com>
Subject: [PATCH] test-media: Add basic tests for visl
Date: Wed, 28 Feb 2024 11:56:08 -0500	[thread overview]
Message-ID: <20240228165608.1000988-1-detlev.casanova@collabora.com> (raw)

This will run the v4l2-compliance tests on the visl device, check
(un)binding and module reloading.

Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
---
 contrib/test/test-media | 80 +++++++++++++++++++++++++++++++++++++++--
 1 file changed, 78 insertions(+), 2 deletions(-)

diff --git a/contrib/test/test-media b/contrib/test/test-media
index afe20760..18a4f886 100755
--- a/contrib/test/test-media
+++ b/contrib/test/test-media
@@ -9,6 +9,7 @@ vivid=0
 vim2m=0
 vimc=0
 vicodec=0
+visl=0
 cec=0
 cecpwr=--skip-test-standby-resume
 kmemleak=0
@@ -56,10 +57,11 @@ if [ -z "$1" ]; then
 	echo "vimc: test the vimc driver"
 	echo "vicodec: test the vicodec driver"
 	echo "vidtv: test the vidtv driver"
+	echo "visl: test the visl driver"
 	echo "cec: adds the vivid CEC compliance tests, except for the CEC standby/wakeup tests."
 	echo "cec-pwr: adds the vivid CEC compliance tests, including the CEC standby/wakeup tests."
-	echo "all: equals 'vivid vim2m vimc vicodec vidtv cec cec-pwr'"
-	echo "mc: equals 'vivid vim2m vimc vicodec vidtv'"
+	echo "all: equals 'vivid vim2m vimc vicodec vidtv visl cec cec-pwr'"
+	echo "mc: equals 'vivid vim2m vimc vicodec vidtv visl'"
 	exit 0
 fi
 
@@ -118,6 +120,7 @@ while [ ! -z "$1" ]; do
 		vim2m=1
 		vimc=1
 		vicodec=1
+		visl=1
 		cec=1
 		cecpwr=
 		;;
@@ -127,6 +130,7 @@ while [ ! -z "$1" ]; do
 		vimc=1
 		vicodec=1
 		vidtv=1
+		visl=1
 		;;
 	vidtv)
 		vidtv=1
@@ -143,6 +147,9 @@ while [ ! -z "$1" ]; do
 	vicodec)
 		vicodec=1
 		;;
+	visl)
+		visl=1
+		;;
 	cec)
 		cec=1
 		cecpwr=--skip-test-standby-resume
@@ -239,6 +246,75 @@ if [ $vivid -eq 1 -a $setup -eq 0 ]; then
 	echo
 fi
 
+if [ $visl -eq 1 -a $setup -eq 0 ]; then
+	dmesg -n notice
+	echo
+	echo loading visl module | tee /dev/kmsg
+	modprobe visl
+	sleep $modprobe_time
+	echo
+	echo visl compliance tests | tee /dev/kmsg
+	echo
+	date
+	stdbuf -oL $v4l2_compliance -m platform:visl -P -s10 -a 2>&1 | tee -a $tmp
+	echo
+	echo unbind visl | tee /dev/kmsg
+	echo
+	echo -n visl.0 >/sys/bus/platform/drivers/visl/unbind
+	sleep $unbind_time
+	echo
+	echo rebind visl | tee /dev/kmsg
+	echo
+	echo -n visl.0 >/sys/bus/platform/drivers/visl/bind
+	sleep 1
+	echo
+	echo second unbind visl | tee /dev/kmsg
+	echo
+	for i in `$v4l2_ctl -z platform:visl --list-devices`; do
+		let "t = 1 + $RANDOM / 4096"
+		echo $i: sleep ${t}s
+		sleep $t <$i &
+	done
+	sleep 1
+	echo
+	echo -n visl.0 >/sys/bus/platform/drivers/visl/unbind
+	sleep $reunbind_time
+	echo
+	echo rmmod visl | tee /dev/kmsg
+	echo
+	rmmod visl
+	sleep $rmmod_time
+
+	if [ $kmemleak -eq 1 ]; then
+		echo
+		echo kmemleak results for visl:
+		echo
+		echo scan >/sys/kernel/debug/kmemleak
+		cat /sys/kernel/debug/kmemleak
+		echo
+		echo end of kmemleak results
+		echo
+	fi
+
+	modprobe visl
+	sleep $modprobe_time
+
+	$v4l2_ctl -z platform:visl --all
+
+	if [ $kmemleak -eq 1 ]; then
+		echo clear >/sys/kernel/debug/kmemleak
+	fi
+	echo
+	echo
+	echo
+	echo
+	echo
+	echo
+	echo
+	echo
+fi
+
+
 if [ $cec -eq 1 ]; then
 	dmesg -n notice
 	cec-ctl --version
-- 
2.43.0


                 reply	other threads:[~2024-02-28 16:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240228165608.1000988-1-detlev.casanova@collabora.com \
    --to=detlev.casanova@collabora.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®