Skip to contentSkip to conversation

Reset controls and unloved patches

PATCH In review Kieran Bingham 2 participants 24 messages Dec 4, 2018 – Feb 19, 2019

lore
Share & tools
lore
#0 lore raw

cover Reset controls and unloved patches

Update the VSP-Test suite library to use yavta's (new) --reset-controls feature to ensure each test starts with a clean environment.

This prevents tests being affected by previous settings to controls such as rotate or flip.

Also, the series reposts other unloved patches which have gone either un-reviewed or are still not yet integrated.

Kieran Bingham (7):
tests: add pseudo platform test
tests: Provide copy test to validate 1xN streams
vsp-lib: Provide command line argument parsing
vsp-lib: trivial: Fix spelling of Reference
vsp-lib: Allow forcing pixel perfect comparisons
vsp-lib: Support late queuing of buffers in yavta
vsp-lib: Reset controls to defaults on each test run

 scripts/vsp-lib.sh          | 62 +++++++++++++++++++++++++++++++++++--
 tests/vsp-unit-test-0000.sh | 20 ++++++++++++
 tests/vsp-unit-test-0025.sh | 45 +++++++++++++++++++++++++++
 3 files changed, 125 insertions(+), 2 deletions(-)
 create mode 100755 tests/vsp-unit-test-0000.sh
 create mode 100755 tests/vsp-unit-test-0025.sh
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/7 tests: add pseudo platform test

Provide an initial test which can run as part of the test suite. This test will report the platform and kernel version, along with the identified paths of required utilities.

This will aid in ensuring that required tools are available on a running platform - and report the kernel and platform details in any test suite output for clarification of results.

---
 tests/vsp-unit-test-0000.sh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100755 tests/vsp-unit-test-0000.sh
tests/vsp-unit-test-0000.sh new file +20 -0
new file mode 100755
index 000000000000..144cfc677b32
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Report testing conditions
+
+model=`cat /sys/firmware/devicetree/base/model`
+
+echo "Test Conditions:"
+
+function check_all() {
+	echo "  Platform: " "$model"
+	echo "  Kernel release: " `uname -r`
+	echo "  convert: " `which convert`
+	echo "  compare: " `which compare`
+	echo "  killall: " `which killall`
+	echo "  raw2rgbpnm: " `which raw2rgbpnm`
+	echo "  stress: " `which stress`
+	echo "  yavta: " `which yavta`
+}
+
+check_all | column -ts ":"
Signature · 1 line
2.17.1
Reviewed-by on v1 1/7
#2 lore raw

Re: [VSP-Tests PATCH 1/7] tests: add pseudo platform test

Hi Kieran,

Thank you for the patch.

Quoted 20 lines · Kieran Bingham

Provide an initial test which can run as part of the test suite. This test will report the platform and kernel version, along with the identified paths of required utilities.

This will aid in ensuring that required tools are available on a running platform - and report the kernel and platform details in any test suite output for clarification of results.

---
 tests/vsp-unit-test-0000.sh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100755 tests/vsp-unit-test-0000.sh
tests/vsp-unit-test-0000.sh new file +0 -0
new file mode 100755
index 000000000000..144cfc677b32

tests/vsp-unit-test-0000.sh line 5

Quoted 5 lines
tests/vsp-unit-test-0000.sh new file +5 -0
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Report testing conditions
+
+model=`cat /sys/firmware/devicetree/base/model`

Please use $(...) instead of ..., it's more readable.

Quoted 5 lines
tests/vsp-unit-test-0000.sh new file +5 -0
+
+echo "Test Conditions:"
+
+function check_all() {
+	echo "  Platform: " "$model"

tests/vsp-unit-test-0000.sh line 20

Quoted 10 lines
tests/vsp-unit-test-0000.sh new file +10 -0
+	echo "  Kernel release: " `uname -r`
+	echo "  convert: " `which convert`
+	echo "  compare: " `which compare`
+	echo "  killall: " `which killall`
+	echo "  raw2rgbpnm: " `which raw2rgbpnm`
+	echo "  stress: " `which stress`
+	echo "  yavta: " `which yavta`
+}
+
+check_all | column -ts ":"

Could we remove the dependency on the column tool ? I don't have it in my buildroot environment :-) I could of course add it, but in this case I think it's easy enough to align the columns manually.

With these fixed,

Signature · 3 lines
Regards,

Laurent Pinchart
#3 lore raw

Re: [VSP-Tests PATCH 1/7] tests: add pseudo platform test

Hi Laurent,

Quoted 19 lines · Laurent Pinchart

Hi Kieran,

Thank you for the patch.

Quoted 14 lines · Kieran Bingham

Provide an initial test which can run as part of the test suite. This test will report the platform and kernel version, along with the identified paths of required utilities.

This will aid in ensuring that required tools are available on a running platform - and report the kernel and platform details in any test suite output for clarification of results.

---
 tests/vsp-unit-test-0000.sh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100755 tests/vsp-unit-test-0000.sh
Quoted 13 lines

tests/vsp-unit-test-0000.sh line 5

Quoted 11 lines
tests/vsp-unit-test-0000.sh new file +5 -0
new file mode 100755
index 000000000000..144cfc677b32
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Report testing conditions
+
+model=`cat /sys/firmware/devicetree/base/model`

