From patchwork Mon Jul 24 09:59:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 18873 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 AB136BDC71 for ; Mon, 24 Jul 2023 09:59:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CD900628C3; Mon, 24 Jul 2023 11:59:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1690192781; bh=CMFgOTznWF7SeATeOSY7MIvsn1ok8/HwJlHdAqoC1Ys=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=JQ2XHzsdit6gtaM4HRbYojau8As6Wb9dbCaDVOifOQbkZLskamc/MhLzQ0H9oM9AZ XTkj/RLT/o5ZOzMFsc8Rb5LSbnOye34LfHwKLboF77ftjtbEYM1HhADfcWbqZYKYsC jwSiuDTHj9GqWT9hrV1bDa0zJrmr4zIPWFefo3eLZYaDeJ6dlF2BGpEJTduRXpEot1 J3Nu9yHLQiepjFFFqJSn7wEKsFC3ZPssV06rYm4oM3ewPqxY0e6imGAf9uCIFAwe// 606slHUvOVwnHxRx8rn/Kp6pkhOiykDeAsjITpZhgb5ujV6xNhW48TJLvfXgPzkIxE ko4clg3uzAkRQ== 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 63D8D60387 for ; Mon, 24 Jul 2023 11:59:38 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="KkUYOmjn"; dkim-atps=neutral Received: from uno.localdomain (mob-5-91-20-233.net.vodafone.it [5.91.20.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7A29C735; Mon, 24 Jul 2023 11:58:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1690192720; bh=CMFgOTznWF7SeATeOSY7MIvsn1ok8/HwJlHdAqoC1Ys=; h=From:To:Cc:Subject:Date:From; b=KkUYOmjncOBPyClU4nLsV+aZB37gfukJDLoDaolH+guQnEFEpxSoUEo4HroB/dttJ MB9qUu6E5C7TSHW66dge63ciPEy3hrB3e56TJCXDUPAMZH01YC2dY24awpXPuz79ir nuNZxkLAeJunK7HmavIB+RV4og98OiDpMO7yNtQc= To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Jul 2023 11:59:22 +0200 Message-Id: <20230724095925.20877-1-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 0/3] Raspberry Pi: Configuration simplifications 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 Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Naush, I have simplified a bit 2/3 and removed a few leftovers. If no objections I plan to push this soon, is it fine ? The overall diff between v2 and v3 is very minor, but 2/3 now looks more logical. Thanks j Jacopo Mondi (3): libcamera: rpi: pipeline_base: Remove populateSensorFormats() libcamera: rpi: pipeline_base: Move findBestFormat to CameraData libcamera: rpi: pipeline_base: Cache sensor format .../pipeline/rpi/common/pipeline_base.cpp | 182 +++++++++--------- .../pipeline/rpi/common/pipeline_base.h | 5 + 2 files changed, 91 insertions(+), 96 deletions(-) --- 2.40.1 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -207,7 +207,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate() std::sort(outStreams.begin(), outStreams.end(), [](auto &l, auto &r) { return l.cfg->size > r.cfg->size; }); - /* Do any platform specific fixups. */ + /* Compute the sensor configuration. */ unsigned int bitDepth = defaultRawBitDepth; if (!rawStreams.empty()) { BayerFormat bayerFormat = BayerFormat::fromPixelFormat(rawStreams[0].cfg->pixelFormat); @@ -218,6 +218,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate() : rawStreams[0].cfg->size, bitDepth); + /* Do any platform specific fixups. */ status = data_->platformValidate(rawStreams, outStreams); if (status == Invalid) return Invalid; @@ -227,9 +228,6 @@ CameraConfiguration::Status RPiCameraConfiguration::validate() StreamConfiguration &cfg = config_.at(raw.index); V4L2DeviceFormat rawFormat; - const PixelFormatInfo &info = PixelFormatInfo::info(cfg.pixelFormat); - bitDepth = info.isValid() ? info.bitsPerPixel : defaultRawBitDepth; - BayerFormat::Packing packing = BayerFormat::fromPixelFormat(cfg.pixelFormat).packing; rawFormat = PipelineHandlerBase::toV4L2DeviceFormat(raw.dev, sensorFormat_, packing);