From patchwork Wed Jun 11 01:32:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 23517 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 40849BDE6B for ; Wed, 11 Jun 2025 01:33:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C5A9568DD4; Wed, 11 Jun 2025 03:33:35 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="a2vbkabs"; dkim-atps=neutral Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2F08E68DB2 for ; Wed, 11 Jun 2025 03:33:33 +0200 (CEST) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3a522224582so3747717f8f.3 for ; Tue, 10 Jun 2025 18:33:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749605612; x=1750210412; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JjePieBz4pX5XcPOXe5ZT860B9wWo/28zhPisqyyZdY=; b=a2vbkabs2PZVH9kjsGXB3Zy5KqSHDLHMVlYiXGv117ygxQ+RX5FcdJhR/2usRRakAt 8sJ0/7I02tvtOeyFUrxoIgZy8O+8lbr0bv0VE0/tLvPUC5I7Bu05jWkRFOhZZvaHmEG5 YPr6b8A2jj4wgrxrCDTeiqI0nT34KQ4RgQV792rEjTrPYKyngX7Hm0n45wHeoh6VNEwQ NFoVxyswDgxLVAp591ehGbo0r+dhRNPVyJb+3Q7G66NFRnhE4+frFVJLfmJ34+mB/hPB Y52O+0rCm2L1f6hVQ5dmjDfWYzGYQo6Dldhw5TQwW6VN6CXNHmVITWkWIXtgAU6IYS+v U+vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749605612; x=1750210412; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JjePieBz4pX5XcPOXe5ZT860B9wWo/28zhPisqyyZdY=; b=gNIsQsyH/T27M4fUDzZwv0QNJeRDgSw/y9X6MvcyDaXIs+OSdwlPob6nZrJZfNxZVG Q5p5tn9rqqwrBnVCWiNhJWp5XPWxcieHEn952OXhB+HmJjVKyN+pnxd93+Mx3phuT/1N Fd1kolpTvur5KDkDq+1LaWcf5ucNpo2CtZLSqfqCDLmVt7HRmEAJ9C6fFl2Wuqh0GaAC EIu6tNFJBLiyubsAN34sNseGjRdZPec6Yf7rGBmgWXhjcYl/gfsk3CmRpaBwRbrv4Uvj 3QhWQPcOXnmhhkvVDaERALISrdkM6s1c6tPZXQrrm7Mr0rj4ndWVZw+a4iscRVPa+nZU Mj1w== X-Gm-Message-State: AOJu0YxKL7IUyXr6GZTCuWIiWRWZaEvWXhjs/1eYcIV1HLhGH8sBSgR1 gZFT9Nr453XL0UV2+SUWKxEfd4bokpEAKAuyNuAYoC78BmvjM6CZwn54iOW5m30vH6sICBdUpaC HF0GtTFw= X-Gm-Gg: ASbGncuVSUYK/EMqLVQ/DKssBj1s3uSTYre/uPdNhC+NvYjwpJ4Jiazti4sL3rBAH1v dwmMenwAv2oTIcILDQHy3OGRPJjd9KSeN+uH31Ido/eZKUhTQdSFcaYxJcqIsHfYi+VkXYxzjHq 9w7yCWh19doI9mqNJyopFXz30D2+FWJu5HsmnhwXvykczfMjk9hkOnGq8fXfPDbQ4Ip3vItrzZ3 p1NipXSTDfd4ZFBZdATkghq+/sfZbcGfl951fCjIs8dMdtfOmyljtJBPz6Li1PHVemixvye4Ld8 hz9DxmOY9K16jeNEGH5uoIgvaJMQHfplqiFZ9xwFjQMy8C2hmKjNajOB84nrpx14qpAwY+tFxY0 Oj5gBs0AssOcURF1oTsrpN7i+HnYXmCnbXApvwMTU6g== X-Google-Smtp-Source: AGHT+IHCga1USqrL90WhvME1stAfaKs8vsA1Lh9cd7Emy1+37z8kfvzdg8QqGVlX5lNe8yeJl5J80Q== X-Received: by 2002:a5d:64e4:0:b0:3a5:39a0:2309 with SMTP id ffacd0b85a97d-3a5587ffd85mr812425f8f.55.1749605612500; Tue, 10 Jun 2025 18:33:32 -0700 (PDT) Received: from inspiron14p-linux.ht.home (188-141-3-146.dynamic.upc.ie. [188.141.3.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4532514138asm5680625e9.3.2025.06.10.18.33.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jun 2025 18:33:32 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: Bryan O'Donoghue Subject: [PATCH 11/35] libcamera: software_isp: Move isStandardBayerOrder to base class Date: Wed, 11 Jun 2025 02:32:21 +0100 Message-ID: <20250611013245.133785-12-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250611013245.133785-1-bryan.odonoghue@linaro.org> References: <20250611013245.133785-1-bryan.odonoghue@linaro.org> 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" isStandardBayerOrder is useful to both CPU and GPU debayer logic and reusable as-is for both. Move to shared location in base class. Signed-off-by: Bryan O'Donoghue --- src/libcamera/software_isp/debayer.cpp | 10 ++++++++++ src/libcamera/software_isp/debayer.h | 2 ++ src/libcamera/software_isp/debayer_cpu.cpp | 6 ------ src/libcamera/software_isp/debayer_cpu.h | 1 - 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp index 75e4bffa..d0e17d20 100644 --- a/src/libcamera/software_isp/debayer.cpp +++ b/src/libcamera/software_isp/debayer.cpp @@ -227,4 +227,14 @@ void Debayer::dmaSyncBegin(std::vector &dmaSyncers, FrameBuffer *inpu dmaSyncers.emplace_back(plane.fd, DmaSyncer::SyncType::Write); } +/** + * \fn void Debayer::isStandardBayerOrder(BayerFormat::Order order) + * \brief Common method to validate standard Bayer order + */ +bool Debayer::isStandardBayerOrder(BayerFormat::Order order) +{ + return order == BayerFormat::BGGR || order == BayerFormat::GBRG || + order == BayerFormat::GRBG || order == BayerFormat::RGGB; +} + } /* namespace libcamera */ diff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h index 0af66b55..214bcdd3 100644 --- a/src/libcamera/software_isp/debayer.h +++ b/src/libcamera/software_isp/debayer.h @@ -20,6 +20,7 @@ #include #include +#include "libcamera/internal/bayer_format.h" #include "libcamera/internal/dma_buf_allocator.h" #include "libcamera/internal/software_isp/benchmark.h" #include "libcamera/internal/software_isp/debayer_params.h" @@ -87,6 +88,7 @@ private: protected: void setParams(DebayerParams ¶ms); void dmaSyncBegin(std::vector &dmaSyncers, FrameBuffer *input, FrameBuffer *output); + bool isStandardBayerOrder(BayerFormat::Order order); }; } /* namespace libcamera */ diff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp index 4ef573a3..e5649284 100644 --- a/src/libcamera/software_isp/debayer_cpu.cpp +++ b/src/libcamera/software_isp/debayer_cpu.cpp @@ -282,12 +282,6 @@ void DebayerCpu::debayer10P_RGRG_BGR888(uint8_t *dst, const uint8_t *src[]) } } -static bool isStandardBayerOrder(BayerFormat::Order order) -{ - return order == BayerFormat::BGGR || order == BayerFormat::GBRG || - order == BayerFormat::GRBG || order == BayerFormat::RGGB; -} - /* * Setup the Debayer object according to the passed in parameters. * Return 0 on success, a negative errno value on failure diff --git a/src/libcamera/software_isp/debayer_cpu.h b/src/libcamera/software_isp/debayer_cpu.h index 0b4b16e1..a043a954 100644 --- a/src/libcamera/software_isp/debayer_cpu.h +++ b/src/libcamera/software_isp/debayer_cpu.h @@ -17,7 +17,6 @@ #include -#include "libcamera/internal/bayer_format.h" #include "libcamera/internal/software_isp/swstats_cpu.h" #include "debayer.h"