Please use $(...) instead of ..., it's more readable.

Sure.

Quoted 12 lines
Quoted 12 lines
tests/vsp-unit-test-0000.sh new file +11 -0
+
+echo "Test Conditions:"
+
+function check_all() {
+	echo "  Platform: " "$model"
+	echo "  Kernel release: " `uname -r`
+	echo "  convert: " `which convert`
+	echo "  compare: " `which compare`
+	echo "  killall: " `which killall`
+	echo "  raw2rgbpnm: " `which raw2rgbpnm`
+	echo "  stress: " `which stress`
Quoted 8 lines

tests/vsp-unit-test-0000.sh line 20

Quoted 4 lines
tests/vsp-unit-test-0000.sh new file +4 -0
+	echo "  yavta: " `which yavta`
+}
+
+check_all | column -ts ":"

Could we remove the dependency on the column tool ? I don't have it in my buildroot environment :-) I could of course add it, but in this case I think it's easy enough to align the columns manually.

Ahh yes - good point. A few spaces aught to do it :)

and s/.*/$(.*)/ here too :)

Quoted 5 lines

With these fixed,

Signature · 3 lines
Regards
--
Kieran
#4 lore raw

PATCH 2/7 tests: Provide copy test to validate 1xN streams

In reply to Kieran Bingham

Validate that a 1xN stream can be read through the RPF and written through the WPF.

The test framework does not currently support processing images where the stride does not match the output width - so the testing is currently limited to testing only the vertical direction in this aspect.

---
 tests/vsp-unit-test-0025.sh | 45 +++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100755 tests/vsp-unit-test-0025.sh
tests/vsp-unit-test-0025.sh new file +45 -0
new file mode 100755
index 000000000000..57a1fac6e369
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+#
+# Test pipelines which have a single pixel dimension. Use a RPF -> WPF
+# pipeline with identical input and output formats to generate our output.
+#
+
+. ./vsp-lib.sh
+
+features="rpf.0 uds wpf.0"
+formats="RGB24 ARGB32"
+
+# Input is directly copied to the output. No change in format or size.
+test_copy() {
+	local format=$1
+	local insize=$2
+
+	test_start "copying $insize in $format"
+
+	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
+
+	for format in $formats ; do
+		test_copy $format 1024x768
+		test_copy $format 128x128
+		test_copy $format 128x1
+
+		# Skipped : Test framework does not yet support strides != width
+		#test_copy $format 1x128
+	done
+}
+
+test_init $0 "$features"
+test_run
Signature · 1 line
2.17.1
#5 lore raw

Re: [VSP-Tests PATCH 2/7] tests: Provide copy test to validate 1xN streams

Hi Kieran,

Thank you for the patch.

Quoted 46 lines · Kieran Bingham

Validate that a 1xN stream can be read through the RPF and written through the WPF.

The test framework does not currently support processing images where the stride does not match the output width - so the testing is currently limited to testing only the vertical direction in this aspect.

---
 tests/vsp-unit-test-0025.sh | 45 +++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100755 tests/vsp-unit-test-0025.sh
tests/vsp-unit-test-0025.sh new file +27 -0
new file mode 100755
index 000000000000..57a1fac6e369
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+#
+# Test pipelines which have a single pixel dimension. Use a RPF -> WPF
+# pipeline with identical input and output formats to generate our output.
+#
+
+. ./vsp-lib.sh
+
+features="rpf.0 uds wpf.0"
+formats="RGB24 ARGB32"
+
+# Input is directly copied to the output. No change in format or size.
+test_copy() {
+	local format=$1
+	local insize=$2
+
+	test_start "copying $insize in $format"
+
+	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)
+

tests/vsp-unit-test-0025.sh line 37

Quoted 10 lines
tests/vsp-unit-test-0025.sh new file +10 -0
+	test_complete $result
+}
+
+test_main() {
+	local format
+
+	for format in $formats ; do
+		test_copy $format 1024x768
+		test_copy $format 128x128
+		test_copy $format 128x1

If the purpose is to test Nx1 and 1xN, do we need the first two resolutions ? Shouldn't the test_start message describe the exact purpose ?

Quoted 8 lines
tests/vsp-unit-test-0025.sh new file +8 -0
+
+		# Skipped : Test framework does not yet support strides != width
+		#test_copy $format 1x128
+	done
+}
+
+test_init $0 "$features"
+test_run
Signature · 3 lines
Regards,

Laurent Pinchart
#6 lore raw

Re: [VSP-Tests PATCH 2/7] tests: Provide copy test to validate 1xN streams

Hi Laurent,

Quoted 57 lines · Laurent Pinchart

Hi Kieran,

Thank you for the patch.

Quoted 52 lines · Kieran Bingham

Validate that a 1xN stream can be read through the RPF and written through the WPF.

The test framework does not currently support processing images where the stride does not match the output width - so the testing is currently limited to testing only the vertical direction in this aspect.

---
 tests/vsp-unit-test-0025.sh | 45 +++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100755 tests/vsp-unit-test-0025.sh
