summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2020-05-25 14:13:23 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2020-09-16 15:16:19 +0100
commite78b1cf6da1b3fed44e7aebb2671ea0f847b209e (patch)
tree3277e8e0ed90430d9896f19dc63768faad5070d8 /tests
parent4426496af89f6c52c4f54650100ec5ee907c8604 (diff)
tests: Provide {un,}bind testing
Perform unbind-bind testing of the VSP devices to validate successful removal of the drivers. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/vsp-unit-test-0026.sh55
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/vsp-unit-test-0026.sh b/tests/vsp-unit-test-0026.sh
new file mode 100755
index 0000000..0e013ce
--- /dev/null
+++ b/tests/vsp-unit-test-0026.sh
@@ -0,0 +1,55 @@
+#!/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 VSPs individually
+ for v in $vsps; do
+ unbind_vsp $v
+ bind_vsp $v
+ done
+
+ # Perform a simple copy test to validate HW is alive
+ test_copy RGB24 128x128
+}
+
+test_init $0 "$features"
+test_run