[{"id":36266,"web_url":"https://patchwork.libcamera.org/comment/36266/","msgid":"<176056592738.162040.16705430625467471095@ping.linuxembedded.co.uk>","date":"2025-10-15T22:05:27","subject":"Re: [PATCH v3 12/39] libcamera: software_isp: Move DMA Sync code to\n\tDebayer base class","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Bryan O'Donoghue (2025-10-15 02:22:24)\n> We can reuse the DMA Sync code in the GPUISP. Move the code we need to\n> the base class.\n> \n> Reviewed-by: Milan Zamazal <mzamazal@redhat.com>\n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> ---\n>  src/libcamera/software_isp/debayer.cpp     | 13 +++++++++++++\n>  src/libcamera/software_isp/debayer.h       |  2 ++\n>  src/libcamera/software_isp/debayer_cpu.cpp |  6 +-----\n>  3 files changed, 16 insertions(+), 5 deletions(-)\n> \n> diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\n> index cf74b92b..847067aa 100644\n> --- a/src/libcamera/software_isp/debayer.cpp\n> +++ b/src/libcamera/software_isp/debayer.cpp\n> @@ -214,4 +214,17 @@ void Debayer::setParams(DebayerParams &params)\n>         gammaLut_ = params.gammaLut;\n>  }\n>  \n> +/**\n> + * \\fn void Debayer::dmaSyncBegin(DebayerParams &params)\n\nThis doesn't match, but also I don't think you need to specify this\nline.\n\n> + * \\brief Common CPU/GPU Dma Sync Buffer begin\n\nPerhaps:\n\n * \\param[out] dmaSyncers The Sync Operators\n * \\param[in] input The input buffer\n * \\param[in] output The output buffer\n\nWith all that fixed:\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n> + */\n> +void Debayer::dmaSyncBegin(std::vector<DmaSyncer> &dmaSyncers, FrameBuffer *input, FrameBuffer *output)\n> +{\n> +       for (const FrameBuffer::Plane &plane : input->planes())\n> +               dmaSyncers.emplace_back(plane.fd, DmaSyncer::SyncType::Read);\n> +\n> +       for (const FrameBuffer::Plane &plane : output->planes())\n> +               dmaSyncers.emplace_back(plane.fd, DmaSyncer::SyncType::Write);\n> +}\n> +\n>  } /* namespace libcamera */\n> diff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h\n> index c04c289d..98d88fb3 100644\n> --- a/src/libcamera/software_isp/debayer.h\n> +++ b/src/libcamera/software_isp/debayer.h\n> @@ -20,6 +20,7 @@\n>  #include <libcamera/geometry.h>\n>  #include <libcamera/stream.h>\n>  \n> +#include \"libcamera/internal/dma_buf_allocator.h\"\n>  #include \"libcamera/internal/global_configuration.h\"\n>  #include \"libcamera/internal/software_isp/benchmark.h\"\n>  #include \"libcamera/internal/software_isp/debayer_params.h\"\n> @@ -96,6 +97,7 @@ private:\n>  \n>  protected:\n>         void setParams(DebayerParams &params);\n> +       void dmaSyncBegin(std::vector<DmaSyncer> &dmaSyncers, FrameBuffer *input, FrameBuffer *output);\n>  };\n>  \n>  } /* namespace libcamera */\n> diff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp\n> index 6be5cdbd..8f1b4e53 100644\n> --- a/src/libcamera/software_isp/debayer_cpu.cpp\n> +++ b/src/libcamera/software_isp/debayer_cpu.cpp\n> @@ -22,7 +22,6 @@\n>  #include <libcamera/formats.h>\n>  \n>  #include \"libcamera/internal/bayer_format.h\"\n> -#include \"libcamera/internal/dma_buf_allocator.h\"\n>  #include \"libcamera/internal/framebuffer.h\"\n>  #include \"libcamera/internal/global_configuration.h\"\n>  #include \"libcamera/internal/mapped_framebuffer.h\"\n> @@ -752,11 +751,8 @@ void DebayerCpu::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output\n>         bench_.startFrame();\n>  \n>         std::vector<DmaSyncer> dmaSyncers;\n> -       for (const FrameBuffer::Plane &plane : input->planes())\n> -               dmaSyncers.emplace_back(plane.fd, DmaSyncer::SyncType::Read);\n>  \n> -       for (const FrameBuffer::Plane &plane : output->planes())\n> -               dmaSyncers.emplace_back(plane.fd, DmaSyncer::SyncType::Write);\n> +       dmaSyncBegin(dmaSyncers, input, output);\n>  \n>         setParams(params);\n>  \n> -- \n> 2.51.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 6B413C3259\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Oct 2025 22:05:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 45BB86063A;\n\tThu, 16 Oct 2025 00:05:32 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B8EF5605F3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 16 Oct 2025 00:05:30 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 386F222A;\n\tThu, 16 Oct 2025 00:03:51 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"AhDVGPau\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1760565831;\n\tbh=p9eWit5ERTL1soDdeETTRKPUicCzTDPdqwwE4hbmwPY=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=AhDVGPauwPY63Mu2DDuxgBL7XUW43JJFkXsSh8cYKYK7J85sGCX75BgiK3LN6LTct\n\t4IJERL03K8r7M0UW3d7c3ypEG3bJaF4WK4S6+QNYg3Feq1xxOmubEDZ9n1w5SJBjXl\n\tJLHbB0518zcqTBNixSA2yqoC/vQ2natCGiw/cmv4=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251015012251.17508-13-bryan.odonoghue@linaro.org>","References":"<20251015012251.17508-1-bryan.odonoghue@linaro.org>\n\t<20251015012251.17508-13-bryan.odonoghue@linaro.org>","Subject":"Re: [PATCH v3 12/39] libcamera: software_isp: Move DMA Sync code to\n\tDebayer base class","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"hdegoede@redhat.com, mzamazal@redhat.com, bryan.odonoghue@linaro.org,\n\tbod.linux@nxsw.ie","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 15 Oct 2025 23:05:27 +0100","Message-ID":"<176056592738.162040.16705430625467471095@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]