Skip to contentSkip to conversation

vsp-tests: Add BRS test

PATCH In review Laurent Pinchart 3 participants 10 messages Aug 24, 2017 – Aug 30, 2017

lore
Share & tools
lore
#0 lore raw

cover vsp-tests: Add BRS test

Hello,

This patch series adds a test to the VSP unit test suite for the BRS module.

The BRS is the Blend/ROP Secondary unit, a stripped-down version of the BRU that supports two inputs only. It is present in some VSPD instances, in particular on the H3 ES2.0.

As the VSPD is used for display pipelines only the BRS can't be tested through the V4L2 API with the upstream VSP driver. A simple hack that exposes the VSPD through V4L2 is needed.

Laurent Pinchart (3):
vsp-lib: Use the correct media device name to count BRU inputs
vsp-lib: Add support for RPF-BRS-WPF pipelines
tests: Add BRS test

 scripts/vsp-lib.sh          | 63 +++++++++++++++++++++++++++++++--------------
 tests/vsp-unit-test-0024.sh | 45 ++++++++++++++++++++++++++++++++
 2 files changed, 88 insertions(+), 20 deletions(-)
 create mode 100755 tests/vsp-unit-test-0024.sh
Signature · 3 lines
Regards,

Laurent Pinchart
#1 lore raw

PATCH 1/3 vsp-lib: Use the correct media device name to count BRU inputs

Use the media device under test, not the default media0.

---
 scripts/vsp-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/vsp-lib.sh +1 -1
index 726ff793b2ce..fa4a6984e1bb 100755
@@ -54,7 +54,7 @@ vsp1_count_wpfs() {
 }
 
 vsp1_count_bru_inputs() {
-	local num_pads=`media-ctl -p | grep 'entity.*bru' | sed 's/.*(\([0-9]\) pads.*/\1/'`
+	local num_pads=`$mediactl -d $mdev -p | grep 'entity.*bru' | sed 's/.*(\([0-9]\) pads.*/\1/'`
 	echo $((num_pads-1))
 }
 
Signature · 3 lines
Regards,

Laurent Pinchart
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] vsp-lib: Use the correct media device name to count BRU inputs

Hi Laurent,

Thanks for the patch.

Quoted 3 lines · Laurent Pinchart

Use the media device under test, not the default media0.

Looks good, and looks like this is the only use of media-ctl directly.

Quoted 18 lines
---
 scripts/vsp-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/vsp-lib.sh +1 -1
index 726ff793b2ce..fa4a6984e1bb 100755
@@ -54,7 +54,7 @@ vsp1_count_wpfs() {
 }
 
 vsp1_count_bru_inputs() {
-	local num_pads=`media-ctl -p | grep 'entity.*bru' | sed 's/.*(\([0-9]\) pads.*/\1/'`
+	local num_pads=`$mediactl -d $mdev -p | grep 'entity.*bru' | sed 's/.*(\([0-9]\) pads.*/\1/'`
 	echo $((num_pads-1))
 }
 
#3 lore raw

PATCH 2/3 vsp-lib: Add support for RPF-BRS-WPF pipelines

In reply to Laurent Pinchart

Reuse the BRU code, using the brx generic name to cover both BRU and BRS.

---
 scripts/vsp-lib.sh | 63 +++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 43 insertions(+), 20 deletions(-)
scripts/vsp-lib.sh +43 -20
index fa4a6984e1bb..0f3992a7827e 100755
@@ -53,11 +53,16 @@ vsp1_count_wpfs() {
 	$mediactl -d $mdev -p | grep -- '- entity.*wpf.[0-9] [^o]' | wc -l
 }
 
