summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2016-05-27 17:08:34 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2016-06-20 22:03:04 +0300
commit14388783098d8fefcbec403c6c0780f967ad919e (patch)
treedbd791a9ba7b52848d5fd777711fa4e2360b25f0
parent25342673c441b00baf661e89cc3e4dd1a2cf7213 (diff)
tests: Add CLU and LUT test
Test CLU and LUT operation in both RGB and YUV modes with different look up tables. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--README5
-rwxr-xr-xtests/vsp-unit-test-0010.sh55
2 files changed, 58 insertions, 2 deletions
diff --git a/README b/README
index 972a296..7bc1d48 100644
--- a/README
+++ b/README
@@ -44,8 +44,9 @@ system in a directory included in $PATH.
* raw2rgbpnm (available at git://git.retiisi.org.uk/~sailus/raw2rgbpnm.git)
* yavta (available at git://git.ideasonboard.org/yavta.git)
-All but the HGO test can be run with the latest version of these tools. To
-test the HGO, the 'metadata' branch of 'yavta' is currently needed.
+All but the HGO and CLU/LUT tests can be run with the latest version of these
+tools. To test the HGO and CLU/LUT, the 'vsp' branch of 'yavta' is currently
+needed.
-----------------
diff --git a/tests/vsp-unit-test-0010.sh b/tests/vsp-unit-test-0010.sh
new file mode 100755
index 0000000..fc6ded6
--- /dev/null
+++ b/tests/vsp-unit-test-0010.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+#
+# Test CLU and LUT in RGB and YUV modes. Use a RPF -> CLU -> WPF and
+# RPF -> LUT -> WPF pipelines with identical input and output formats.
+#
+
+source vsp-lib.sh
+
+features="rpf.0 clu lut wpf.0"
+formats="RGB24 YUV444M"
+
+lut_types="clu lut"
+
+# Keep the "zero" configuration first to catch lack of hardware table setup
+# due to V4L2 control caching, as the initial value of the LUT and CLU table
+# controls is all 0.
+clu_configs="zero identity wave"
+lut_configs="zero identity gamma"
+
+test_lut() {
+ lut_type=$1
+ format=$2
+ config=$3
+
+ test_start "$(echo $lut_type | tr [:lower:] [:upper:]) in $format with $config configuration"
+
+ config_file=frames/${lut_type}-${config}.bin
+
+ pipe_configure rpf-${lut_type}
+ format_configure rpf-${lut_type} $format 1024x768
+
+ vsp1_set_control $lut_type "Look-Up+Table" "<$config_file"
+
+ vsp_runner rpf.0 &
+ vsp_runner wpf.0
+
+ result=$(compare_frames $lut_type=$config_file)
+
+ test_complete $result
+}
+
+test_main() {
+ for lut in $lut_types ; do
+ configs=$(eval echo \$${lut}_configs)
+ for format in $formats ; do
+ for config in $configs ; do
+ test_lut $lut $format $config
+ done
+ done
+ done
+}
+
+test_init $0 "$features"
+test_run