From patchwork Thu Nov 20 23:20:09 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: 25113 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 F13F5C3330 for ; Thu, 20 Nov 2025 23:20:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A410860ABB; Fri, 21 Nov 2025 00:20:48 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="TxplIrwn"; dkim-atps=neutral Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7290060AA8 for ; Fri, 21 Nov 2025 00:20:46 +0100 (CET) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-42b3108f41fso884878f8f.3 for ; Thu, 20 Nov 2025 15:20:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1763680846; x=1764285646; 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=3KNxt7sun2ScTJ5zZqBzup1sCzFwl/1rNCfJO4h1TH8=; b=TxplIrwn/TiFgIlvgapq6Kk17FhjHHSmrbdLfm5SRsfvMdz/TLJENh1V3RoE0/RGvn MXhWsfO72ZH91tIrVoNo0HlWELFeFCioln/b9FIljXbYWzK41bf6X26XW4DJkXENoElJ JpAZwsDUIzNNS74kDVlHgzrYtqCvetDJitAi8M1OJU/vdT/UI9ncafexIQC4xsOnepUn oJSOR8BZOdtE3nylotYh/cW+Fex9/PxZwdLa4Yg8RO0yXM+jV/qz0s0oPP1iMXwUU9VP QJt+oIp5Dp93mR8H01AEf2Sg3XkdIV99PRrm6ytmvvS0qzFGRHCB2EBsbFcW1+Fzal/c fCOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763680846; x=1764285646; 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=3KNxt7sun2ScTJ5zZqBzup1sCzFwl/1rNCfJO4h1TH8=; b=NnzcfTjb1b2nGf15miEeulkAkFaxXEjo0+oolDZMepiN9k9uE4wVzlfbbwmbSqEQtc yDVstdvkErYWdqDY3zmOAmHVsgVmkwBGxvfnnWYdH1SVmsFtxrQMgsrV9jRySA6ifLGt 8M+MyCgN5B4RkLuezqhLW7P4/52uCSXRiZve2OoSeq29XbmmX5lPXQoZ41C93DL6fN8C M4WB8+UBEC+RChoZ8SkTbONBdadbF4CnJYlDQKvBYWVq8FywkfZ9xaFbj9ulIv/KoNQt pJxrBuxH9Bj2dDM8tJ77EjGjwx+tltPzfomNBPyjFaLONu3pC8Az2bHWZsqjEVYnkP+g 9jjQ== X-Gm-Message-State: AOJu0Yzp6T/CUR658bOkU1LJAG/733z4EehyAHWC3cJ5JRN5dw8TaaQb tDE2GsopgbCi/FWxFIU0OGY/S2FVuiEygEK1poWCSBG9ylNpLRh0odivmdHBAXy0k01DHSvmWEk Wx9lskEg= X-Gm-Gg: ASbGnctMjtImxO8mVK06MtMnKVByZ3INleQRdhFhtX+hC7QBh6z5KUEMW/OO17gcU/p 5b3z7GnwVGRClvSYlzfXMDnPPhC5uOm2UoSGOuaINGAPeiPayNlwVhfvq+q8G/1cxCUuaiO3nri 9d36f8wi+R1tyDHaoV8G/DJTyljkNFI33aEdatblWo1yZr4AskaaRV3VwMADrzZfl6crhYg/fSj b9Pne4W/JJ4DqUy3NKyChQPQPbMdlBgbeh/dDRCZW1KzXrM/0WUuQ6azQVrTSO2zYd0Ujs5lHyQ WseYQFQ1yx1IlUe2iUgF6rlGUGWVpE77MPQd5tp6CTcbNWXt/u5peRpG/EOfRcqXDuOttI6cvkU nUMyIsyJjJwSVxym9CdXapYBYayKCWv86qTUfCkZsISvOSv/pIGNKbvP/9wf3FO0UkjhzGCiydt oBixg7kXOyuLrG8snBotAIFc+2roS2ra2dd3Epe4fYQGVlL9e44hjOV8Skg6J8GDzmHeuvDvyX7 4iUDw== X-Google-Smtp-Source: AGHT+IEMYk/DzaHQP8V2b5WyW49AXlrJ9oDC2fIKgWUv7cN9ImUR+AqG/usqkp8FulD3KCFTzsPLSw== X-Received: by 2002:a05:6000:2281:b0:42b:2e1c:6341 with SMTP id ffacd0b85a97d-42cc1abe28bmr86173f8f.9.1763680845742; Thu, 20 Nov 2025 15:20:45 -0800 (PST) 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-477bf3af0ecsm11618415e9.9.2025.11.20.15.20.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Nov 2025 15:20:45 -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 12/22] libcamera: software_isp: Move DMA Sync code to Debayer base class Date: Thu, 20 Nov 2025 23:20:09 +0000 Message-ID: <20251120232019.3590-13-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251120232019.3590-1-bryan.odonoghue@linaro.org> References: <20251120232019.3590-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 af40f5107..795c68af7 100644 --- a/src/libcamera/software_isp/debayer.cpp +++ b/src/libcamera/software_isp/debayer.cpp @@ -221,4 +221,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 0b5e11abd..334211215 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" @@ -114,6 +115,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);