From patchwork Tue Mar 21 17:20:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 18422 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 2E815C0F1B for ; Tue, 21 Mar 2023 17:20:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7B94A62710; Tue, 21 Mar 2023 18:20:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679419213; bh=BEDuFBa88PNQkhxS5xKRjTA0DEbIlMKzGS4351RgIWc=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=2Toyey8Nq+HC+FY5KtGe9UYX9g1Grm1BDVUaRbSxOmjPs6YXJYxumGYthcbocoWlc iTYg1bBWpCWmALLAjTGpf1c7HqKsRuBf5P0wIUVixZJBRtRd5ayPFCJVBmLA5IckHc ElhJOizSqhHRr2v+i7LxAO5Gsel39A/5JgYWkR40FFJGXrw8k/Rk1ONETA7jj2XYl4 n5T3AdptynrzFBvZQMDjNuc3ozLNX6twblZ42KRwpSJkqovxfkmGkYLRIfZ7W9tcPH q1E6xBGl116Lgi9mzwzQprLWWR66q/8XLk7f9XNvyeRYUpcbHtQAmyku2PDwkJkTqr leoFSKLWtP1UQ== 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 1394461ED1 for ; Tue, 21 Mar 2023 18:20:12 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="FJxZa39b"; dkim-atps=neutral Received: from uno.homenet.telecomitalia.it (host-87-18-61-243.retail.telecomitalia.it [87.18.61.243]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 370D810B; Tue, 21 Mar 2023 18:20:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1679419211; bh=BEDuFBa88PNQkhxS5xKRjTA0DEbIlMKzGS4351RgIWc=; h=From:To:Cc:Subject:Date:From; b=FJxZa39b9KYQD3fhINatnEhXMaRste0Em3U9gZeKtopqeULTin1F4CFuKPlNirGoP XE6F/Q/oUZyieCdw6ZPhV0CxGbVVqGLY4udHAY8aCf4zJ51CnMKHW0b6aPn2lpRTCm pfqlVHo2f94sJacH0R3LzioGd2FTyOepuea/7bmM= To: libcamera-devel@lists.libcamera.org Date: Tue, 21 Mar 2023 18:20:00 +0100 Message-Id: <20230321172004.176852-1-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 0/4] libcamera: rkisp1: Fix generateConfiguration 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: , X-Patchwork-Original-From: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Cc: Jacopo Mondi , libcamera@luigi311.com Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The series started with bug 180: https://bugs.libcamera.org/show_bug.cgi?id=180 Patch 1 fixes the bug by using main path if a single stream is requested I have then noticed how the current implementation of RkISP1Path::generateConfiguration() could produce unusual sizes, such as 1920x1432 in case the sensor's resolution is larger than the maximum supported 1920x1920 output. Before assigning fixed sizes to StreamConfiguration, Laurent pointed out that we should maintain pixel square before downscaling. Add 2/4 for that reason Finally 4/4 "fixes" generatation of RAW stream formats, by listing all supported sensor's resolutions, and only report them when the raw stream is requested (this is debatable). Tested on Pinephone Pro with imx258 camera. v3->v4: - Drop "Reserve main path for StillCapture" to continue prioritize the stream role order when assigning outputs - Add "Crop on ISP before downscaling" to address Laurent's comment on maintaining pixel square v2->v3: - Add review tags - Improve 3/4 as suggested by Paul v1->v2: - Enumerate StreamFormats for all the available size and not limited to the current output size. This allows to enumerate higher resolutions even if the desired role has a smaller resolution. In example: gst-launch-1.0 libcamerasrc camera-name="/base/i2c\@ff110000/camera\@1a" ! 'video/x-raw,format=NV12,width=4208,height=3120' ! glimagesink which used to fail now works correctly - Enumerate all the RAW sizes the sensor can produce but only if the requested role is StreamRole::Raw Jacopo Mondi (4): libcamera: rkisp1: Generate config using main path libcamera: rkisp1: Crop on ISP before downscaling libcamera: rkisp1: Assign sizes to roles libcamera: rkisp1: Fix enumeration of RAW formats src/libcamera/pipeline/rkisp1/rkisp1.cpp | 22 ++++++------ src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 34 ++++++++++++++++--- src/libcamera/pipeline/rkisp1/rkisp1_path.h | 1 + 3 files changed, 42 insertions(+), 15 deletions(-) --- 2.40.0