From patchwork Wed Feb 8 14:03:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 9562601 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 E1D0160574 for ; Wed, 8 Feb 2017 14:04:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D457C284EE for ; Wed, 8 Feb 2017 14:04:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C93EE284F1; Wed, 8 Feb 2017 14:04: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=-6.9 required=2.0 tests=BAYES_00,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 75A9F284EF for ; Wed, 8 Feb 2017 14:04:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932160AbdBHOEV (ORCPT ); Wed, 8 Feb 2017 09:04:21 -0500 Received: from mail.kernel.org ([198.145.29.136]:41562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753903AbdBHOET (ORCPT ); Wed, 8 Feb 2017 09:04:19 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7C49C20340; Wed, 8 Feb 2017 14:04:18 +0000 (UTC) Received: from CookieMonster.cookiemonster.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AEF02202B8; Wed, 8 Feb 2017 14:04:16 +0000 (UTC) From: Kieran Bingham To: laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org, kieran.bingham@ideasonboard.com Subject: [PATCH 4/5] vsp-lib: Support RPF frame cropping Date: Wed, 8 Feb 2017 14:03:59 +0000 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: X-Virus-Scanned: ClamAV using ClamSMTP 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 From: Kieran Bingham Pass the optional '--crop (X,Y)/WxH' parameter through reference_frame allowing the input to be cropped for comparison Signed-off-by: Kieran Bingham --- scripts/vsp-lib.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/scripts/vsp-lib.sh b/scripts/vsp-lib.sh index 08bf8f36c582..42a4bb20d1be 100755 --- a/scripts/vsp-lib.sh +++ b/scripts/vsp-lib.sh @@ -162,6 +162,9 @@ reference_frame() { vflip) [ x$value = x1 ] && options="$options --vflip" ;; + crop) + options="$options --crop $value" + ;; esac done @@ -717,6 +720,40 @@ format_rpf_wpf() { __vsp_wpf_format=$5 } +format_crop_rpf_wpf() { + local rpf=$1 + local wpf=$2 + local infmt=$(format_v4l2_to_mbus $3) + local size=$4 + local outfmt=$(format_v4l2_to_mbus $5) + local rpfcrop=$6 + local wpfcrop=$7 + local rpfoutsize= + local outsize= + + if [ x$rpfcrop != 'x' ] ; then + rpfcrop="crop:$rpfcrop" + rpfoutsize=$(echo $rpfcrop | sed 's/.*\///') + else + rpfoutsize=$size + fi + + if [ x$wpfcrop != 'x' ] ; then + wpfcrop="crop:$wpfcrop" + outsize=$(echo $wpfcrop | sed 's/.*\///') + else + outsize=$rpfoutsize + 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 wpf.$wpf':1 [fmt:$outfmt/$outsize]" + + __vsp_rpf_format=$3 + __vsp_wpf_format=$5 +} + format_wpf() { local format=$(format_v4l2_to_mbus $1) local size=$2