[{"id":38708,"web_url":"https://patchwork.libcamera.org/comment/38708/","msgid":"<11d363fd-3c09-4d67-96be-24eae332133f@ideasonboard.com>","date":"2026-05-04T09:45:17","subject":"Re: [PATCH 2/3] debayer_egl: Implement dmabuf import for input\n\tbuffers","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 05. 03. 13:40 keltezéssel, Robert Mader írta:\n> In many cases we can import the GPU-ISP input buffers, dmabufs from v4l2,\n> directly into EGL instead of mapping and uploading - i.e. copying - them.\n> \n> Doing so can have positive effects in multiple areas, including reducing\n> memory bandwidth and CPU usage, as well as avoiding expensive dmabuf syncs\n> and syscalls.\n> \n> The main reason direct imports may not work are the more demanding stride\n> alignment requirements many GPUs have - often 128 or 256 bytes - compared\n> to ISPs - apparently often closer to 32 bytes.\n> \n> Thus we first try to import buffers directly and - if that fails - fall back\n> to the previous upload path. Failing imports should come at low cost as\n> drivers know the limitations and can bail out early, without causing\n> additional IO or context switches.\n> \n> In the future we might be able to request buffers with a matching stride\n> from v4l2 drivers in many cases, making direct import the norm instead\n> of a hit-or-miss. An optional kernel API for that exists, but doesn't\n> seem to be implemented by any driver tested so far.\n> \n> While on it, add some minor code adjustments to make it easier to\n> follow.\n> \n> Signed-off-by: Robert Mader <robert.mader@collabora.com>\n> ---\n>   src/libcamera/software_isp/debayer_egl.cpp | 28 ++++++++++++----------\n>   src/libcamera/software_isp/debayer_egl.h   |  2 +-\n>   2 files changed, 17 insertions(+), 13 deletions(-)\n> \n> diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp\n> index 8f0c229fd..624469947 100644\n> --- a/src/libcamera/software_isp/debayer_egl.cpp\n> +++ b/src/libcamera/software_isp/debayer_egl.cpp\n> @@ -495,16 +495,26 @@ void DebayerEGL::setShaderVariableValues(const DebayerParams &params)\n>   \treturn;\n>   }\n>   \n> -int DebayerEGL::debayerGPU(MappedFrameBuffer &in, int out_fd, const DebayerParams &params)\n> +int DebayerEGL::debayerGPU(FrameBuffer *input, FrameBuffer *output, std::vector<DmaSyncer> &dmaSyncers, const DebayerParams &params)\n>   {\n>   \t/* eGL context switch */\n>   \tegl_.makeCurrent();\n>   \n>   \t/* Create a standard texture input */\n> -\tegl_.createTexture2D(*eglImageBayerIn_, glFormat_, inputConfig_.stride / bytesPerPixel_, height_, in.planes()[0].data());\n> +\tif (egl_.createInputDMABufTexture2D(*eglImageBayerIn_, glFormat_, inputConfig_.stride / bytesPerPixel_, height_, input->planes()[0].fd.get()) != 0) {\n> +\t\tLOG(Debayer, Debug) << \"Importing input buffer with DMABuf import failed, falling back to upload\";\n> +\n> +\t\tdmaSyncBegin(dmaSyncers, input, nullptr);\n> +\t\tMappedFrameBuffer in(input, MappedFrameBuffer::MapFlag::Read);\n> +\t\tif (!in.isValid()) {\n> +\t\t\tLOG(Debayer, Error) << \"mmap-ing buffer(s) failed\";\n> +\t\t\treturn -ENODEV;\n> +\t\t}\n> +\t\tegl_.createTexture2D(*eglImageBayerIn_, glFormat_, inputConfig_.stride / bytesPerPixel_, height_, in.planes()[0].data());\n> +\t}\n>   \n>   \t/* Generate the output render framebuffer as render to texture */\n> -\tegl_.createOutputDMABufTexture2D(*eglImageBayerOut_, out_fd);\n> +\tegl_.createOutputDMABufTexture2D(*eglImageBayerOut_, output->planes()[0].fd.get());\n>   \n>   \tsetShaderVariableValues(params);\n>   \tglViewport(0, 0, width_, height_);\n> @@ -528,21 +538,13 @@ void DebayerEGL::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output\n>   \n>   \tstd::vector<DmaSyncer> dmaSyncers;\n>   \n> -\tdmaSyncBegin(dmaSyncers, input, nullptr);\n> -\n>   \t/* Copy metadata from the input buffer */\n>   \tFrameMetadata &metadata = output->_d()->metadata();\n>   \tmetadata.status = input->metadata().status;\n>   \tmetadata.sequence = input->metadata().sequence;\n>   \tmetadata.timestamp = input->metadata().timestamp;\n>   \n> -\tMappedFrameBuffer in(input, MappedFrameBuffer::MapFlag::Read);\n> -\tif (!in.isValid()) {\n> -\t\tLOG(Debayer, Error) << \"mmap-ing buffer(s) failed\";\n> -\t\tgoto error;\n> -\t}\n> -\n> -\tif (debayerGPU(in, output->planes()[0].fd.get(), params)) {\n> +\tif (debayerGPU(input, output, dmaSyncers, params)) {\n>   \t\tLOG(Debayer, Error) << \"debayerGPU failed\";\n>   \t\tgoto error;\n>   \t}\n> @@ -552,6 +554,8 @@ void DebayerEGL::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output\n>   \tmetadata.planes()[0].bytesused = output->planes()[0].length;\n>   \n>   \t/* Calculate stats for the whole frame */\n> +\tif (dmaSyncers.empty() && (frame % SwStatsCpu::kStatPerNumFrames) == 0)\n\nMaybe there should be a dedicated method in `SwStatsCpu` that decides when to skip a frame.\n\n\n> +\t    dmaSyncBegin(dmaSyncers, input, nullptr);\n\nThis means the same fd can be in `dmaSyncers` multiple times. That means there might\nbe SYNC_START -> SYNC_START -> SYNC_END -> SYNC_END. Is this allowed by the kernel?\nDoes it handle it as expected?\n\nBut in any case, I think there should just be an `std::optional<DmaSyncer> inputPlane0Syncer`,\nwhich is populated accordingly in the slow path and (if needed) before statistics.\n\n\n>   \tstats_->processFrame(frame, 0, input);\n\nMaybe I'm missing why it wasn't like that in the first place, but I think this\nfunction should take either a `const MappedFrameBuffer&` or just the data pointer.\nIt seems entirely unnecessary to map it again there as well. Although that will now\nhave less of an effect with this fast path.\n\n\n>   \tdmaSyncers.clear();\n>   \n> diff --git a/src/libcamera/software_isp/debayer_egl.h b/src/libcamera/software_isp/debayer_egl.h\n> index fcd281f4c..62cb4f7f1 100644\n> --- a/src/libcamera/software_isp/debayer_egl.h\n> +++ b/src/libcamera/software_isp/debayer_egl.h\n> @@ -66,7 +66,7 @@ private:\n>   \tint initBayerShaders(PixelFormat inputFormat, PixelFormat outputFormat);\n>   \tint getShaderVariableLocations();\n>   \tvoid setShaderVariableValues(const DebayerParams &params);\n> -\tint debayerGPU(MappedFrameBuffer &in, int out_fd, const DebayerParams &params);\n> +\tint debayerGPU(FrameBuffer *input, FrameBuffer *output, std::vector<DmaSyncer> &dmaSyncers, const DebayerParams &params);\n>   \n>   \t/* Shader program identifiers */\n>   \tGLuint vertexShaderId_ = 0;","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 EA288BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 May 2026 09:45:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B713C6301A;\n\tMon,  4 May 2026 11:45:22 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E9D7E6271A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 May 2026 11:45:21 +0200 (CEST)","from [192.168.33.78] (185.221.140.217.nat.pool.zt.hu\n\t[185.221.140.217])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0A7B79C;\n\tMon,  4 May 2026 11:45:20 +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=\"RviB8vhE\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1777887920;\n\tbh=zR6YCctfwPN4YQsw852LtqSrEE247jqYnxy83HSEH0M=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=RviB8vhE+AAgw8Ox2sXvRmfZQFSCRCzxbm6B5lpVlUJmXWQL+iTjV5ubO53XVjJ0V\n\tTBIPnFyng78edagUa3WEwAU535Ju6kS7T7fAleASJvC7gEZXtxBFL4cmH+GlM4hLDU\n\tAHuwVuHYkj/t7QR/NnTfpSQft2YSL+NFOnTdmbbY=","Message-ID":"<11d363fd-3c09-4d67-96be-24eae332133f@ideasonboard.com>","Date":"Mon, 4 May 2026 11:45:17 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 2/3] debayer_egl: Implement dmabuf import for input\n\tbuffers","To":"Robert Mader <robert.mader@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260503114002.139255-1-robert.mader@collabora.com>\n\t<20260503114002.139255-3-robert.mader@collabora.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260503114002.139255-3-robert.mader@collabora.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>"}},{"id":38709,"web_url":"https://patchwork.libcamera.org/comment/38709/","msgid":"<4abf0a42-c210-4edb-8aba-78a090a4ad28@collabora.com>","date":"2026-05-04T10:15:28","subject":"Re: [PATCH 2/3] debayer_egl: Implement dmabuf import for input\n\tbuffers","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"Thanks for the review!\n\nOn 04.05.26 11:45, Barnabás Pőcze wrote:\n>> @@ -552,6 +554,8 @@ void DebayerEGL::process(uint32_t frame, \n>> FrameBuffer *input, FrameBuffer *output\n>>       metadata.planes()[0].bytesused = output->planes()[0].length;\n>>         /* Calculate stats for the whole frame */\n>> +    if (dmaSyncers.empty() && (frame % \n>> SwStatsCpu::kStatPerNumFrames) == 0)\n>\n> Maybe there should be a dedicated method in `SwStatsCpu` that decides \n> when to skip a frame.\nAgreed, however as this is a stylistic question resulting in more \nchanges in SwStatsCpu I'd would love to have opinions from Hans and \nBryan. My suggestion would be: SwStatsCpu::shouldProcessFrame()\n>\n>\n>> +        dmaSyncBegin(dmaSyncers, input, nullptr);\n>\n> This means the same fd can be in `dmaSyncers` multiple times. That \n> means there might\n> be SYNC_START -> SYNC_START -> SYNC_END -> SYNC_END. Is this allowed \n> by the kernel?\n> Does it handle it as expected?\n\nThat's actually avoided by the dmaSyncers.empty() check.\n\nWhether the kernel would handle it correctly - I *think* it does, at \nleast for this use-case, however IIUC it would still cause multiple \ncache flushes on ARM.\n\n>\n> But in any case, I think there should just be an \n> `std::optional<DmaSyncer> inputPlane0Syncer`,\n> which is populated accordingly in the slow path and (if needed) before \n> statistics.\nCan do, if that makes things clearer / easier to read.\n>\n>\n>>       stats_->processFrame(frame, 0, input);\n>\n> Maybe I'm missing why it wasn't like that in the first place, but I \n> think this\n> function should take either a `const MappedFrameBuffer&` or just the \n> data pointer.\n> It seems entirely unnecessary to map it again there as well. Although \n> that will now\n> have less of an effect with this fast path. \n\nRe-using the map if already present is certainly desirable. I thought \nabout that before, but it requires more invasive changes - and I was \nhoping to keep the scope of the series small to land it quickly.\n\nIn fact I'm wondering if we should just pull `DebayerEGL::debayerGPU()` \ninto `DebayerEGL::process()`, which would make that easier to follow. \nGiven that this is about pre-existing behavior, would you mind deferring \nthat discussion to a follow-up, together with other clean-ups (for e.g. \negl.cpp)?\n\n>\n>>       dmaSyncers.clear();\n>>   diff --git a/src/libcamera/software_isp/debayer_egl.h \n>> b/src/libcamera/software_isp/debayer_egl.h\n>> index fcd281f4c..62cb4f7f1 100644\n>> --- a/src/libcamera/software_isp/debayer_egl.h\n>> +++ b/src/libcamera/software_isp/debayer_egl.h\n>> @@ -66,7 +66,7 @@ private:\n>>       int initBayerShaders(PixelFormat inputFormat, PixelFormat \n>> outputFormat);\n>>       int getShaderVariableLocations();\n>>       void setShaderVariableValues(const DebayerParams &params);\n>> -    int debayerGPU(MappedFrameBuffer &in, int out_fd, const \n>> DebayerParams &params);\n>> +    int debayerGPU(FrameBuffer *input, FrameBuffer *output, \n>> std::vector<DmaSyncer> &dmaSyncers, const DebayerParams &params);\n>>         /* Shader program identifiers */\n>>       GLuint vertexShaderId_ = 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 EA8DEBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 May 2026 10:15:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E79126301E;\n\tMon,  4 May 2026 12:15:37 +0200 (CEST)","from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com\n\t[136.143.188.112])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 90A5462FE1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 May 2026 12:15:36 +0200 (CEST)","by mx.zohomail.com with SMTPS id 1777889731413227.96878446038056; \n\tMon, 4 May 2026 03:15:31 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=collabora.com\n\theader.i=robert.mader@collabora.com header.b=\"lQr6V9CS\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1777889733; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=D9OuOL14bPv/v+E+zViacjsza3IVOpXumAc20WEgjoNYnVnUlImRYUKtRspjlBmvh4TEB2H0XxPsu/c3cgWXboO0UaRWEN1Bw0sOeUUCTPyX3Dh2jQesXFPnJNbdKyLiHWDFBJ4wX0Xceb633yzkEd0W8F5v9pDs4HX5AClsJ5I=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1777889733;\n\th=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc;\n\tbh=60W/4F6afaZm4M/dOH/qVv9KGroKn4cqy3Q0zM6MDZU=; \n\tb=ewvJO4xO06pU6XePsmNcK/x3qvRNicIH/MmMt5YkNKoyL1ylnsbGSUaCQokB158GBu5uDQVLcYWEcpa1JiitlQM1RFZ4CvFUsdlS8iF9iSFf0P07JZJCrrj51WAO2g0YQhDePzJ/jNBmyXGnWRUJHTbGcdzhA1wR+9V/k7SDrhs=","ARC-Authentication-Results":"i=1; mx.zohomail.com;\n\tdkim=pass  header.i=collabora.com;\n\tspf=pass  smtp.mailfrom=robert.mader@collabora.com;\n\tdmarc=pass header.from=<robert.mader@collabora.com>","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1777889733;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc;\n\tbh=60W/4F6afaZm4M/dOH/qVv9KGroKn4cqy3Q0zM6MDZU=;\n\tb=lQr6V9CSNhkmPCss7Q0ywnzsOFuZlwap7T7HYCuWbDfSr61dqO+Ku4P28+LfVKIV\n\tLzYyMOwz7NZO5A/rPM8sBEFggtr3jXgDtPPBgfHrdqp7WozL6XylgnbCVFGlJEgkAaw\n\tFX9169r6zUBSViLxmizTluicMF/dhcHfsHf12bVY=","Message-ID":"<4abf0a42-c210-4edb-8aba-78a090a4ad28@collabora.com>","Date":"Mon, 4 May 2026 12:15:28 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 2/3] debayer_egl: Implement dmabuf import for input\n\tbuffers","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260503114002.139255-1-robert.mader@collabora.com>\n\t<20260503114002.139255-3-robert.mader@collabora.com>\n\t<11d363fd-3c09-4d67-96be-24eae332133f@ideasonboard.com>","Content-Language":"en-US, de-DE","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<11d363fd-3c09-4d67-96be-24eae332133f@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>"}},{"id":38711,"web_url":"https://patchwork.libcamera.org/comment/38711/","msgid":"<0ae1c3d7-bacf-476e-9249-b05d3ac6a0fd@ideasonboard.com>","date":"2026-05-04T10:33:18","subject":"Re: [PATCH 2/3] debayer_egl: Implement dmabuf import for input\n\tbuffers","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 05. 04. 12:15 keltezéssel, Robert Mader írta:\n> Thanks for the review!\n> \n> On 04.05.26 11:45, Barnabás Pőcze wrote:\n>>> @@ -552,6 +554,8 @@ void DebayerEGL::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output\n>>>       metadata.planes()[0].bytesused = output->planes()[0].length;\n>>>         /* Calculate stats for the whole frame */\n>>> +    if (dmaSyncers.empty() && (frame % SwStatsCpu::kStatPerNumFrames) == 0)\n>>\n>> Maybe there should be a dedicated method in `SwStatsCpu` that decides when to skip a frame.\n> Agreed, however as this is a stylistic question resulting in more changes in SwStatsCpu I'd would love to have opinions from Hans and Bryan. My suggestion would be: SwStatsCpu::shouldProcessFrame()\n>>\n>>\n>>> +        dmaSyncBegin(dmaSyncers, input, nullptr);\n>>\n>> This means the same fd can be in `dmaSyncers` multiple times. That means there might\n>> be SYNC_START -> SYNC_START -> SYNC_END -> SYNC_END. Is this allowed by the kernel?\n>> Does it handle it as expected?\n> \n> That's actually avoided by the dmaSyncers.empty() check.\n\nAhh, you're right, and I am blind.\n\n> \n> Whether the kernel would handle it correctly - I *think* it does, at least for this use-case, however IIUC it would still cause multiple cache flushes on ARM.\n> \n>>\n>> But in any case, I think there should just be an `std::optional<DmaSyncer> inputPlane0Syncer`,\n>> which is populated accordingly in the slow path and (if needed) before statistics.\n> Can do, if that makes things clearer / easier to read.\n>>\n>>\n>>>       stats_->processFrame(frame, 0, input);\n>>\n>> Maybe I'm missing why it wasn't like that in the first place, but I think this\n>> function should take either a `const MappedFrameBuffer&` or just the data pointer.\n>> It seems entirely unnecessary to map it again there as well. Although that will now\n>> have less of an effect with this fast path. \n> \n> Re-using the map if already present is certainly desirable. I thought about that before, but it requires more invasive changes - and I was hoping to keep the scope of the series small to land it quickly.\n> \n> In fact I'm wondering if we should just pull `DebayerEGL::debayerGPU()` into `DebayerEGL::process()`, which would make that easier to follow.\n\nI agree.\n\n\n> Given that this is about pre-existing behavior, would you mind deferring that discussion to a follow-up, together with other clean-ups (for e.g. egl.cpp)?\n\nOK\n\n\n> \n>>\n>>>       dmaSyncers.clear();\n>>>   diff --git a/src/libcamera/software_isp/debayer_egl.h b/src/libcamera/software_isp/debayer_egl.h\n>>> index fcd281f4c..62cb4f7f1 100644\n>>> --- a/src/libcamera/software_isp/debayer_egl.h\n>>> +++ b/src/libcamera/software_isp/debayer_egl.h\n>>> @@ -66,7 +66,7 @@ private:\n>>>       int initBayerShaders(PixelFormat inputFormat, PixelFormat outputFormat);\n>>>       int getShaderVariableLocations();\n>>>       void setShaderVariableValues(const DebayerParams &params);\n>>> -    int debayerGPU(MappedFrameBuffer &in, int out_fd, const DebayerParams &params);\n>>> +    int debayerGPU(FrameBuffer *input, FrameBuffer *output, std::vector<DmaSyncer> &dmaSyncers, const DebayerParams &params);\n>>>         /* Shader program identifiers */\n>>>       GLuint vertexShaderId_ = 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 93EB7BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 May 2026 10:33:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8B2006301E;\n\tMon,  4 May 2026 12:33:23 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D5A7662FE1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 May 2026 12:33:21 +0200 (CEST)","from [192.168.33.78] (185.221.140.217.nat.pool.zt.hu\n\t[185.221.140.217])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E7B18175;\n\tMon,  4 May 2026 12:33:19 +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=\"h7mNTRJT\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1777890800;\n\tbh=UOpA9/1jxg3DlCzQmYrCt/kZw3cXwkdS/huEnDPWTfk=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=h7mNTRJTHNiwgAx0iQUEzIEkASoJMl3noNWFuaH5da514tuOVuGa4yFXnd/gi303j\n\tbXs7jm84Mf9UVD0DTXxdq8zQsIKEZtHobTEHAhZQSy1hULLAbcJqi7qqSCJZDESD86\n\tmodoA08/VEy4dgYp2hgicmjsEO0azP5/jGCR4/tA=","Message-ID":"<0ae1c3d7-bacf-476e-9249-b05d3ac6a0fd@ideasonboard.com>","Date":"Mon, 4 May 2026 12:33:18 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 2/3] debayer_egl: Implement dmabuf import for input\n\tbuffers","To":"Robert Mader <robert.mader@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260503114002.139255-1-robert.mader@collabora.com>\n\t<20260503114002.139255-3-robert.mader@collabora.com>\n\t<11d363fd-3c09-4d67-96be-24eae332133f@ideasonboard.com>\n\t<4abf0a42-c210-4edb-8aba-78a090a4ad28@collabora.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<4abf0a42-c210-4edb-8aba-78a090a4ad28@collabora.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>"}},{"id":38712,"web_url":"https://patchwork.libcamera.org/comment/38712/","msgid":"<772df988-53eb-4b1b-92f7-21c251695b2d@ideasonboard.com>","date":"2026-05-04T10:49:44","subject":"Re: [PATCH 2/3] debayer_egl: Implement dmabuf import for input\n\tbuffers","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 05. 03. 13:40 keltezéssel, Robert Mader írta:\n> In many cases we can import the GPU-ISP input buffers, dmabufs from v4l2,\n> directly into EGL instead of mapping and uploading - i.e. copying - them.\n> \n> Doing so can have positive effects in multiple areas, including reducing\n> memory bandwidth and CPU usage, as well as avoiding expensive dmabuf syncs\n> and syscalls.\n> \n> The main reason direct imports may not work are the more demanding stride\n> alignment requirements many GPUs have - often 128 or 256 bytes - compared\n> to ISPs - apparently often closer to 32 bytes.\n> \n> Thus we first try to import buffers directly and - if that fails - fall back\n> to the previous upload path. Failing imports should come at low cost as\n> drivers know the limitations and can bail out early, without causing\n> additional IO or context switches.\n> \n> In the future we might be able to request buffers with a matching stride\n> from v4l2 drivers in many cases, making direct import the norm instead\n> of a hit-or-miss. An optional kernel API for that exists, but doesn't\n> seem to be implemented by any driver tested so far.\n> \n> While on it, add some minor code adjustments to make it easier to\n> follow.\n> \n> Signed-off-by: Robert Mader <robert.mader@collabora.com>\n> ---\n>   src/libcamera/software_isp/debayer_egl.cpp | 28 ++++++++++++----------\n>   src/libcamera/software_isp/debayer_egl.h   |  2 +-\n>   2 files changed, 17 insertions(+), 13 deletions(-)\n> \n> diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp\n> index 8f0c229fd..624469947 100644\n> --- a/src/libcamera/software_isp/debayer_egl.cpp\n> +++ b/src/libcamera/software_isp/debayer_egl.cpp\n> @@ -495,16 +495,26 @@ void DebayerEGL::setShaderVariableValues(const DebayerParams &params)\n>   \treturn;\n>   }\n>   \n> -int DebayerEGL::debayerGPU(MappedFrameBuffer &in, int out_fd, const DebayerParams &params)\n> +int DebayerEGL::debayerGPU(FrameBuffer *input, FrameBuffer *output, std::vector<DmaSyncer> &dmaSyncers, const DebayerParams &params)\n>   {\n>   \t/* eGL context switch */\n>   \tegl_.makeCurrent();\n>   \n>   \t/* Create a standard texture input */\n> -\tegl_.createTexture2D(*eglImageBayerIn_, glFormat_, inputConfig_.stride / bytesPerPixel_, height_, in.planes()[0].data());\n> +\tif (egl_.createInputDMABufTexture2D(*eglImageBayerIn_, glFormat_, inputConfig_.stride / bytesPerPixel_, height_, input->planes()[0].fd.get()) != 0) {\n\nI'm looking at the first patch, but seeing how it is used makes me wonder:\nwhy not construct `eglImageBayerIn_` with a width of `inputConfig_.stride / bytesPerPixel_`\nin the first place? And use width/height in all `create*Texture2D()` functions?\n\nOnly `createDMABufTexture2D()` uses the width/height members, which is not used for\n`eglImageBayerIn_` before this change, so I think it should be fine?\n\n\n\n> +\t\tLOG(Debayer, Debug) << \"Importing input buffer with DMABuf import failed, falling back to upload\";\n> +\n> +\t\tdmaSyncBegin(dmaSyncers, input, nullptr);\n> +\t\tMappedFrameBuffer in(input, MappedFrameBuffer::MapFlag::Read);\n> +\t\tif (!in.isValid()) {\n> +\t\t\tLOG(Debayer, Error) << \"mmap-ing buffer(s) failed\";\n> +\t\t\treturn -ENODEV;\n> +\t\t}\n> +\t\tegl_.createTexture2D(*eglImageBayerIn_, glFormat_, inputConfig_.stride / bytesPerPixel_, height_, in.planes()[0].data());\n> +\t}\n>   \n>   \t/* Generate the output render framebuffer as render to texture */\n> -\tegl_.createOutputDMABufTexture2D(*eglImageBayerOut_, out_fd);\n> +\tegl_.createOutputDMABufTexture2D(*eglImageBayerOut_, output->planes()[0].fd.get());\n>   \n>   \tsetShaderVariableValues(params);\n>   \tglViewport(0, 0, width_, height_);\n> @@ -528,21 +538,13 @@ void DebayerEGL::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output\n>   \n>   \tstd::vector<DmaSyncer> dmaSyncers;\n>   \n> -\tdmaSyncBegin(dmaSyncers, input, nullptr);\n> -\n>   \t/* Copy metadata from the input buffer */\n>   \tFrameMetadata &metadata = output->_d()->metadata();\n>   \tmetadata.status = input->metadata().status;\n>   \tmetadata.sequence = input->metadata().sequence;\n>   \tmetadata.timestamp = input->metadata().timestamp;\n>   \n> -\tMappedFrameBuffer in(input, MappedFrameBuffer::MapFlag::Read);\n> -\tif (!in.isValid()) {\n> -\t\tLOG(Debayer, Error) << \"mmap-ing buffer(s) failed\";\n> -\t\tgoto error;\n> -\t}\n> -\n> -\tif (debayerGPU(in, output->planes()[0].fd.get(), params)) {\n> +\tif (debayerGPU(input, output, dmaSyncers, params)) {\n>   \t\tLOG(Debayer, Error) << \"debayerGPU failed\";\n>   \t\tgoto error;\n>   \t}\n> @@ -552,6 +554,8 @@ void DebayerEGL::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output\n>   \tmetadata.planes()[0].bytesused = output->planes()[0].length;\n>   \n>   \t/* Calculate stats for the whole frame */\n> +\tif (dmaSyncers.empty() && (frame % SwStatsCpu::kStatPerNumFrames) == 0)\n> +\t    dmaSyncBegin(dmaSyncers, input, nullptr);\n>   \tstats_->processFrame(frame, 0, input);\n>   \tdmaSyncers.clear();\n>   \n> diff --git a/src/libcamera/software_isp/debayer_egl.h b/src/libcamera/software_isp/debayer_egl.h\n> index fcd281f4c..62cb4f7f1 100644\n> --- a/src/libcamera/software_isp/debayer_egl.h\n> +++ b/src/libcamera/software_isp/debayer_egl.h\n> @@ -66,7 +66,7 @@ private:\n>   \tint initBayerShaders(PixelFormat inputFormat, PixelFormat outputFormat);\n>   \tint getShaderVariableLocations();\n>   \tvoid setShaderVariableValues(const DebayerParams &params);\n> -\tint debayerGPU(MappedFrameBuffer &in, int out_fd, const DebayerParams &params);\n> +\tint debayerGPU(FrameBuffer *input, FrameBuffer *output, std::vector<DmaSyncer> &dmaSyncers, const DebayerParams &params);\n>   \n>   \t/* Shader program identifiers */\n>   \tGLuint vertexShaderId_ = 0;","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 96269BDCB5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 May 2026 10:49:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 945C96301E;\n\tMon,  4 May 2026 12:49:50 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0B08762FE1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 May 2026 12:49:49 +0200 (CEST)","from [192.168.33.78] (185.221.140.217.nat.pool.zt.hu\n\t[185.221.140.217])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1800B175;\n\tMon,  4 May 2026 12:49:47 +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=\"Gnau/Uxh\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1777891787;\n\tbh=TMA0DaOLQYfxU0fnavfSy2MaFJhgOKon7bANcYc8U2I=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=Gnau/UxhIhNq8GrFF9rfQNxXPTFDpATHTMQnrBN5H3+4fcTKs7CnQ37/BzUHFwhCy\n\te6O3jCul9p+E1qEOut3IKzTSCJFqoSgmrW0m7Bjly7BaDOGf2EaVlzOBcVdi3FsWoR\n\trL1r/YkzOsA7RnEfRAP8Z7hBe0mYejUeI7Lockmc=","Message-ID":"<772df988-53eb-4b1b-92f7-21c251695b2d@ideasonboard.com>","Date":"Mon, 4 May 2026 12:49:44 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 2/3] debayer_egl: Implement dmabuf import for input\n\tbuffers","To":"Robert Mader <robert.mader@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260503114002.139255-1-robert.mader@collabora.com>\n\t<20260503114002.139255-3-robert.mader@collabora.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260503114002.139255-3-robert.mader@collabora.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>"}},{"id":38714,"web_url":"https://patchwork.libcamera.org/comment/38714/","msgid":"<8485a1a3-4775-4104-b3e7-cde4658cda54@collabora.com>","date":"2026-05-04T11:28:13","subject":"Re: [PATCH 2/3] debayer_egl: Implement dmabuf import for input\n\tbuffers","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"On 04.05.26 12:49, Barnabás Pőcze wrote:\n> 2026. 05. 03. 13:40 keltezéssel, Robert Mader írta:\n>> In many cases we can import the GPU-ISP input buffers, dmabufs from \n>> v4l2,\n>> directly into EGL instead of mapping and uploading - i.e. copying - \n>> them.\n>>\n>> Doing so can have positive effects in multiple areas, including reducing\n>> memory bandwidth and CPU usage, as well as avoiding expensive dmabuf \n>> syncs\n>> and syscalls.\n>>\n>> The main reason direct imports may not work are the more demanding \n>> stride\n>> alignment requirements many GPUs have - often 128 or 256 bytes - \n>> compared\n>> to ISPs - apparently often closer to 32 bytes.\n>>\n>> Thus we first try to import buffers directly and - if that fails - \n>> fall back\n>> to the previous upload path. Failing imports should come at low cost as\n>> drivers know the limitations and can bail out early, without causing\n>> additional IO or context switches.\n>>\n>> In the future we might be able to request buffers with a matching stride\n>> from v4l2 drivers in many cases, making direct import the norm instead\n>> of a hit-or-miss. An optional kernel API for that exists, but doesn't\n>> seem to be implemented by any driver tested so far.\n>>\n>> While on it, add some minor code adjustments to make it easier to\n>> follow.\n>>\n>> Signed-off-by: Robert Mader <robert.mader@collabora.com>\n>> ---\n>>   src/libcamera/software_isp/debayer_egl.cpp | 28 ++++++++++++----------\n>>   src/libcamera/software_isp/debayer_egl.h   |  2 +-\n>>   2 files changed, 17 insertions(+), 13 deletions(-)\n>>\n>> diff --git a/src/libcamera/software_isp/debayer_egl.cpp \n>> b/src/libcamera/software_isp/debayer_egl.cpp\n>> index 8f0c229fd..624469947 100644\n>> --- a/src/libcamera/software_isp/debayer_egl.cpp\n>> +++ b/src/libcamera/software_isp/debayer_egl.cpp\n>> @@ -495,16 +495,26 @@ void DebayerEGL::setShaderVariableValues(const \n>> DebayerParams &params)\n>>       return;\n>>   }\n>>   -int DebayerEGL::debayerGPU(MappedFrameBuffer &in, int out_fd, \n>> const DebayerParams &params)\n>> +int DebayerEGL::debayerGPU(FrameBuffer *input, FrameBuffer *output, \n>> std::vector<DmaSyncer> &dmaSyncers, const DebayerParams &params)\n>>   {\n>>       /* eGL context switch */\n>>       egl_.makeCurrent();\n>>         /* Create a standard texture input */\n>> -    egl_.createTexture2D(*eglImageBayerIn_, glFormat_, \n>> inputConfig_.stride / bytesPerPixel_, height_, in.planes()[0].data());\n>> +    if (egl_.createInputDMABufTexture2D(*eglImageBayerIn_, \n>> glFormat_, inputConfig_.stride / bytesPerPixel_, height_, \n>> input->planes()[0].fd.get()) != 0) {\n>\n> I'm looking at the first patch, but seeing how it is used makes me \n> wonder:\n> why not construct `eglImageBayerIn_` with a width of \n> `inputConfig_.stride / bytesPerPixel_`\n> in the first place? And use width/height in all `create*Texture2D()` \n> functions?\n>\n> Only `createDMABufTexture2D()` uses the width/height members, which is \n> not used for\n> `eglImageBayerIn_` before this change, so I think it should be fine?\n\nTrue, we could do that by calling `initBayerShaders()` before \ninitializing eglImageBayerIn_ and eglImageBayerOut_ - which would also \nallow us to simplify createTexture2D() accordingly.\n\nCan try that for v2.\n\n>> +        LOG(Debayer, Debug) << \"Importing input buffer with DMABuf \n>> import failed, falling back to upload\";\n>> +\n>> +        dmaSyncBegin(dmaSyncers, input, nullptr);\n>> +        MappedFrameBuffer in(input, MappedFrameBuffer::MapFlag::Read);\n>> +        if (!in.isValid()) {\n>> +            LOG(Debayer, Error) << \"mmap-ing buffer(s) failed\";\n>> +            return -ENODEV;\n>> +        }\n>> +        egl_.createTexture2D(*eglImageBayerIn_, glFormat_, \n>> inputConfig_.stride / bytesPerPixel_, height_, in.planes()[0].data());\n>> +    }\n>>         /* Generate the output render framebuffer as render to \n>> texture */\n>> -    egl_.createOutputDMABufTexture2D(*eglImageBayerOut_, out_fd);\n>> +    egl_.createOutputDMABufTexture2D(*eglImageBayerOut_, \n>> output->planes()[0].fd.get());\n>>         setShaderVariableValues(params);\n>>       glViewport(0, 0, width_, height_);\n>> @@ -528,21 +538,13 @@ void DebayerEGL::process(uint32_t frame, \n>> FrameBuffer *input, FrameBuffer *output\n>>         std::vector<DmaSyncer> dmaSyncers;\n>>   -    dmaSyncBegin(dmaSyncers, input, nullptr);\n>> -\n>>       /* Copy metadata from the input buffer */\n>>       FrameMetadata &metadata = output->_d()->metadata();\n>>       metadata.status = input->metadata().status;\n>>       metadata.sequence = input->metadata().sequence;\n>>       metadata.timestamp = input->metadata().timestamp;\n>>   -    MappedFrameBuffer in(input, MappedFrameBuffer::MapFlag::Read);\n>> -    if (!in.isValid()) {\n>> -        LOG(Debayer, Error) << \"mmap-ing buffer(s) failed\";\n>> -        goto error;\n>> -    }\n>> -\n>> -    if (debayerGPU(in, output->planes()[0].fd.get(), params)) {\n>> +    if (debayerGPU(input, output, dmaSyncers, params)) {\n>>           LOG(Debayer, Error) << \"debayerGPU failed\";\n>>           goto error;\n>>       }\n>> @@ -552,6 +554,8 @@ void DebayerEGL::process(uint32_t frame, \n>> FrameBuffer *input, FrameBuffer *output\n>>       metadata.planes()[0].bytesused = output->planes()[0].length;\n>>         /* Calculate stats for the whole frame */\n>> +    if (dmaSyncers.empty() && (frame % \n>> SwStatsCpu::kStatPerNumFrames) == 0)\n>> +        dmaSyncBegin(dmaSyncers, input, nullptr);\n>>       stats_->processFrame(frame, 0, input);\n>>       dmaSyncers.clear();\n>>   diff --git a/src/libcamera/software_isp/debayer_egl.h \n>> b/src/libcamera/software_isp/debayer_egl.h\n>> index fcd281f4c..62cb4f7f1 100644\n>> --- a/src/libcamera/software_isp/debayer_egl.h\n>> +++ b/src/libcamera/software_isp/debayer_egl.h\n>> @@ -66,7 +66,7 @@ private:\n>>       int initBayerShaders(PixelFormat inputFormat, PixelFormat \n>> outputFormat);\n>>       int getShaderVariableLocations();\n>>       void setShaderVariableValues(const DebayerParams &params);\n>> -    int debayerGPU(MappedFrameBuffer &in, int out_fd, const \n>> DebayerParams &params);\n>> +    int debayerGPU(FrameBuffer *input, FrameBuffer *output, \n>> std::vector<DmaSyncer> &dmaSyncers, const DebayerParams &params);\n>>         /* Shader program identifiers */\n>>       GLuint vertexShaderId_ = 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 9CBDBBDCB5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 May 2026 11:28:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7B68A63025;\n\tMon,  4 May 2026 13:28:22 +0200 (CEST)","from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com\n\t[136.143.188.112])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C645462FE1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 May 2026 13:28:20 +0200 (CEST)","by mx.zohomail.com with SMTPS id 1777894096366599.3313502613614;\n\tMon, 4 May 2026 04:28:16 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=collabora.com\n\theader.i=robert.mader@collabora.com header.b=\"TFQXg76t\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1777894097; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=Arj3pNb6T0w8AO/4TWHCYUfzguWw5MULwEruCogxxjxEdi6opDrAyr2BnMSK99ugmVZ9hYsHcClrs401QBrfZ8naW0plC9S1fMIpbYwZtiL48BdmgE2/aR061WZVpedCdtYMnRfl7y31+Az6PduvVZF8g7373EKn8orurSzL+zQ=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1777894097;\n\th=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc;\n\tbh=XYKnTwX76IOzsdL/OIEOQS776SNrtiNRnpsHEELzfAc=; \n\tb=l1bdJtw5n9FUmZYu/xLac9n5bUNY+J3Wr3ytd7tzhf3dgnZUnktwPP4kPnm1fNX8rV9Cw73KxlXCGFxLe2XRhPElovjcToCfIUOriJ118MxglQg3QcOVrakxGB95VhkkYmGnctV9Er0p1A3n7RpgSjLOYnMUtdiysboOGohrY3k=","ARC-Authentication-Results":"i=1; mx.zohomail.com;\n\tdkim=pass  header.i=collabora.com;\n\tspf=pass  smtp.mailfrom=robert.mader@collabora.com;\n\tdmarc=pass header.from=<robert.mader@collabora.com>","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1777894097;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc;\n\tbh=XYKnTwX76IOzsdL/OIEOQS776SNrtiNRnpsHEELzfAc=;\n\tb=TFQXg76tvwM0cbY7cFP+HvzIt05YV0It0bo0qP4l9XrLt+rGrYcp+cNE5PAoOvru\n\tdoe3SyXXKYtZ0Wavq5buImnRpGQ9+S3X+tpB4ZoQVqOUFt3N1K0LFO7fL0VbqyuDhS+\n\tIZdoEnePXet+MVJ+6EXO6ZAvmeDImBMlSgo3VyNQ=","Message-ID":"<8485a1a3-4775-4104-b3e7-cde4658cda54@collabora.com>","Date":"Mon, 4 May 2026 13:28:13 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 2/3] debayer_egl: Implement dmabuf import for input\n\tbuffers","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260503114002.139255-1-robert.mader@collabora.com>\n\t<20260503114002.139255-3-robert.mader@collabora.com>\n\t<772df988-53eb-4b1b-92f7-21c251695b2d@ideasonboard.com>","Content-Language":"en-US, de-DE","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<772df988-53eb-4b1b-92f7-21c251695b2d@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>"}}]