diff mbox series

[vsp-tests,11/16] vsp-lib: Support specifying pipeline internal format for RPF -> WPF

Message ID 20250409004758.11014-12-laurent.pinchart@ideasonboard.com (mailing list archive)
State New
Delegated to: Kieran Bingham
Headers show
Series Add color space conversion test | expand

Commit Message

Laurent Pinchart April 9, 2025, 12:47 a.m. UTC
The RPF can perform color space conversion, converting between RGB and
YUV formats. Testing this feature requires specifying different formats
on the RPF input and output. Add a --midfmt argument to the
format_rpf_wpf() function to specify the RPF output format, and
propagate it through the pipeline up to the WPF input.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 scripts/vsp-lib.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/scripts/vsp-lib.sh b/scripts/vsp-lib.sh
index ba87de5af954..d8722905cdc9 100755
--- a/scripts/vsp-lib.sh
+++ b/scripts/vsp-lib.sh
@@ -789,6 +789,7 @@  format_rpf_wpf() {
 	local infmt=$(format_v4l2_to_mbus $3)
 	local size=$4
 	local outfmt=$(format_v4l2_to_mbus $5)
+	local midfmt=$infmt
 	local rpfcrop=
 	local wpfcrop=
 	local rpfoutsize=
@@ -802,6 +803,9 @@  format_rpf_wpf() {
 
 	for option in $* ; do
 		case $option in
+		--midfmt=*)
+			midfmt=$(format_v4l2_to_mbus ${option/--midfmt=/})
+			;;
 		--rpfcrop=*)
 			rpfcrop=${option/--rpfcrop=/}
 			;;
@@ -831,8 +835,8 @@  format_rpf_wpf() {
 	fi
 
 	$mediactl -d $mdev -V "'$dev rpf.$rpf':0 [fmt:$infmt/$size $rpfcrop]"
-	$mediactl -d $mdev -V "'$dev rpf.$rpf':1 [fmt:$infmt/$rpfoutsize]"
-	$mediactl -d $mdev -V "'$dev wpf.$wpf':0 [fmt:$infmt/$rpfoutsize $wpfcrop]"
+	$mediactl -d $mdev -V "'$dev rpf.$rpf':1 [fmt:$midfmt/$rpfoutsize]"
+	$mediactl -d $mdev -V "'$dev wpf.$wpf':0 [fmt:$midfmt/$rpfoutsize $wpfcrop]"
 	$mediactl -d $mdev -V "'$dev wpf.$wpf':1 [fmt:$outfmt/$outsize]"
 }