From patchwork Thu Dec 11 23:22:37 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: 25506 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 E6270C3257 for ; Thu, 11 Dec 2025 23:23:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9C1A961657; Fri, 12 Dec 2025 00:23:56 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="arqnvWFg"; dkim-atps=neutral Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0463E6161F for ; Fri, 12 Dec 2025 00:23:55 +0100 (CET) Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-7aae5f2633dso650162b3a.3 for ; Thu, 11 Dec 2025 15:23:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765495433; x=1766100233; 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=Bh1xFO5NOzK/gF5i4+/9KWqgioiivN0r41v6p9dQA20=; b=arqnvWFghaomREy7RMeMwEcLiwoVe3TiQNxLjXQZfbOc4cx/TO4WaYJIppVah6ogbQ m/sQNDZATqI8ZVnACJauFpbyVFWmsY4lLkSLhDVzogogSLwLYf06/+40TV6C1zUKWnPN hTh2unPu/0AGdLyWQjiwojQsSOwUxRQXQ5KTGUXW2Znxqwq13j2Sf8UOTRR4VfyPpOn1 Vjd6kvpLw3WVbkplSbhAtuLvQSxtH+ECWypHcu+fyEUrIb+YwRUU56cYromTSoi7j9lV NXm230E7UTfF57JBENqz76XPc7P4xB1ROd2Wltqrb70VTf1Vvtb6E4ua9sAO8UYPmLmb 2m0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765495433; x=1766100233; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Bh1xFO5NOzK/gF5i4+/9KWqgioiivN0r41v6p9dQA20=; b=BVNb3lBnOGwcaxTt0hmIgWSjcYvnBTlebaaxvB5y8Us6LLDBMXKzEacMTt6NlbDIGs rQxvI2dhXuXACenQwSh/6SCsVohz+Q3bozKHtDxq9HO8DnbZT846iwNawN50fDAtN2Za 3liUqk8WOrquk78OLk4GPwF1HsS90nH0DPMMyjKRmkdz5LCxOBH2dCFVUrwUR1K9OTNm f90R4MdBxNAH2VfafQC48D4PjeQHPjSiqlHH04kqKjHita+vVZW/h30f1qqqPyCH6S6K r8xBql8O60GdKMjQAj4pbAvmTAN/+2US+LHevjqO58vh9ALZ74527LDY7UdJrHis+cxs /6Zg== X-Gm-Message-State: AOJu0YzJhJpfSd+m7PyTN4J3RDE0HtWnGGgQ0pi783yO3juG+edN6XK5 rqMX22CLFR3qQ6A2e8XAGH9bvka4snPEgI9WGmiC2UHhgC7HdYBgYukN7VL016AQVcnS9/dQUsk 5+QmS X-Gm-Gg: AY/fxX5HgDYp0zTeFikmxIBCwTFOafAxVxlP/O5vGAv6M5BAI6bQ0yJ4uDJ/n+t7gfQ W0z2iFqrYMILn7tUIMFYWPZJ7PnjIUKBPWXNIsDsGT44I3qfmFB+WLQ5IwUYDBWbgDgMl5NWCBp HpD69YnQbbtqRGLqO4kdxsi9gaVJxBT+kurMmU3xuk9YwSy76zvxCx6/W2d5Hus31H0wV/+E5HM Gs+klIZVAvu/kIhVpLvYNxlgEZ8xRRpyWq78vEF6+xvo8WPXty1nt5nSG+Nj/kBfaLG1cGBWcGv 6bByt4nsTdYSGzdDcsdqugfR9snQwMEqI/H2PnSQLRjgohJ23ze6TP0/xvOD0/VzakO+4vsCZu6 mlke3ikE1nqWQXLwHupCI2A2NEpB0ZsdIHngnbujvk27l8yaw/TW61n8hZHG0fhMliFLLRFk6iE F7wcPEPtVS43dcPY9ZI7eur2s8vHjt6vY0f4W/DC+9aboNRqwidz9ma6n1gorzuA== X-Google-Smtp-Source: AGHT+IGvneHnhLXx596/tqyjM6fgI+db4l9CJ5WYRhMZZNJfZNN75JWqZcgcVFlFC3hzUgrKnv8sRw== X-Received: by 2002:a05:6a00:4108:b0:7bf:1a4b:1675 with SMTP id d2e1a72fcca58-7f66fde0b3cmr150029b3a.28.1765495433389; Thu, 11 Dec 2025 15:23:53 -0800 (PST) Received: from inspiron14p-linux (M106185144161.v4.enabler.ne.jp. [106.185.144.161]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7f4c4ab52aasm3399933b3a.38.2025.12.11.15.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Dec 2025 15:23:53 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue , Milan Zamazal , Kieran Bingham Subject: [PATCH v5 12/20] libcamera: software_isp: Move DMA Sync code to Debayer base class Date: Thu, 11 Dec 2025 23:22:37 +0000 Message-ID: <20251211232246.31330-13-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251211232246.31330-1-bryan.odonoghue@linaro.org> References: <20251211232246.31330-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" We can reuse the DMA Sync code in the GPUISP. Move the code we need to the base class. Reviewed-by: Milan Zamazal Reviewed-by: Kieran Bingham Signed-off-by: Bryan O'Donoghue --- src/libcamera/software_isp/debayer.cpp | 13 +++++++++++++ src/libcamera/software_isp/debayer.h | 2 ++ src/libcamera/software_isp/debayer_cpu.cpp | 6 +----- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp index cea30af67..544921656 100644 --- a/src/libcamera/software_isp/debayer.cpp +++ b/src/libcamera/software_isp/debayer.cpp @@ -364,4 +364,17 @@ void Debayer::setParams(DebayerParams ¶ms) gammaLut_ = params.gammaLut; } +/** + * \fn void Debayer::dmaSyncBegin(DebayerParams ¶ms) + * \brief Common CPU/GPU Dma Sync Buffer begin + */ +void Debayer::dmaSyncBegin(std::vector &dmaSyncers, FrameBuffer *input, FrameBuffer *output) +{ + for (const FrameBuffer::Plane &plane : input->planes()) + dmaSyncers.emplace_back(plane.fd, DmaSyncer::SyncType::Read); + + for (const FrameBuffer::Plane &plane : output->planes()) + dmaSyncers.emplace_back(plane.fd, DmaSyncer::SyncType::Write); +} + } /* namespace libcamera */ diff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h index 6903caae8..d2893d81b 100644 --- a/src/libcamera/software_isp/debayer.h +++ b/src/libcamera/software_isp/debayer.h @@ -20,6 +20,7 @@ #include #include +#include "libcamera/internal/dma_buf_allocator.h" #include "libcamera/internal/global_configuration.h" #include "libcamera/internal/software_isp/benchmark.h" #include "libcamera/internal/software_isp/debayer_params.h" @@ -86,6 +87,7 @@ private: protected: void setParams(DebayerParams ¶ms); + void dmaSyncBegin(std::vector &dmaSyncers, FrameBuffer *input, FrameBuffer *output); }; } /* namespace libcamera */ diff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp index 6be5cdbd5..8f1b4e53d 100644 --- a/src/libcamera/software_isp/debayer_cpu.cpp +++ b/src/libcamera/software_isp/debayer_cpu.cpp @@ -22,7 +22,6 @@ #include #include "libcamera/internal/bayer_format.h" -#include "libcamera/internal/dma_buf_allocator.h" #include "libcamera/internal/framebuffer.h" #include "libcamera/internal/global_configuration.h" #include "libcamera/internal/mapped_framebuffer.h" @@ -752,11 +751,8 @@ void DebayerCpu::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output bench_.startFrame(); std::vector dmaSyncers; - for (const FrameBuffer::Plane &plane : input->planes()) - dmaSyncers.emplace_back(plane.fd, DmaSyncer::SyncType::Read); - for (const FrameBuffer::Plane &plane : output->planes()) - dmaSyncers.emplace_back(plane.fd, DmaSyncer::SyncType::Write); + dmaSyncBegin(dmaSyncers, input, output); setParams(params);