From patchwork Tue Dec 11 14:00:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 29 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A0FCA60B10 for ; Tue, 11 Dec 2018 14:59:50 +0100 (CET) Received: from avalon.bb.dnainternet.fi (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0559F55A for ; Tue, 11 Dec 2018 14:59:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1544536790; bh=flsOWhPiOc/kRHDwa/lQr75BdpHcyJbjl9gVREHrFUU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Z42YcoqJ/KAuJCYKgQ836WsObdEf7nVPXDO7F6eKcEHYNuaTdmxZ0FlPsDRS2LUsu U8PG3sMZEZ8tidVnWySVbhZFShFVc0IzZYJKjbesnijgb6YZxIma3ImugWWLTUYH2t LAQpOSGA5YVML/ymE0PW9KTWdJoZb/a3/axOvkmQ= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Tue, 11 Dec 2018 16:00:28 +0200 Message-Id: <20181211140028.25241-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181211140028.25241-1-laurent.pinchart@ideasonboard.com> References: <20181211140028.25241-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/3] utils: ipu3: process: Configure formats on ImgU subdev pads X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2018 13:59:50 -0000 Set format and selection rectangles on the ImgU subdev as required by the driver. Signed-off-by: Laurent Pinchart --- utils/ipu3/ipu3-process.sh | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/utils/ipu3/ipu3-process.sh b/utils/ipu3/ipu3-process.sh index 0d1df9435271..bb4abbe883a0 100755 --- a/utils/ipu3/ipu3-process.sh +++ b/utils/ipu3/ipu3-process.sh @@ -13,6 +13,8 @@ # - raw2pnm (from nvt https://github.com/intel/nvt.git) # - yavta (from git://git.ideasonboard.org/yavta.git) +imgu_entity="ipu3-imgu 0" + # Locate the media device find_media_device() { local mdev @@ -35,12 +37,25 @@ configure_pipeline() { local enable_3a=1 local enable_out=1 local enable_vf=1 + local mode=0 + # Configure the links $mediactl -r - $mediactl -l "\"ipu3-imgu 0 input\":0 -> \"ipu3-imgu 0\":0[1]" - $mediactl -l "\"ipu3-imgu 0\":2 -> \"ipu3-imgu 0 output\":0[$enable_out]" - $mediactl -l "\"ipu3-imgu 0\":3 -> \"ipu3-imgu 0 viewfinder\":0[$enable_vf]" - $mediactl -l "\"ipu3-imgu 0\":4 -> \"ipu3-imgu 0 3a stat\":0[$enable_3a]" + $mediactl -l "\"$imgu_entity input\":0 -> \"$imgu_entity\":0[1]" + $mediactl -l "\"$imgu_entity\":2 -> \"$imgu_entity output\":0[$enable_out]" + $mediactl -l "\"$imgu_entity\":3 -> \"$imgu_entity viewfinder\":0[$enable_vf]" + $mediactl -l "\"$imgu_entity\":4 -> \"$imgu_entity 3a stat\":0[$enable_3a]" + + # Select processing mode (0 for video, 1 for still image) + yavta --no-query -w "0x009819c1 $mode" $($mediactl -e "$imgu_entity") + + # Set formats. The media bus code doesn't matter as it is ignored by the + # driver. We should use the FIXED format, but media-ctl doesn't support + # it. + $mediactl -V "\"$imgu_entity\":0 [fmt:SBGGR10_1X10/$out_size crop:(0,0)/$in_size compose:(0,0)/$in_size]" + $mediactl -V "\"$imgu_entity\":2 [fmt:SBGGR10_1X10/$out_size]" + $mediactl -V "\"$imgu_entity\":3 [fmt:SBGGR10_1X10/$vf_size]" + $mediactl -V "\"$imgu_entity\":4 [fmt:SBGGR10_1X10/$out_size]" } # Perform frame processing through the IMGU @@ -53,17 +68,17 @@ process_frames() { # statistics. Sleep 500ms between each execution of yavta to keep the # stdout messages readable. $yavta -f $IMGU_OUT_PIXELFORMAT -s $out_size "-F$output_dir/frame-out-#.bin" \ - $($mediactl -e "ipu3-imgu 0 output") & + $($mediactl -e "$imgu_entity output") & sleep 0.5 $yavta -f $IMGU_VF_PIXELFORMAT -s $vf_size "-F$output_dir/frame-vf-#.bin" \ - $($mediactl -e "ipu3-imgu 0 viewfinder") & + $($mediactl -e "$imgu_entity viewfinder") & sleep 0.5 - $yavta $($mediactl -e "ipu3-imgu 0 3a stat") & + $yavta $($mediactl -e "$imgu_entity 3a stat") & sleep 0.5 # Feed the IMGU input. $yavta -f $IMGU_IN_PIXELFORMAT -s $in_size "-F$in_file" \ - $($mediactl -e "ipu3-imgu 0 input") + $($mediactl -e "$imgu_entity input") } # Convert captured files to ppm