-vsp1_count_bru_inputs() {
-	local num_pads=`$mediactl -d $mdev -p | grep 'entity.*bru' | sed 's/.*(\([0-9]\) pads.*/\1/'`
+__vsp1_count_brx_inputs() {
+	local name=$1
+	local num_pads=`$mediactl -d $mdev -p | grep "entity.*$name" | sed 's/.*(\([0-9]\) pads.*/\1/'`
 	echo $((num_pads-1))
 }
 
+vsp1_count_bru_inputs() {
+	__vsp1_count_brx_inputs "bru"
+}
+
 vsp1_entity_subdev() {
 	$mediactl -d $mdev -e "$dev $1"
 }
@@ -105,7 +110,7 @@ reference_frame() {
 
 	# gen-image doesn't support processing HSV input images. The good news
 	# is that the HSV tests that take HSV images as inputs don't need to
-	# perform any processing. We can set the input format to RGB for HSV
+	# perform any processing. We can set the input format to RGB for HSB
 	# reference frame generation.
 	case $in_format in
 	HSV24 | HSV32)
@@ -178,7 +183,7 @@ reference_frame() {
 		esac
 	done
 
-	[ x$__vsp_bru_inputs != x ] && options="$options -c $__vsp_bru_inputs"
+	[ x$__vsp_brx_inputs != x ] && options="$options -c $__vsp_brx_inputs"
 
 	$genimage -i $in_format -f $out_format -s $size -a $alpha $options -o $file \
 		frames/frame-reference-1024x768.pnm
@@ -363,18 +368,27 @@ pipe_none() {
 	return
 }
 
-pipe_rpf_bru() {
-	local ninputs=$1
+__pipe_rpf_brx() {
+	local name=$1
+	local ninputs=$2
 
-	local bru_output=$(vsp1_count_bru_inputs)
+	local output=$(__vsp1_count_brx_inputs $name)
 
 	for input in `seq 0 1 $((ninputs-1))` ; do
-		$mediactl -d $mdev -l "'$dev rpf.$input':1 -> '$dev bru':$input [1]"
+		$mediactl -d $mdev -l "'$dev rpf.$input':1 -> '$dev $name':$input [1]"
 	done
-	$mediactl -d $mdev -l "'$dev bru':$bru_output -> '$dev wpf.0':0 [1]"
+	$mediactl -d $mdev -l "'$dev $name':$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_brx_inputs=$ninputs
+}
+
+pipe_rpf_brs() {
+	__pipe_rpf_brx "brs" $*
+}
+
+pipe_rpf_bru() {
+	__pipe_rpf_brx "bru" $*
 }
 
 pipe_rpf_bru_uds() {
@@ -468,7 +482,7 @@ pipe_rpf_wpf() {
 pipe_reset() {
 	$mediactl -d $mdev -r
 
-	__vsp_bru_inputs=
+	__vsp_brx_inputs=
 	__vsp_histo_type=
 	__vsp_rpf_format=
 	__vsp_wpf_index=0
@@ -532,26 +546,35 @@ format_rpf() {
 	__vsp_rpf_format=$1
 }
 
-format_rpf_bru() {
-	local format=$(format_v4l2_to_mbus $1)
-	local size=$2
-	local ninputs=$3
+__format_rpf_brx() {
+	local name=$1
+	local format=$(format_v4l2_to_mbus $2)
+	local size=$3
+	local ninputs=$4
 	local offset=0
 
-	local bru_output=$(vsp1_count_bru_inputs)
+	local output=$(__vsp1_count_brx_inputs $name)
 
 	for input in `seq 0 1 $((ninputs-1))` ; do
 		offset=$((offset+50))
 		$mediactl -d $mdev -V "'$dev rpf.$input':0 [fmt:$format/$size]"
-		$mediactl -d $mdev -V "'$dev bru':$input   [fmt:$format/$size compose:($offset,$offset)/$size]"
+		$mediactl -d $mdev -V "'$dev $name':$input [fmt:$format/$size compose:($offset,$offset)/$size]"
 	done
 
-	$mediactl -d $mdev -V "'$dev bru':$bru_output [fmt:$format/$size]"
+	$mediactl -d $mdev -V "'$dev $name':$output [fmt:$format/$size]"
 	$mediactl -d $mdev -V "'$dev wpf.0':0 [fmt:$format/$size]"
 	$mediactl -d $mdev -V "'$dev wpf.0':1 [fmt:$format/$size]"
 
-	__vsp_rpf_format=$1
-	__vsp_wpf_format=$1
+	__vsp_rpf_format=$2
+	__vsp_wpf_format=$2
+}
+
+format_rpf_brs() {
+	__format_rpf_brx "brs" $*
+}
+
+format_rpf_bru() {
+	__format_rpf_brx "bru" $*
 }
 
 format_rpf_bru_uds() {
Signature · 3 lines
Regards,

Laurent Pinchart
Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] vsp-lib: Add support for RPF-BRS-WPF pipelines

Hi Laurent,

Thankyou for the patch

Quoted 4 lines · Laurent Pinchart

Reuse the BRU code, using the brx generic name to cover both BRU and BRS.

This looks good to me:

Quoted 134 lines
---
 scripts/vsp-lib.sh | 63 +++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 43 insertions(+), 20 deletions(-)
scripts/vsp-lib.sh +43 -20
index fa4a6984e1bb..0f3992a7827e 100755
@@ -53,11 +53,16 @@ vsp1_count_wpfs() {
 	$mediactl -d $mdev -p | grep -- '- entity.*wpf.[0-9] [^o]' | wc -l
 }
 
-vsp1_count_bru_inputs() {
-	local num_pads=`$mediactl -d $mdev -p | grep 'entity.*bru' | sed 's/.*(\([0-9]\) pads.*/\1/'`
+__vsp1_count_brx_inputs() {
+	local name=$1
+	local num_pads=`$mediactl -d $mdev -p | grep "entity.*$name" | sed 's/.*(\([0-9]\) pads.*/\1/'`
 	echo $((num_pads-1))
 }
 
+vsp1_count_bru_inputs() {
+	__vsp1_count_brx_inputs "bru"
+}
+
 vsp1_entity_subdev() {
 	$mediactl -d $mdev -e "$dev $1"
 }
@@ -105,7 +110,7 @@ reference_frame() {
 
 	# gen-image doesn't support processing HSV input images. The good news
 	# is that the HSV tests that take HSV images as inputs don't need to
-	# perform any processing. We can set the input format to RGB for HSV
+	# perform any processing. We can set the input format to RGB for HSB
 	# reference frame generation.
 	case $in_format in
 	HSV24 | HSV32)
@@ -178,7 +183,7 @@ reference_frame() {
 		esac
 	done
 
-	[ x$__vsp_bru_inputs != x ] && options="$options -c $__vsp_bru_inputs"
+	[ x$__vsp_brx_inputs != x ] && options="$options -c $__vsp_brx_inputs"
 
 	$genimage -i $in_format -f $out_format -s $size -a $alpha $options -o $file \
 		frames/frame-reference-1024x768.pnm
@@ -363,18 +368,27 @@ pipe_none() {
 	return
 }
 
-pipe_rpf_bru() {
-	local ninputs=$1
+__pipe_rpf_brx() {
+	local name=$1
+	local ninputs=$2
 
-	local bru_output=$(vsp1_count_bru_inputs)
+	local output=$(__vsp1_count_brx_inputs $name)
 
 	for input in `seq 0 1 $((ninputs-1))` ; do
-		$mediactl -d $mdev -l "'$dev rpf.$input':1 -> '$dev bru':$input [1]"
+		$mediactl -d $mdev -l "'$dev rpf.$input':1 -> '$dev $name':$input [1]"
 	done
-	$mediactl -d $mdev -l "'$dev bru':$bru_output -> '$dev wpf.0':0 [1]"
+	$mediactl -d $mdev -l "'$dev $name':$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_brx_inputs=$ninputs
+}
+
+pipe_rpf_brs() {
+	__pipe_rpf_brx "brs" $*
+}
+
+pipe_rpf_bru() {
+	__pipe_rpf_brx "bru" $*
 }
 
 pipe_rpf_bru_uds() {
@@ -468,7 +482,7 @@ pipe_rpf_wpf() {
 pipe_reset() {
 	$mediactl -d $mdev -r
 
-	__vsp_bru_inputs=
+	__vsp_brx_inputs=
 	__vsp_histo_type=
 	__vsp_rpf_format=
 	__vsp_wpf_index=0
@@ -532,26 +546,35 @@ format_rpf() {
 	__vsp_rpf_format=$1
 }
 
-format_rpf_bru() {
-	local format=$(format_v4l2_to_mbus $1)
-	local size=$2
-	local ninputs=$3
+__format_rpf_brx() {
+	local name=$1
+	local format=$(format_v4l2_to_mbus $2)
+	local size=$3
+	local ninputs=$4
 	local offset=0
 
-	local bru_output=$(vsp1_count_bru_inputs)
+	local output=$(__vsp1_count_brx_inputs $name)
 
 	for input in `seq 0 1 $((ninputs-1))` ; do
 		offset=$((offset+50))
 		$mediactl -d $mdev -V "'$dev rpf.$input':0 [fmt:$format/$size]"
-		$mediactl -d $mdev -V "'$dev bru':$input   [fmt:$format/$size compose:($offset,$offset)/$size]"
+		$mediactl -d $mdev -V "'$dev $name':$input [fmt:$format/$size compose:($offset,$offset)/$size]"
 	done
 
-	$mediactl -d $mdev -V "'$dev bru':$bru_output [fmt:$format/$size]"
+	$mediactl -d $mdev -V "'$dev $name':$output [fmt:$format/$size]"
 	$mediactl -d $mdev -V "'$dev wpf.0':0 [fmt:$format/$size]"
 	$mediactl -d $mdev -V "'$dev wpf.0':1 [fmt:$format/$size]"
 
-	__vsp_rpf_format=$1
-	__vsp_wpf_format=$1
+	__vsp_rpf_format=$2
+	__vsp_wpf_format=$2
+}
+
+format_rpf_brs() {
+	__format_rpf_brx "brs" $*
+}
+
+format_rpf_bru() {
+	__format_rpf_brx "bru" $*
 }
 
 format_rpf_bru_uds() {
#5 lore raw

PATCH 3/3 tests: Add BRS test

In reply to Laurent Pinchart
---
 tests/vsp-unit-test-0024.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100755 tests/vsp-unit-test-0024.sh
tests/vsp-unit-test-0024.sh new file +45 -0
new file mode 100755
index 000000000000..036429254a8f
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+#
+# Test composition through the BRS in RGB and YUV formats.
+#
+
+source vsp-lib.sh
+
+features="rpf.0 rpf.1 brs wpf.0"
+formats="RGB24 YUV444M"
+
+test_brs() {
+	local format=$1
+	local ninputs=$2
+
+	test_start "BRS in $format with $ninputs inputs"
+
+	pipe_configure rpf-brs $ninputs
+	format_configure rpf-brs $format 1024x768 $ninputs
+
+	local input
+	for input in `seq 0 1 $((ninputs-1))` ; do
+		vsp_runner rpf.$input &
+	done
+	vsp_runner wpf.0
+
+	local result=$(compare_frames)
+
+	test_complete $result
+}
+
+test_main() {
+	local num_inputs=2
+	local format
+	local ninputs
+
+	for format in $formats ; do
+		for ninputs in `seq $num_inputs` ; do
+			test_brs $format $ninputs
+		done
+	done
+}
+
+test_init $0 "$features"
+test_run
Signature · 3 lines
Regards,

Laurent Pinchart
Reviewed-by on v1 3/3
#6 lore raw

Re: [PATCH 3/3] tests: Add BRS test

Hi Laurent,

Quoted 1 line · Laurent Pinchart

Nothing scary in here. Just pending testing the other patchset/issues, then I can run this through as well for a tested-by.

Meanwhile:

Quoted 57 lines
---
 tests/vsp-unit-test-0024.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100755 tests/vsp-unit-test-0024.sh
tests/vsp-unit-test-0024.sh new file +45 -0
new file mode 100755
index 000000000000..036429254a8f
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+#
+# Test composition through the BRS in RGB and YUV formats.
+#
+
+source vsp-lib.sh
+
+features="rpf.0 rpf.1 brs wpf.0"
+formats="RGB24 YUV444M"
+
+test_brs() {
+	local format=$1
+	local ninputs=$2
+
+	test_start "BRS in $format with $ninputs inputs"
+
+	pipe_configure rpf-brs $ninputs
+	format_configure rpf-brs $format 1024x768 $ninputs
+
+	local input
+	for input in `seq 0 1 $((ninputs-1))` ; do
+		vsp_runner rpf.$input &
+	done
+	vsp_runner wpf.0
+
+	local result=$(compare_frames)
+
+	test_complete $result
+}
+
+test_main() {
+	local num_inputs=2
+	local format
+	local ninputs
+
+	for format in $formats ; do
+		for ninputs in `seq $num_inputs` ; do
+			test_brs $format $ninputs
+		done
+	done
+}
+
+test_init $0 "$features"
+test_run
#7 lore raw

Re: [PATCH 3/3] tests: Add BRS test

Hi Laurent,

Clearly I hit send too early <pre-testing> :-D

Quoted 18 lines · Kieran Bingham

Hi Laurent,

Quoted 1 line · Laurent Pinchart

Nothing scary in here. Just pending testing the other patchset/issues, then I can run this through as well for a tested-by.

Meanwhile:

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

tests/vsp-unit-test-0024.sh line 7

Quoted 13 lines
tests/vsp-unit-test-0024.sh new file +7 -0
new file mode 100755
index 000000000000..036429254a8f
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+#
+# Test composition through the BRS in RGB and YUV formats.
+#
+
+source vsp-lib.sh

Please can this be:
. ./vsp-lib.sh

--
Kieran

Quoted 39 lines
Quoted 39 lines
tests/vsp-unit-test-0024.sh new file +38 -0
+
+features="rpf.0 rpf.1 brs wpf.0"
+formats="RGB24 YUV444M"
+
+test_brs() {
+	local format=$1
+	local ninputs=$2
+
+	test_start "BRS in $format with $ninputs inputs"
+
+	pipe_configure rpf-brs $ninputs
+	format_configure rpf-brs $format 1024x768 $ninputs
+
+	local input
+	for input in `seq 0 1 $((ninputs-1))` ; do
+		vsp_runner rpf.$input &
+	done
+	vsp_runner wpf.0
+
+	local result=$(compare_frames)
+
+	test_complete $result
+}
+
+test_main() {
+	local num_inputs=2
+	local format
+	local ninputs
+
+	for format in $formats ; do
+		for ninputs in `seq $num_inputs` ; do
+			test_brs $format $ninputs
+		done
+	done
+}
+
+test_init $0 "$features"
+test_run
#8 lore raw

Re: [PATCH 3/3] tests: Add BRS test

Hi Kieran,

Quoted 24 lines · On Wednesday, 30 August 2017 17:31:11 EEST Kieran Bingham wrote:

Hi Laurent,

Clearly I hit send too early <pre-testing> :-D

Quoted 19 lines · Kieran Bingham

Hi Laurent,

Quoted 1 line · Laurent Pinchart

Nothing scary in here. Just pending testing the other patchset/issues, then I can run this through as well for a tested-by.

Meanwhile:

Quoted 7 lines

---

 tests/vsp-unit-test-0024.sh | 45
 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45
 insertions(+)
 create mode 100755 tests/vsp-unit-test-0024.sh
Quoted 16 lines
Quoted 5 lines
Quoted 5 lines
tests/vsp-unit-test-0024.sh new file +0 -0
new file mode 100755
index 000000000000..036429254a8f
Quoted 8 lines

tests/vsp-unit-test-0024.sh line 7

Quoted 8 lines
tests/vsp-unit-test-0024.sh new file +7 -0
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+#
+# Test composition through the BRS in RGB and YUV formats.
+#
+
+source vsp-lib.sh

Please can this be:
. ./vsp-lib.sh

Sure, it's now fixed in my tree, I'm just waiting for your Tested-by: tag before pushing it out.

Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
tests/vsp-unit-test-0024.sh new file +38 -0
+
+features="rpf.0 rpf.1 brs wpf.0"
+formats="RGB24 YUV444M"
+
+test_brs() {
+	local format=$1
+	local ninputs=$2
+
+	test_start "BRS in $format with $ninputs inputs"
+
+	pipe_configure rpf-brs $ninputs
+	format_configure rpf-brs $format 1024x768 $ninputs
+
+	local input
+	for input in `seq 0 1 $((ninputs-1))` ; do
+		vsp_runner rpf.$input &
+	done
+	vsp_runner wpf.0
+
+	local result=$(compare_frames)
+
+	test_complete $result
+}
+
+test_main() {
+	local num_inputs=2
+	local format
+	local ninputs
+
+	for format in $formats ; do
+		for ninputs in `seq $num_inputs` ; do
+			test_brs $format $ninputs
+		done
+	done
+}
+
+test_init $0 "$features"
+test_run
Signature · 3 lines
Regards,

Laurent Pinchart
Tested-by on the v1 series
#9 lore raw
In reply to Laurent Pinchart

For the series,

On Salvator-XS (with minor kernel change to enable .uapi on VSPD entities)

root@Ubuntu-ARM64:~/vsp-tests# ./vsp-unit-test-0024.sh
Testing BRS in RGB24 with 1 inputs: pass
Testing BRS in RGB24 with 2 inputs: pass
Testing BRS in YUV444M with 1 inputs: pass
Testing BRS in YUV444M with 2 inputs: pass
root@Ubuntu-ARM64:~/vsp-tests#

--
Regards

Kieran

Interestingly as a side note, while on the Salvator-XS, I ran test-0003 and it went straight through 4 times consecutively!

root@Ubuntu-ARM64:~/vsp-tests# ./vsp-unit-test-0003.sh
Testing scaling from 640x640 to 640x480 in RGB24: pass
Testing scaling from 1024x768 to 640x480 in RGB24: pass
Testing scaling from 640x480 to 1024x768 in RGB24: pass
Testing scaling from 640x640 to 640x480 in YUV444M: pass
Testing scaling from 1024x768 to 640x480 in YUV444M: pass
Testing scaling from 640x480 to 1024x768 in YUV444M: pass
Quoted 22 lines · Laurent Pinchart

Hello,

This patch series adds a test to the VSP unit test suite for the BRS module.

The BRS is the Blend/ROP Secondary unit, a stripped-down version of the BRU that supports two inputs only. It is present in some VSPD instances, in particular on the H3 ES2.0.

As the VSPD is used for display pipelines only the BRS can't be tested through the V4L2 API with the upstream VSP driver. A simple hack that exposes the VSPD through V4L2 is needed.

Laurent Pinchart (3):
vsp-lib: Use the correct media device name to count BRU inputs
vsp-lib: Add support for RPF-BRS-WPF pipelines
tests: Add BRS test

 scripts/vsp-lib.sh          | 63 +++++++++++++++++++++++++++++++--------------
 tests/vsp-unit-test-0024.sh | 45 ++++++++++++++++++++++++++++++++
 2 files changed, 88 insertions(+), 20 deletions(-)
 create mode 100755 tests/vsp-unit-test-0024.sh