From patchwork Tue Dec 2 13:31:43 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: 25298 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 93321BD80A for ; Tue, 2 Dec 2025 13:32:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1648B60D23; Tue, 2 Dec 2025 14:32:26 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Qg7Xczmw"; dkim-atps=neutral Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2C62460D14 for ; Tue, 2 Dec 2025 14:32:15 +0100 (CET) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-42e33956e76so1121408f8f.3 for ; Tue, 02 Dec 2025 05:32:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764682334; x=1765287134; 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=Qg7XczmwuM05CSUxUqjJLsahc/dlJRRAXCsYTScOgGSZ+9LmTAHbRrDxvDvo1i7jEM 8Z+8evIfCGgy3OfqWjq4SKlzdK82BgA0zIoTD9oBa0zlpKzbzF+m1v4rpYxrLpwQlOWa +LFh2f8bi3BEr6TLKyVCbL867kCYENkWM1avRNsSWFT2CC2LmKJ113orhEkM23xtijCX rGIxr17gF2iKmfkmt97eMLC3Ksim7+bb9bpt/4UHjrIverOAVoysNjo8lxRUj6Lbmswk WrQSMK2k/l+BHUAwtQ0rYWcrpX3h9wl6afoH7/ySqq0XkaSj3K++3WlDruRAblgkas4y j6Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764682334; x=1765287134; 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=O6hvwxDS+ddojk8mjj5tpX3ZpAz+5YD4HnrgnuLKNtL0EGRmQ2QVwffM3YOdIiY+7Z ZtTwYApdnBr2m90f5DpeqPca1SE5ZKh+11qbyQXoR0buLNy8zO2BRw5sQB0RCtweeoVV y6xZiwrPaDnCwkVwu/Z6I1i7kc7G7SQ093lGjlI5Z6FH42LE+zB2ZxhHuAynB4ohFUAs Swm1cC2/5qrui9Z79KwzIF3MAjmlULOvIGAfnwHIyD0kbHVzPi8CMcGkYw2QJ+XD/wnB qexrpF3LSG6nKbAzMzAt7KhbQqY0snBDJCGZInPFZZpDHheSZr+YiNtWJNLCFstJI/zT n1pQ== X-Gm-Message-State: AOJu0YyYqNw4o3kCzIEf7CLylrGrR7PqBbKa3VO3+Lch7D2nhb6E0UPd MPNe/V94r5Ha6E4R3IPitcF6bS9K56g4rpiVDcf7qq2Sasv24CCYkzz25pdrtSdsU1AZTTAIAnm qF3Nu X-Gm-Gg: ASbGncsWgJPHBORS8fQF6TRxRdhvy/o/ZcVWbkicimiwzy2YFNuL02RDVe0pDTqYeEE xV9+qfzepaUcz+WCh0Oq8ocNWlEGJAT60oQ/j7ybq26IvU0Ydf8lkoG40VKzshoKP3OkQsMsJvb mSVd4JD4JMdEpIsm6mFuysYc4EClX2wqtBRXJq+buQmzNGi3Usbrmu9igS/AGEZCSf3tHyVtjQB 6RH1HKnHJWwrEeWj48gs3+c86LS3N4vpRvchhVotGs4OPslzrvmwhA4mnVailLKECGcQuJRWRNe JVvS5Q2sIyr51u0YLX1J26zfkAgoVYw8ZaOQ9ouEPDlYg1iJmGd+XKWSskfUodlgijJnYeRWaWs riuW5AQjKxLS0qpVti+cxv5AKLjnzoq2X7JYSNB4OasN7XujltjbLNqBqjK/ul0mlEP4ELPDjBv CRWxZLYtpI5tsRz47ZWJlLZ8RJopPdPeQyvvo472TQ0jXgIev4doSK55+dTaK3bPlNgFk= X-Google-Smtp-Source: AGHT+IFelnZN6DqrBF1bCehBrJ+WoHesdp+6IiCB0RsJv2KHboHSG5Q+BLe4lMFu0KWAC/a9McDqWQ== X-Received: by 2002:a05:6000:2013:b0:3ec:de3c:c56 with SMTP id ffacd0b85a97d-42cc1acce0emr45239021f8f.16.1764682334427; Tue, 02 Dec 2025 05:32:14 -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 ffacd0b85a97d-42e1c5c30c4sm33363322f8f.9.2025.12.02.05.32.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Dec 2025 05:32:14 -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 v3 12/22] libcamera: software_isp: Move DMA Sync code to Debayer base class Date: Tue, 2 Dec 2025 13:31:43 +0000 Message-ID: <20251202133157.661407-13-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251202133157.661407-1-bryan.odonoghue@linaro.org> References: <20251202133157.661407-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);