From patchwork Thu Sep 26 09:36:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 21376 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id CEE11C3257 for ; Thu, 26 Sep 2024 09:36:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A801C6350F; Thu, 26 Sep 2024 11:36:35 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="vNrT99sa"; dkim-atps=neutral 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 ED414634F2 for ; Thu, 26 Sep 2024 11:36:33 +0200 (CEST) Received: from localhost.localdomain (unknown [IPv6:2405:201:2015:f873:55f8:639e:8e9f:12ec]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1AA928D4; Thu, 26 Sep 2024 11:35:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1727343305; bh=qkHungXqD0jng6ZyKemwvyK2JOEGD2OSJ2GHjNAs++M=; h=From:To:Cc:Subject:Date:From; b=vNrT99saQ33lfb1zwSRUbPTsV4ZMD+1jSq3YwYxmdvyZ+KrwbzDqONAophffEgIbl 9A+LhwERyiQ0cNV2BhoM+GUjKsPZZol1IF+E3BIhJkBkm7k9erHvW/cORGCMTdxKDl 5/J5Kt+7yrDopSyQXXm2l1z4byo0nGQY4Nbmd3nw= From: Umang Jain To: libcamera-devel@lists.libcamera.org Cc: Laurent Pinchart , Stefan Klug , Umang Jain Subject: [PATCH v8 0/4] rkisp1: Plumb the DW100 dewarper as converter Date: Thu, 26 Sep 2024 15:06:19 +0530 Message-ID: <20240926093623.94136-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.45.0 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This series intends to support i.MX8MP DW100 dewarper in rkisp1 pipeline handler. It is modelled as a V4L2M2MConverter and has a helper to support scaler crop control. Extensions to the base converter interface has also been done initially in the series. Patch 1/4 add ability to add features to the Converter interface. Each Converter can dictate its own features it can support Patch 2/4 adds crop feature enumeration and virtual functions and gets implemented in the V4L2 M2M converter. Patch 3/4 prepares the rkisp1 pipeline handler to register controls for the camera, outside of the IPA. The dw100 converter will let us support scaler crop - which will be registered as one of the camera controls. Patch 4/4 plumbs the DW100 as converter in the rkisp1 pipeline handler Series is based on top of [PATCH] libcamera: v4l2_videodevice: Add getSelection() function Testing: -------- The series is tested on i.MX8MP and cam utility, by setting scaler crop control via capture script with IMX283 attached to isp0. Changes in v8: - Fix subject to "rkisp1: Plumb the DW100 dewarper as converter" - Fix documentation in 2/4 - Drop features_ member variable in 2/4 in V4L2M2MStream class - Use V4L2_SEL_TGT_CROP_BOUNDS for querying max crop bound (2/4) - Introduce V4L2M2MStream::getSelection() helper as well (2/4) - Fix race while setting scalercrop metadata in 4/4 - Format debug logs in 2/4 and 4/4 - Reduce indentation in 2/4 for discovering input crop Changes in v7: - Documentation improvements for input crop (1/4) - Crop feature now discovered dynamically at construction (2/4) - Handling of scaler crop control is deferred. Now scaler crop is applied at dewarper after buffer from ISP is ready (4/4) - Add explanatory comments about dw100/i.MX8MP platform (4/4) - Drop dw100 Converter sub-classing from v6 - lower indentation (4/4) - report scaler crop value for all frames now. (4/4) - Use ScopeExitActions on dewarp cleanup paths (4/4) - copy updateControls() documentation from IPU3 (3/4) Changes in v6: - clarify crop expectations - set on input side - Rename setCrop() to setInputCrop - Rename getFeatures() to features() - Rename getCropBounds() to inputCropBounds() - rename Features::Crop to Features::InputCrop - Document crop functionality properly - Improve error paths - exportsBuffers() between RkISP1Path<>dewarper instead of allocateBuffers. Changes in v5: - Return -ENOTSUP for base implementation for virtual setCrop() in 2/5 - Return configured size for base implemention for virtual getCropBounds in 2/5. - Fix a bug in getting crop bounds when streams are not configured - drop getSelection() V4L2VideoDevices additions from v4. we can get bounds by setSelection by setting 1x1 and UINT_MAX x UINT_MAX rectangles. changes in v4: - rework Converter Interface to expose Features - Add Crop Feature interface in Converter setCrop and setCropBound - Implement cropping in V4L2M2MConverter for V4L2 M2M based converters - Introduce useDewarper_ to denote when to use dewarper (simplied code reading). - Trivial typo fixing. Changes in v3: - Base on top of [2] - Model dewarper class as converter, so can be used with Simple pipeline-handler/ISI Changes in v2: - Fix raw capture configuration, disable dewarper in that case Umang Jain (4): libcamera: converter: Add interface for feature flags libcamera: converter: Add interface to support cropping capability libcamera: rkisp1: Prepare for additional camera controls libcamera: rkisp1: Plumb the dw100 dewarper as V4L2M2M converter include/libcamera/internal/converter.h | 19 +- .../internal/converter/converter_v4l2_m2m.h | 11 + src/libcamera/converter.cpp | 64 ++++- .../converter/converter_v4l2_m2m.cpp | 114 +++++++++ src/libcamera/pipeline/rkisp1/rkisp1.cpp | 228 +++++++++++++++++- 5 files changed, 424 insertions(+), 12 deletions(-)