From 6bc72f272520323e333d52b6cd09365238d7983e Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 17 Jun 2016 00:08:12 +0300 Subject: vsp-lib: Store the number of BRU inputs internally Instead of getting the number of BRU inputs from an explicit argument to the compare_frames function, store it internally when configuring the pipeline. This simplifies the test scripts by removing the reftype argument to the compare_frames function. Signed-off-by: Laurent Pinchart --- scripts/vsp-lib.sh | 19 ++++++------------- tests/vsp-unit-test-0001.sh | 2 +- tests/vsp-unit-test-0002.sh | 2 +- tests/vsp-unit-test-0003.sh | 2 +- tests/vsp-unit-test-0005.sh | 2 +- tests/vsp-unit-test-0007.sh | 2 +- tests/vsp-unit-test-0008.sh | 2 +- 7 files changed, 12 insertions(+), 19 deletions(-) diff --git a/scripts/vsp-lib.sh b/scripts/vsp-lib.sh index 62647de..8dc252c 100755 --- a/scripts/vsp-lib.sh +++ b/scripts/vsp-lib.sh @@ -86,21 +86,12 @@ vsp1_set_control() { reference_frame() { local file=$1 - local reftype=$2 - local format=$3 - local size=$4 + local format=$2 + local size=$3 local alpha= local options= - case $reftype in - reference | scaled) - ;; - composed-*) - options="$options -c ${reftype/composed-/}" - ;; - esac - case $format in ARGB555) alpha=255 @@ -121,6 +112,7 @@ reference_frame() { ;; esac + [ x$__vsp_bru_inputs != x ] && options="$options -c $__vsp_bru_inputs" $(format_v4l2_is_yuv $format) && options="$options -y" $genimage -f $format -s $size -a $alpha $options -o $file \ @@ -202,14 +194,13 @@ compare_frame_fuzzy() { compare_frames() { local method=$1 - local reftype=$2 local format=$__vsp_wpf_format local wpf=$__vsp_wpf_index local fmt=$(echo $format | tr '[:upper:]' '[:lower:]') local size=$(vsp1_entity_get_size wpf.$wpf 1) - reference_frame ref-frame.bin $reftype $format $size + reference_frame ref-frame.bin $format $size local result="pass" for frame in frame-*.bin ; do @@ -290,6 +281,7 @@ pipe_rpf_bru() { $mediactl -d $mdev -l "'$dev bru':$bru_output -> '$dev wpf.0':0 [1]" $mediactl -d $mdev -l "'$dev wpf.0':1 -> '$dev wpf.0 output':0 [1]" + __vsp_bru_inputs=$ninputs __vsp_wpf_index=0 } @@ -344,6 +336,7 @@ pipe_rpf_wpf() { pipe_reset() { $mediactl -d $mdev -r + __vsp_bru_inputs= __vsp_wpf_index= __vsp_wpf_format= } diff --git a/tests/vsp-unit-test-0001.sh b/tests/vsp-unit-test-0001.sh index c5b71e1..962adc0 100755 --- a/tests/vsp-unit-test-0001.sh +++ b/tests/vsp-unit-test-0001.sh @@ -20,7 +20,7 @@ test_wpf_packing() { $vsp_runner $mdev input 0 ARGB32 & $vsp_runner $mdev output 0 $format - result=$(compare_frames exact reference) + result=$(compare_frames exact) test_complete $result } diff --git a/tests/vsp-unit-test-0002.sh b/tests/vsp-unit-test-0002.sh index 0b97965..668fa53 100755 --- a/tests/vsp-unit-test-0002.sh +++ b/tests/vsp-unit-test-0002.sh @@ -20,7 +20,7 @@ test_wpf_packing() { $vsp_runner $mdev input 0 YUYV & $vsp_runner $mdev output 0 $format - result=$(compare_frames fuzzy reference) + result=$(compare_frames fuzzy) test_complete $result } diff --git a/tests/vsp-unit-test-0003.sh b/tests/vsp-unit-test-0003.sh index 9b04b60..b986632 100755 --- a/tests/vsp-unit-test-0003.sh +++ b/tests/vsp-unit-test-0003.sh @@ -23,7 +23,7 @@ test_scale() { $vsp_runner $mdev input 0 $format & $vsp_runner $mdev output 0 $format - result=$(compare_frames exact scaled) + result=$(compare_frames exact) test_complete $result } diff --git a/tests/vsp-unit-test-0005.sh b/tests/vsp-unit-test-0005.sh index 168ee55..9ac5585 100755 --- a/tests/vsp-unit-test-0005.sh +++ b/tests/vsp-unit-test-0005.sh @@ -21,7 +21,7 @@ test_rpf() { $vsp_runner $mdev input $rpf $format & $vsp_runner $mdev output 0 $format - result=$(compare_frames exact reference) + result=$(compare_frames exact) test_complete $result } diff --git a/tests/vsp-unit-test-0007.sh b/tests/vsp-unit-test-0007.sh index fa45422..0004ac8 100755 --- a/tests/vsp-unit-test-0007.sh +++ b/tests/vsp-unit-test-0007.sh @@ -23,7 +23,7 @@ test_bru() { done $vsp_runner $mdev output 0 $format - result=$(compare_frames fuzzy composed-$ninputs) + result=$(compare_frames fuzzy) test_complete $result } diff --git a/tests/vsp-unit-test-0008.sh b/tests/vsp-unit-test-0008.sh index 15379d4..566cef5 100755 --- a/tests/vsp-unit-test-0008.sh +++ b/tests/vsp-unit-test-0008.sh @@ -30,7 +30,7 @@ test_scale() { $vsp_runner $mdev input 0 $format & $vsp_runner $mdev output 0 $format - result=$(compare_frames exact scaled) + result=$(compare_frames exact) test_complete $result } -- cgit v1.2.3