tests/vsp-unit-test-0025.sh new file +33 -0
new file mode 100755
index 000000000000..57a1fac6e369
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+#
+# Test pipelines which have a single pixel dimension. Use a RPF -> WPF
+# pipeline with identical input and output formats to generate our output.
+#
+
+. ./vsp-lib.sh
+
+features="rpf.0 uds wpf.0"
+formats="RGB24 ARGB32"
+
+# Input is directly copied to the output. No change in format or size.
+test_copy() {
+	local format=$1
+	local insize=$2
+
+	test_start "copying $insize in $format"
+
+	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
+
Quoted 8 lines

tests/vsp-unit-test-0025.sh line 37

Quoted 4 lines
tests/vsp-unit-test-0025.sh new file +4 -0
+	for format in $formats ; do
+		test_copy $format 1024x768
+		test_copy $format 128x128
+		test_copy $format 128x1

If the purpose is to test Nx1 and 1xN, do we need the first two resolutions ? Shouldn't the test_start message describe the exact purpose ?

Hrm ... It's been too long. I don't recall if the first two were a copy/paste left-over or if they had more meaning.

They don't look like they have much meaning now though - so they can be removed. I'm all for speeding up the full test-suite :-)

Quoted 10 lines
Quoted 9 lines
tests/vsp-unit-test-0025.sh new file +8 -0
+
+		# Skipped : Test framework does not yet support strides != width
+		#test_copy $format 1x128
+	done
+}
+
+test_init $0 "$features"
+test_run
Signature · 3 lines
Regards
--
Kieran
#7 lore raw

PATCH 3/7 vsp-lib: Provide command line argument parsing

In reply to Kieran Bingham

Extend the vsp-lib to support command line parsing for all tests. The arguments parsed here should be common to all tests, and initially provide shell level verbose debug output, and the option to easily keep frames output by the VSP1.

---
 scripts/vsp-lib.sh | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
scripts/vsp-lib.sh +34 -0
index 0f3992a7827e..56969606382f 100755
@@ -1094,3 +1094,37 @@ test_complete() {
 test_run() {
 	test_main | ./logger.sh error >> $logfile
 }
+
+# ------------------------------------------------------------------------------
+# Common argument parsing
+#
+# non-recognised arguments are restored, to allow tests to implement their own
+# parsing if necessary.
+
+POSITIONAL=()
+while [[ $# -gt 0 ]]
+do
+case $1 in
+	-x|--debug)
+		set -x;
+		shift
+		;;
+	-k|--keep-frames)
+		export VSP_KEEP_FRAMES=1
+		shift
+		;;
+	-h|--help)
+		echo "$(basename $0): VSP Test library"
+		echo "  -x|--debug          enable shell debug"
+		echo "  -k|--keep-frames    keep generated and captured frames"
+		echo "  -h|--help           this help"
+		exit
+		shift
+		;;
+	*)    # unknown option
+		POSITIONAL+=("$1") # save it in an array for later
+		shift # past argument
+		;;
+esac
+done
+set -- "${POSITIONAL[@]}" # restore positional parameters
Signature · 1 line
2.17.1
#8 lore raw

Re: [VSP-Tests PATCH 3/7] vsp-lib: Provide command line argument parsing

Hi Kieran,

Thank you for the patch.

Quoted 16 lines · Kieran Bingham

Extend the vsp-lib to support command line parsing for all tests. The arguments parsed here should be common to all tests, and initially provide shell level verbose debug output, and the option to easily keep frames output by the VSP1.

---
 scripts/vsp-lib.sh | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
