From patchwork Thu Aug 24 09:30:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 9919637 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2D6D6603FF for ; Thu, 24 Aug 2017 09:30:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DFC328BF4 for ; Thu, 24 Aug 2017 09:30:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12D1B28BD7; Thu, 24 Aug 2017 09:30:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85A7728BE2 for ; Thu, 24 Aug 2017 09:30:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751342AbdHXJaU (ORCPT ); Thu, 24 Aug 2017 05:30:20 -0400 Received: from galahad.ideasonboard.com ([185.26.127.97]:34913 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751274AbdHXJaS (ORCPT ); Thu, 24 Aug 2017 05:30:18 -0400 Received: from avalon.bb.dnainternet.fi (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id B64F62089B; Thu, 24 Aug 2017 11:28:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1503566925; bh=a/VbAj1CUiyeKUdbCGQLSPRuOjwfiHQxMuPVf7aweJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P3a96A7tQfGnyYXwvrTvarM+Sd6lJPAfdTWyfzabPBhDpXbWRL+RCJJKNcRprCHZD VuHHRaYrzXT75fuUWZ4neNFN6osO1LAFd8UORTaY+mfqMWNm91OJHKRROzIr635NjC UNizUtUpUooArKYz3K+1OGyc1NqI4fnNs+dQ/SFw= From: Laurent Pinchart To: linux-renesas-soc@vger.kernel.org Cc: Kieran Bingham Subject: [PATCH 2/3] vsp-lib: Add support for RPF-BRS-WPF pipelines Date: Thu, 24 Aug 2017 12:30:42 +0300 Message-Id: <20170824093043.8606-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170824093043.8606-1-laurent.pinchart@ideasonboard.com> References: <20170824093043.8606-1-laurent.pinchart@ideasonboard.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Reuse the BRU code, using the brx generic name to cover both BRU and BRS. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- scripts/vsp-lib.sh | 63 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 20 deletions(-) diff --git a/scripts/vsp-lib.sh b/scripts/vsp-lib.sh index fa4a6984e1bb..0f3992a7827e 100755 --- a/scripts/vsp-lib.sh +++ b/scripts/vsp-lib.sh @@ -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() {