From patchwork Thu Jul 27 13:01:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18893 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 BC4F5BDC71 for ; Thu, 27 Jul 2023 13:01:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D3411628C0; Thu, 27 Jul 2023 15:01:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1690462883; bh=mOBFsBuv/ro9BnxTiXibgI+nmpIJgoAJ8N1vQ85jMx8=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=YBg2Q9sp0a6Gktr/sALY/hMWZd+Ib5S/3Fy3Fk+RXK455+cB3BY6y8ZD/npbq7WDl yDXPX8SW6ELBFsY27KMiR/Y3GsCvyxSP/l1AJFxV0w7fz5T3ZLRilF3l3RSixzANE+ xP90xuzqBhMFDlkDtrwgC6yVzY6oNXileaaiNpNJb+VAkQk6pMfVG60s1LMLAsS37T 0rdI+KQsX12FVpyUDmBLQcDoytTPLc7szUB9XzF/b8/+7AUN4HBn1h10rNhu4Il62F PDNbs7JY8/GIw1ZMdCicuXOf80fn9OH7OXvddrCewTVQEcafjTYo2mzAzg5wem54N9 r6mxdGFotMfjQ== Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0F3F2600F7 for ; Thu, 27 Jul 2023 15:01:22 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="dfcX3lXf"; dkim-atps=neutral Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fbc1218262so9996675e9.3 for ; Thu, 27 Jul 2023 06:01:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1690462881; x=1691067681; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=JZVsvWZ6uiCBTKHtbjuBJ2/nfVoM/SqLdcpH2mdqm/k=; b=dfcX3lXfju1/gfvupDGu9urYTimeDchge39onI6RE0ySLs/5t9yXIVkZskYHNSdxD1 0GmDfSgf164UF958EnrqiJQSvNGLrAUjuk2bxk2j++RPioIZZw7UrjnegH21VquM4nMN bMBbxRw82wkr1DYQ9Cfe46UR9vpMqh2PsOTFKbyQWODwYSowfMjR63I+owN2SRXv423c As1OkCe5An2TR/AjqZfTqprv1ilRZcgcEn3sBp+ZLDrYV89cKBlE9E8alw2IrYc1YkX9 LrvvNufYTd96OVeYpOMPvw5T93lnAsn5CY4SMJZ1BrRQFFsKGhiptZHIMVAsEhYrR8SU CRpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690462881; x=1691067681; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JZVsvWZ6uiCBTKHtbjuBJ2/nfVoM/SqLdcpH2mdqm/k=; b=X8pxcQysrPTebC8XUsF1354m4FxTMYQIkj1vscoBQoyAADvsLRwA+vF5aSELUIN7S9 jYNByxbExsHiead66AbvaU0Vx3F2eH5L1KXj2wHzVO14v3bgnot/oduY0I2XpToMVx9f nsstTlRmViQvv8odFzMXfCrg1/C67wACVo6qqoW3EoMmhcf7pFzLvl26UC6oXTLZLlRI 7Y5Zm2r6Oc37u1JgqQHtRa1+F3Br9wL7FggukSXkRaZTVfU94zyD3kSgPQT9Zy/3ZzG3 Gog3eXG7ViTpJtiDUGaO3cCW5O+BfI3v38V0SpbTs3c/we6SFZvuGdNvZhQFgtcuOWwK xRuw== X-Gm-Message-State: ABy/qLYptRhED12jcmGGh2gfGiB6GM59g+hfUdftocHdPW7/OrEHaX23 nFaDU4Sznm/j5zM5/G8Ol4Qzmw2ak8c/kCbVrkMdKA== X-Google-Smtp-Source: APBJJlF52soRVv6BJpn6lak3efcK2oaeUdocyYqUjCCLFxnTLPFO/7yrzJXHaXx2TX2TQ+Fl+bEw/Q== X-Received: by 2002:a7b:c4c5:0:b0:3f9:c04:e76c with SMTP id g5-20020a7bc4c5000000b003f90c04e76cmr1653887wmk.28.1690462881269; Thu, 27 Jul 2023 06:01:21 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id f14-20020a7bcd0e000000b003fba94c9e18sm1819289wmj.4.2023.07.27.06.01.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 06:01:20 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Jul 2023 14:01:07 +0100 Message-Id: <20230727130107.20891-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] pipeline: rpi: Don't call toV4L2DeviceFormat() from validate() 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: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Cc: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Don't make an unnecessary call to toV4L2DeviceFormat() from validate() to get a V4L2DeviceFormat. Instead, the conversion can happen directly from the RAW stream PixelFormat. Signed-off-by: Naushir Patuck Reviewed-by: Jacopo Mondi --- src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index e0fbeec37fe9..97acafbbb728 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -226,10 +226,11 @@ CameraConfiguration::Status RPiCameraConfiguration::validate() /* Further fixups on the RAW streams. */ for (auto &raw : rawStreams) { StreamConfiguration &cfg = config_.at(raw.index); - V4L2DeviceFormat rawFormat; - BayerFormat::Packing packing = BayerFormat::fromPixelFormat(cfg.pixelFormat).packing; - rawFormat = PipelineHandlerBase::toV4L2DeviceFormat(raw.dev, sensorFormat_, packing); + V4L2DeviceFormat rawFormat; + rawFormat.fourcc = raw.dev->toV4L2PixelFormat(cfg.pixelFormat); + rawFormat.size = cfg.size; + rawFormat.colorSpace = cfg.colorSpace; int ret = raw.dev->tryFormat(&rawFormat); if (ret)