scripts/vsp-lib.sh +0 -0
index 0f3992a7827e..56969606382f 100755
@@ -1094,3 +1094,37 @@ test_complete() {
 test_run() {

scripts/vsp-lib.sh test_complete() { · line 1104

Quoted 10 lines
scripts/vsp-lib.sh +8 -0
 	test_main | ./logger.sh error >> $logfile
 }
+
+# ------------------------------------------------------------------------------
+# Common argument parsing
+#
+# non-recognised arguments are restored, to allow tests to implement their own
+# parsing if necessary.
+
+POSITIONAL=()

This work in bash only :-( Any chance to implement a solution that would work in ash too ?

Quoted 26 lines
scripts/vsp-lib.sh +26 -0
+while [[ $# -gt 0 ]]
+do
+case $1 in
+	-x|--debug)
+		set -x;
+		shift
+		;;
+	-k|--keep-frames)
+		export VSP_KEEP_FRAMES=1
+		shift
+		;;
+	-h|--help)
+		echo "$(basename $0): VSP Test library"
+		echo "  -x|--debug          enable shell debug"
+		echo "  -k|--keep-frames    keep generated and captured frames"
+		echo "  -h|--help           this help"
+		exit
+		shift
+		;;
+	*)    # unknown option
+		POSITIONAL+=("$1") # save it in an array for later
+		shift # past argument
+		;;
+esac
+done
+set -- "${POSITIONAL[@]}" # restore positional parameters
Signature · 3 lines
Regards,

Laurent Pinchart
#9 lore raw

Re: [VSP-Tests PATCH 3/7] vsp-lib: Provide command line argument parsing

Hi Laurent,

Quoted 26 lines · Laurent Pinchart

Hi Kieran,

Thank you for the patch.

Quoted 21 lines · Kieran Bingham

Extend the vsp-lib to support command line parsing for all tests. The arguments parsed here should be common to all tests, and initially provide shell level verbose debug output, and the option to easily keep frames output by the VSP1.

---
 scripts/vsp-lib.sh | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
scripts/vsp-lib.sh +3 -0
index 0f3992a7827e..56969606382f 100755
@@ -1094,3 +1094,37 @@ test_complete() {
 test_run() {
 	test_main | ./logger.sh error >> $logfile
 }
+
+# ------------------------------------------------------------------------------
+# Common argument parsing
Quoted 9 lines

scripts/vsp-lib.sh test_complete() { · line 1104

Quoted 5 lines
scripts/vsp-lib.sh +5 -0
+#
+# non-recognised arguments are restored, to allow tests to implement their own
+# parsing if necessary.
+
+POSITIONAL=()

This work in bash only :-( Any chance to implement a solution that would work in ash too ?

Hrm ... I'll have to look into that. Or drop the 'feature'. This was nice because it let me parse arguments I could handle here, and just pass everything else through.

Quoted 27 lines
Quoted 26 lines
scripts/vsp-lib.sh +26 -0
+while [[ $# -gt 0 ]]
+do
+case $1 in
+	-x|--debug)
+		set -x;
+		shift
+		;;
+	-k|--keep-frames)
+		export VSP_KEEP_FRAMES=1
+		shift
+		;;
+	-h|--help)
+		echo "$(basename $0): VSP Test library"
+		echo "  -x|--debug          enable shell debug"
+		echo "  -k|--keep-frames    keep generated and captured frames"
+		echo "  -h|--help           this help"
+		exit
+		shift
+		;;
+	*)    # unknown option
+		POSITIONAL+=("$1") # save it in an array for later
+		shift # past argument
+		;;
+esac
+done
+set -- "${POSITIONAL[@]}" # restore positional parameters
Signature · 3 lines
Regards
--
Kieran
#10 lore raw

PATCH 4/7 vsp-lib: trivial: Fix spelling of Reference

In reply to Kieran Bingham
---
 scripts/vsp-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/vsp-lib.sh +1 -1
index 56969606382f..cf15a045ea8c 100755
@@ -95,7 +95,7 @@ vsp1_set_control() {
 }
 
 # -----------------------------------------------------------------------------
-# Referance frame generation
+# Reference frame generation
 #
 
 reference_frame() {
Signature · 1 line
2.17.1
Reviewed-by on v1 4/7
#11 lore raw

Re: [VSP-Tests PATCH 4/7] vsp-lib: trivial: Fix spelling of Reference

Hi Kieran,

Thank you for the patch.

Quoted 1 line · Kieran Bingham
Quoted 17 lines
---
 scripts/vsp-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/vsp-lib.sh +1 -1
index 56969606382f..cf15a045ea8c 100755
@@ -95,7 +95,7 @@ vsp1_set_control() {
 }
 
 # -----------------------------------------------------------------------------
-# Referance frame generation
+# Reference frame generation
 #
 
 reference_frame() {
Signature · 3 lines
Regards,

Laurent Pinchart
#12 lore raw

Re: [VSP-Tests PATCH 4/7] vsp-lib: trivial: Fix spelling of Reference

Hi Laurent,

Quoted 9 lines · Laurent Pinchart

Hi Kieran,

Thank you for the patch.

Quoted 1 line · Kieran Bingham

Thanks, This has no dependency on the rest of the series. Feel free to apply early if you wish.

--
Kieran

Quoted 18 lines
Quoted 17 lines
---
 scripts/vsp-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/vsp-lib.sh +1 -1
index 56969606382f..cf15a045ea8c 100755
@@ -95,7 +95,7 @@ vsp1_set_control() {
 }
 
 # -----------------------------------------------------------------------------
-# Referance frame generation
+# Reference frame generation
 #
 
 reference_frame() {
Signature · 3 lines
Regards
--
Kieran
#13 lore raw

PATCH 5/7 vsp-lib: Allow forcing pixel perfect comparisons

In reply to Kieran Bingham

Provide a means for the tester to request pixel perfect matches on tests. This can be either through setting the environment variable VSP_PIXEL_PERFECT, or by passing either '-p' or '--pixel-perfect' on the test command line.

---
 scripts/vsp-lib.sh | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
scripts/vsp-lib.sh +10 -1
index cf15a045ea8c..9140254c7459 100755
@@ -287,7 +287,11 @@ compare_frames() {
 	params=${params//)/_}
 	params=$pipe-$in_fmt-$out_fmt-$size$params
 
-	if [ x$__vsp_pixel_perfect != xtrue ] ; then
+	# The system can hint when pixel-perfection is not supported,
+	# however the user can override to force this requirement with
+	# VSP_PIXEL_PERFECT=1 in the environment or by passing -p, or
+	# --pixel-perfect on the commandline.
+	if [ x$__vsp_pixel_perfect != xtrue -a x$VSP_PIXEL_PERFECT != x1 ] ; then
 		method=fuzzy
 	fi
 
@@ -1113,10 +1117,15 @@ case $1 in
 		export VSP_KEEP_FRAMES=1
 		shift
 		;;
+	-p|--pixel-perfect)
+		export VSP_PIXEL_PERFECT=1
+		shift
+		;;
 	-h|--help)
 		echo "$(basename $0): VSP Test library"
 		echo "  -x|--debug          enable shell debug"
 		echo "  -k|--keep-frames    keep generated and captured frames"
+		echo "  -p|--pixel-perfect  frames must match with pixel perfection"
 		echo "  -h|--help           this help"
 		exit
 		shift
Signature · 1 line
2.17.1
#14 lore raw

Re: [VSP-Tests PATCH 5/7] vsp-lib: Allow forcing pixel perfect comparisons

Hi Kieran,

Thank you for the patch.

Quoted 3 lines · Kieran Bingham

Provide a means for the tester to request pixel perfect matches on tests. This can be either through setting the environment variable VSP_PIXEL_PERFECT, or by passing either '-p' or '--pixel-perfect' on the test command line.

What's the use case for this ?

Quoted 38 lines
---
 scripts/vsp-lib.sh | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
scripts/vsp-lib.sh +10 -1
index cf15a045ea8c..9140254c7459 100755
@@ -287,7 +287,11 @@ compare_frames() {
 	params=${params//)/_}
 	params=$pipe-$in_fmt-$out_fmt-$size$params
 
-	if [ x$__vsp_pixel_perfect != xtrue ] ; then
+	# The system can hint when pixel-perfection is not supported,
+	# however the user can override to force this requirement with
+	# VSP_PIXEL_PERFECT=1 in the environment or by passing -p, or
+	# --pixel-perfect on the commandline.
+	if [ x$__vsp_pixel_perfect != xtrue -a x$VSP_PIXEL_PERFECT != x1 ] ; then
 		method=fuzzy
 	fi
 
@@ -1113,10 +1117,15 @@ case $1 in
 		export VSP_KEEP_FRAMES=1
 		shift
 		;;
+	-p|--pixel-perfect)
+		export VSP_PIXEL_PERFECT=1
+		shift
+		;;
 	-h|--help)
 		echo "$(basename $0): VSP Test library"
 		echo "  -x|--debug          enable shell debug"
 		echo "  -k|--keep-frames    keep generated and captured frames"
+		echo "  -p|--pixel-perfect  frames must match with pixel perfection"
 		echo "  -h|--help           this help"
 		exit
 		shift
Signature · 3 lines
Regards,

Laurent Pinchart
#15 lore raw

Re: [VSP-Tests PATCH 5/7] vsp-lib: Allow forcing pixel perfect comparisons

Hi Laurent,

Quoted 10 lines · Laurent Pinchart

Hi Kieran,

Thank you for the patch.

Quoted 3 lines · Kieran Bingham

Provide a means for the tester to request pixel perfect matches on tests. This can be either through setting the environment variable VSP_PIXEL_PERFECT, or by passing either '-p' or '--pixel-perfect' on the test command line.

What's the use case for this ?

Some of the tests (i.e. scaling) provide 'fuzzy comparisons' to allow "a close match" to pass.

It can be desirable to 'turn that off' so that you can generate a set of frames (using the '-k' option) to diff the expected against the actual frames.

This helps while improving the system without making changes to the specific tests.

It could be called 'disable fuzzy matching' if you like?

Quoted 40 lines
Quoted 39 lines
---
 scripts/vsp-lib.sh | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
scripts/vsp-lib.sh +10 -1
index cf15a045ea8c..9140254c7459 100755
@@ -287,7 +287,11 @@ compare_frames() {
 	params=${params//)/_}
 	params=$pipe-$in_fmt-$out_fmt-$size$params
 
-	if [ x$__vsp_pixel_perfect != xtrue ] ; then
+	# The system can hint when pixel-perfection is not supported,
+	# however the user can override to force this requirement with
+	# VSP_PIXEL_PERFECT=1 in the environment or by passing -p, or
+	# --pixel-perfect on the commandline.
+	if [ x$__vsp_pixel_perfect != xtrue -a x$VSP_PIXEL_PERFECT != x1 ] ; then
 		method=fuzzy
 	fi
 
@@ -1113,10 +1117,15 @@ case $1 in
 		export VSP_KEEP_FRAMES=1
 		shift
 		;;
+	-p|--pixel-perfect)
+		export VSP_PIXEL_PERFECT=1
+		shift
+		;;
 	-h|--help)
 		echo "$(basename $0): VSP Test library"
 		echo "  -x|--debug          enable shell debug"
 		echo "  -k|--keep-frames    keep generated and captured frames"
+		echo "  -p|--pixel-perfect  frames must match with pixel perfection"
 		echo "  -h|--help           this help"
 		exit
 		shift
Signature · 3 lines
Regards
--
Kieran
#16 lore raw

Re: [VSP-Tests PATCH 5/7] vsp-lib: Allow forcing pixel perfect comparisons

Hi Kieran,

Quoted 6 lines · Kieran Bingham
Quoted 5 lines · Laurent Pinchart
Quoted 3 lines · Kieran Bingham

Provide a means for the tester to request pixel perfect matches on tests. This can be either through setting the environment variable VSP_PIXEL_PERFECT, or by passing either '-p' or '--pixel-perfect' on the test command line.

Quoted 8 lines
Quoted 1 line

What's the use case for this ?

Some of the tests (i.e. scaling) provide 'fuzzy comparisons' to allow "a close match" to pass.

It can be desirable to 'turn that off' so that you can generate a set of frames (using the '-k' option) to diff the expected against the actual frames.

Ideally we should improve the reference frame generation tool to generate pixel-perfect frames :-) In the meantime I agree this could be useful, but I think we should then integrate this better by marking a test run as reference, saving frames to a good location, and then reusing them for the subsequent runs. It's a bit too manual in its proposed form for an automated test suite :-)

Quoted 43 lines

This helps while improving the system without making changes to the specific tests.

It could be called 'disable fuzzy matching' if you like?

Quoted 38 lines
Quoted 38 lines
---
 scripts/vsp-lib.sh | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
scripts/vsp-lib.sh +10 -1
index cf15a045ea8c..9140254c7459 100755
@@ -287,7 +287,11 @@ compare_frames() {
 	params=${params//)/_}
 	params=$pipe-$in_fmt-$out_fmt-$size$params
 
-	if [ x$__vsp_pixel_perfect != xtrue ] ; then
+	# The system can hint when pixel-perfection is not supported,
+	# however the user can override to force this requirement with
+	# VSP_PIXEL_PERFECT=1 in the environment or by passing -p, or
+	# --pixel-perfect on the commandline.
+	if [ x$__vsp_pixel_perfect != xtrue -a x$VSP_PIXEL_PERFECT != x1 ] ; then
 		method=fuzzy
 	fi
 
@@ -1113,10 +1117,15 @@ case $1 in
 		export VSP_KEEP_FRAMES=1
 		shift
 		;;
+	-p|--pixel-perfect)
+		export VSP_PIXEL_PERFECT=1
+		shift
+		;;
 	-h|--help)
 		echo "$(basename $0): VSP Test library"
 		echo "  -x|--debug          enable shell debug"
 		echo "  -k|--keep-frames    keep generated and captured frames"
+		echo "  -p|--pixel-perfect  frames must match with pixel perfection"
 		echo "  -h|--help           this help"
 		exit
 		shift
Signature · 3 lines
Regards,

Laurent Pinchart
#17 lore raw

PATCH 6/7 vsp-lib: Support late queuing of buffers in yavta

In reply to Kieran Bingham

Provide the pass-through option of --queue-late to vsp-runner, to request that yavta will queue frames after the stream has started.

---
 scripts/vsp-lib.sh | 4 ++++
 1 file changed, 4 insertions(+)
scripts/vsp-lib.sh +4 -0
index 9140254c7459..3d2792707d24 100755
@@ -898,6 +898,7 @@ vsp_runner() {
 	local count=10
 	local pause=
 	local skip=7
+	local queue_late=
 
 	for option in $* ; do
 		case $option in
@@ -916,6 +917,8 @@ vsp_runner() {
 		--skip=*)
 			skip=${option/--skip=/}
 			;;
+		--queue-late)
+			queue_late=queue-late
 
 		*)
 			return 1
@@ -959,6 +962,7 @@ vsp_runner() {
 
 	$yavta -c$count -n $buffers ${format:+-f $format} ${size:+-s $size} \
 		${skip:+--skip $skip} ${file:+--file=$file} ${pause:+-p$pause} \
+		${queue_late:+--$queue_late} \
 		$videodev | ./logger.sh $entity >> $logfile
 }
 
Signature · 1 line
2.17.1
#18 lore raw

Re: [VSP-Tests PATCH 6/7] vsp-lib: Support late queuing of buffers in yavta

Hi Kieran,

Thank you for the patch.

Quoted 2 lines · Kieran Bingham

Provide the pass-through option of --queue-late to vsp-runner, to request that yavta will queue frames after the stream has started.

As with 5/7, what is the use case for this ?

Quoted 34 lines
---
 scripts/vsp-lib.sh | 4 ++++
 1 file changed, 4 insertions(+)
scripts/vsp-lib.sh +4 -0
index 9140254c7459..3d2792707d24 100755
@@ -898,6 +898,7 @@ vsp_runner() {
 	local count=10
 	local pause=
 	local skip=7
+	local queue_late=
 
 	for option in $* ; do
 		case $option in
@@ -916,6 +917,8 @@ vsp_runner() {
 		--skip=*)
 			skip=${option/--skip=/}
 			;;
+		--queue-late)
+			queue_late=queue-late
 
 		*)
 			return 1
@@ -959,6 +962,7 @@ vsp_runner() {
 
 	$yavta -c$count -n $buffers ${format:+-f $format} ${size:+-s $size} \
 		${skip:+--skip $skip} ${file:+--file=$file} ${pause:+-p$pause} \
+		${queue_late:+--$queue_late} \
 		$videodev | ./logger.sh $entity >> $logfile
 }
 
Signature · 3 lines
Regards,

Laurent Pinchart
#19 lore raw

Re: [VSP-Tests PATCH 6/7] vsp-lib: Support late queuing of buffers in yavta

Hi Laurent,

Quoted 9 lines · Laurent Pinchart

Hi Kieran,

Thank you for the patch.

Quoted 2 lines · Kieran Bingham

Provide the pass-through option of --queue-late to vsp-runner, to request that yavta will queue frames after the stream has started.

As with 5/7, what is the use case for this ?

I'm sure it had a very good use case at the time. Please ask 2 months ago Kieran ... Current Kieran has no idea :)

And then let me borrow your time machine - I have some good uses for it :D

I remember asking you about this option in fact, but I can't remember what I was testing specifically, or why I have added this here.

Maybe I was using it to investigate something ... It might perhaps be useful to add a test which uses this to make sure the VSP1 is happy with late queued frames?

Quoted 15 lines
Quoted 15 lines
---
 scripts/vsp-lib.sh | 4 ++++
 1 file changed, 4 insertions(+)
scripts/vsp-lib.sh +1 -0
index 9140254c7459..3d2792707d24 100755
@@ -898,6 +898,7 @@ vsp_runner() {
 	local count=10
 	local pause=
 	local skip=7
+	local queue_late=
 
Quoted 8 lines

scripts/vsp-lib.sh vsp_runner() { · line 921

Quoted 8 lines
scripts/vsp-lib.sh +2 -0
 	for option in $* ; do
 		case $option in
@@ -916,6 +917,8 @@ vsp_runner() {
 		--skip=*)
 			skip=${option/--skip=/}
 			;;
+		--queue-late)
+			queue_late=queue-late

erm ... missing ";;"?

Quoted 12 lines
Quoted 11 lines
scripts/vsp-lib.sh +1 -0
 		*)
 			return 1
@@ -959,6 +962,7 @@ vsp_runner() {
 
 	$yavta -c$count -n $buffers ${format:+-f $format} ${size:+-s $size} \
 		${skip:+--skip $skip} ${file:+--file=$file} ${pause:+-p$pause} \
+		${queue_late:+--$queue_late} \
 		$videodev | ./logger.sh $entity >> $logfile
 }
 
Signature · 3 lines
Regards
--
Kieran
#20 lore raw

Re: [VSP-Tests PATCH 6/7] vsp-lib: Support late queuing of buffers in yavta

Hi Kieran,

Quoted 10 lines · Kieran Bingham
Quoted 5 lines · Laurent Pinchart
Quoted 2 lines · Kieran Bingham

Provide the pass-through option of --queue-late to vsp-runner, to request that yavta will queue frames after the stream has started.

As with 5/7, what is the use case for this ?

I'm sure it had a very good use case at the time. Please ask 2 months ago Kieran ... Current Kieran has no idea :)

Quoted 8 lines

And then let me borrow your time machine - I have some good uses for it :D

I remember asking you about this option in fact, but I can't remember what I was testing specifically, or why I have added this here.

Maybe I was using it to investigate something ... It might perhaps be useful to add a test which uses this to make sure the VSP1 is happy with late queued frames?

At least part of this is handled internally in videobuf2 without being exposed to the VSP1 driver. If the exposed part is considered to be possibly problematic then I would indeed prefer to add a specific test to cover this.

Quoted 37 lines
Quoted 15 lines
Quoted 15 lines
---
 scripts/vsp-lib.sh | 4 ++++
 1 file changed, 4 insertions(+)
scripts/vsp-lib.sh +1 -0
index 9140254c7459..3d2792707d24 100755
@@ -898,6 +898,7 @@ vsp_runner() {
 	local count=10
 	local pause=
 	local skip=7
+	local queue_late=
 
Quoted 8 lines

scripts/vsp-lib.sh vsp_runner() { · line 921

Quoted 8 lines
scripts/vsp-lib.sh +2 -0
 	for option in $* ; do
 		case $option in
@@ -916,6 +917,8 @@ vsp_runner() {
 		--skip=*)
 			skip=${option/--skip=/}
 			;;
+		--queue-late)
+			queue_late=queue-late

erm ... missing ";;"?

Quoted 11 lines
Quoted 11 lines
scripts/vsp-lib.sh +1 -0
 		*)
 			return 1
@@ -959,6 +962,7 @@ vsp_runner() {
 
 	$yavta -c$count -n $buffers ${format:+-f $format} ${size:+-s $size} \
 		${skip:+--skip $skip} ${file:+--file=$file} ${pause:+-p$pause} \
+		${queue_late:+--$queue_late} \
 		$videodev | ./logger.sh $entity >> $logfile
 }
 
Signature · 3 lines
Regards,

Laurent Pinchart
#21 lore raw

PATCH 7/7 vsp-lib: Reset controls to defaults on each test run

In reply to Kieran Bingham

Some of our tests set flipping and rotation controls, and the VSP cell can be used again by later tests. If these controls are not reset, then that operation is applied to later tests incorrectly causing that test to fail.

In an ideal world, tests should clean up after themselves, and leave the system in a known state. However the world is not ideal and we would not be able to guarantee any previous system state before a test was run anyway. Therefore it is more effective to reset state at the beginning of a test.

To repair this - reset all control values to their defaults at the start of every test during test_init()

---
 scripts/vsp-lib.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)
scripts/vsp-lib.sh +11 -0
index 3d2792707d24..33442816f208 100755
@@ -94,6 +94,14 @@ vsp1_set_control() {
 	$yavta --no-query -w "$control $value" $subdev | ./logger.sh "$entity" >> $logfile
 }
 
+vsp1_reset_controls() {
+	local entity=$1
+	local subdev=$(vsp1_entity_subdev $entity)
+
+	echo "Resetting controls on $subdev" | ./logger.sh "$entity" >> $logfile
+	$yavta --no-query --reset-controls $subdev | ./logger.sh "$entity" >> $logfile
+}
+
 # -----------------------------------------------------------------------------
 # Reference frame generation
 #
@@ -1082,6 +1090,9 @@ test_init() {
 	dev=$(vsp1_device $mdev)
 	echo "Using device $mdev ($dev)" | ./logger.sh config >> $logfile
 
+	# Reset any rotation or flipping controls
+	vsp1_reset_controls wpf.0
+
 	vsp_runner=./vsp-runner.sh
 }
 
Signature · 1 line
2.17.1
Reviewed-by on v1 7/7
#22 lore raw

Re: [VSP-Tests PATCH 7/7] vsp-lib: Reset controls to defaults on each test run

Hi Kieran,

Thank you for the patch.

Quoted 1 line · Kieran Bingham

Some of our tests set flipping and rotation controls, and the VSP cell

cell ?

Quoted 2 lines

can be used again by later tests. If these controls are not reset, then that operation is applied to later tests incorrectly causing that test

s/that test/those tests/ ?

Quoted 8 lines

to fail.

In an ideal world, tests should clean up after themselves, and leave the system in a known state. However the world is not ideal and we would not be able to guarantee any previous system state before a test was run anyway. Therefore it is more effective to reset state at the beginning of a test.

Quoted 4 lines

To repair this - reset all control values to their defaults at the start of every test during test_init()

Quoted 33 lines
---
 scripts/vsp-lib.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)
