From patchwork Wed Dec 10 00:31:29 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: 25408 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 D6B8EBD1F1 for ; Wed, 10 Dec 2025 00:32:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8C3C361459; Wed, 10 Dec 2025 01:32:30 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="rXhmr9tf"; dkim-atps=neutral Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 405BE61463 for ; Wed, 10 Dec 2025 01:32:29 +0100 (CET) Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-349bb6f9c86so4125317a91.0 for ; Tue, 09 Dec 2025 16:32:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765326748; x=1765931548; 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=rXhmr9tf8E/pSsHfJ3Id7S0EGWWtp4txxgBQIRy6o/h1wBIQXI0KNeQ5Txlzz/Muc/ NtvtBG50fYFqjuh0aItONmtry6hSRHXHJCw5cp5JIqadfB39Xl6+CjNkmOD16wtC0v4y zaui12ymTdWJDrFvMVF95+/A+uqaSE77ULhg1MTXWosILIXGbngGfRoZbADAecpZYb+T niKyEeMwkHboo4dgMP2732LJonNyWBrHDR4zvMfD8A9fWUvgeXRQeK6yOL+TfmkHOEZs /+JTI+Hc6OtzMv53gDfHk8XPkWHNXY1V+De3oSdbEIamL8Lr8KYWqjINDVVGDa63SBhF +neQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765326748; x=1765931548; 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=HQ7bpjahrR1Qlypa3wC6R2SeW0S6u1KO9DOjkeOREYWIngK9X6QjprGzLdTbOrRacu 2Nve1AcmnjzCJYw0qC/LIkhnzUeVIfDJP//m+RJMAbxWt6ZH8CGE4jlIbH97ehNYIsF1 6ryhh0+Q2n1datwvHSrrYBGDC0jwChPXMW+jJG0gMtlQ5XppD/nc4naLetxKyWR9lqsD lPLJGc19ym9dvlqHFQx10+YmtTVZ3bpOkf/NHLdfmvyB0CJrkC6PawZOHRK6hA1KdRvr krfHomUNR4y5iw3ovw/2GcUMfAa3rF4s82EPKCVDMnHNtmOa7gy3BLQ2zxYy7OD8HKjl pnHg== X-Gm-Message-State: AOJu0Yyq7rTPM6tUiWWD5sXGaU5sF9SjvGymXtdNpGzp4YUvUMiUh1bv yTBc6cFYvZ6+I38ItBNWfEcYghdh9SQLVxi2xrIaAKUizuI5i8ynlxoPXfSn6A1FgOq/1/DBNMs +IlRc X-Gm-Gg: AY/fxX7fjLAsFUpREhiIoqubR5/JC/ac9530JSYemgWE7HRocZXEcqns0DJ0twIE2Uf QmXRe88MkreQ6Jw3mhzHMBleD/AkSI3BZdYFVWCkWhjZ6hSiOpCQyVVYfTilTJHuai+kPbPvWkL y7P1pwpl878SPbqjqjJj9mDAuVW2lVKsV7t6pzEOR+G++85TrEkkoh4/krQVVQWYLp1g3o4YOfK 6gDRCcxJAEYMm2JwZsuWVBpbEbgV8xiDXXq49JIRBlU7KmzvTjcWcQCgx/46+aYEJoBFqvRV0zY Pmj4vYLPp2H5avNYbvwcDhyeS6I0yJDxUGU8OzX3xIvkUnV3MyCeP6qjQmZi5OmMTzWp2UuWgvf 64rEKmNupSit8XIf30YtbvFnGcBoAWgP+ndNBCbhIe6LdRlgw7S2P6qgAaV762rE3bNrX9z9QXK qsr4Jc49ocdsdP/2MttASRcHqFWf8FcF7gYhwRh/EQdPLbVczQM818S3kLtORCihy7 X-Google-Smtp-Source: AGHT+IFBSZuem/9P6oNQJf4PI2elXEXmtwkEiTH8ZciZrQ6B2JM+JcIMw4ldJGcOf7/DgKktLs2ytQ== X-Received: by 2002:a17:90b:3d06:b0:33b:ba55:f5eb with SMTP id 98e67ed59e1d1-34a727ee9eamr540281a91.1.1765326747648; Tue, 09 Dec 2025 16:32:27 -0800 (PST) Received: from inspiron14p-linux (p96936b06.osaknt01.ap.so-net.ne.jp. [150.147.107.6]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-34a70427ea6sm566580a91.3.2025.12.09.16.32.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Dec 2025 16:32:27 -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 v4 12/20] libcamera: software_isp: Move DMA Sync code to Debayer base class Date: Wed, 10 Dec 2025 00:31:29 +0000 Message-ID: <20251210003139.43606-13-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251210003139.43606-1-bryan.odonoghue@linaro.org> References: <20251210003139.43606-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);