scripts/vsp-lib.sh +11 -0
index 3d2792707d24..33442816f208 100755
@@ -94,6 +94,14 @@ vsp1_set_control() {
 	$yavta --no-query -w "$control $value" $subdev | ./logger.sh "$entity" >> $logfile
 }
 
+vsp1_reset_controls() {
+	local entity=$1
+	local subdev=$(vsp1_entity_subdev $entity)
+
+	echo "Resetting controls on $subdev" | ./logger.sh "$entity" >> $logfile
+	$yavta --no-query --reset-controls $subdev | ./logger.sh "$entity" >> $logfile
+}
+
 # -----------------------------------------------------------------------------
 # Reference frame generation
 #
@@ -1082,6 +1090,9 @@ test_init() {
 	dev=$(vsp1_device $mdev)
 	echo "Using device $mdev ($dev)" | ./logger.sh config >> $logfile
 
+	# Reset any rotation or flipping controls
+	vsp1_reset_controls wpf.0
+
 	vsp_runner=./vsp-runner.sh
 }
 
Signature · 3 lines
Regards,

Laurent Pinchart
#23 lore raw

Re: [VSP-Tests PATCH 7/7] vsp-lib: Reset controls to defaults on each test run

Hi Laurent,

Quoted 8 lines · Laurent Pinchart

Hi Kieran,

Thank you for the patch.

Quoted 1 line · Kieran Bingham

Some of our tests set flipping and rotation controls, and the VSP cell

cell ?

Hrm ... Block, Module, Instance ?
What is your preferred name for a particular instance of the HW entity ?

I think VSP instance might be the right choice.

Quoted 5 lines
Quoted 3 lines

can be used again by later tests. If these controls are not reset, then that operation is applied to later tests incorrectly causing that test

s/that test/those tests/ ?

Yes, agreed.

Quoted 50 lines
Quoted 9 lines

to fail.

In an ideal world, tests should clean up after themselves, and leave the system in a known state. However the world is not ideal and we would not be able to guarantee any previous system state before a test was run anyway. Therefore it is more effective to reset state at the beginning of a test.

Quoted 4 lines

To repair this - reset all control values to their defaults at the start of every test during test_init()

Quoted 33 lines
---
 scripts/vsp-lib.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)
scripts/vsp-lib.sh +11 -0
index 3d2792707d24..33442816f208 100755
@@ -94,6 +94,14 @@ vsp1_set_control() {
 	$yavta --no-query -w "$control $value" $subdev | ./logger.sh "$entity" >> $logfile
 }
 
+vsp1_reset_controls() {
+	local entity=$1
+	local subdev=$(vsp1_entity_subdev $entity)
+
+	echo "Resetting controls on $subdev" | ./logger.sh "$entity" >> $logfile
+	$yavta --no-query --reset-controls $subdev | ./logger.sh "$entity" >> $logfile
+}
+
 # -----------------------------------------------------------------------------
 # Reference frame generation
 #
@@ -1082,6 +1090,9 @@ test_init() {
 	dev=$(vsp1_device $mdev)
 	echo "Using device $mdev ($dev)" | ./logger.sh config >> $logfile
 
+	# Reset any rotation or flipping controls
+	vsp1_reset_controls wpf.0
+
 	vsp_runner=./vsp-runner.sh
 }
 
Signature · 3 lines
Regards
--
Kieran