[{"id":38707,"web_url":"https://patchwork.libcamera.org/comment/38707/","msgid":"<f2f10ddf-f145-48c4-96e2-4b8e0c5521b5@ideasonboard.com>","date":"2026-05-04T09:25:46","subject":"Re: [PATCH 3/3] debayer_egl: Sync output buffer after processing\n\tstats","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> Instead of waiting for the GPU to finish the output buffer *before*\n> computing stats, do so afterwards. This allows work to happen in\n> parallel on the GPU and CPU, potentially improving throughput and\n> reducing latency.\n> \n> This, however, requires us to include stats computation into the\n> debayer benchmark data.\n> \n> Signed-off-by: Robert Mader <robert.mader@collabora.com>\n> ---\n\nThe slight change in the timing results seems more than acceptable to me.\n\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\n\n>   src/libcamera/software_isp/debayer_egl.cpp | 7 +++----\n>   1 file changed, 3 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp\n> index 624469947..7dae52648 100644\n> --- a/src/libcamera/software_isp/debayer_egl.cpp\n> +++ b/src/libcamera/software_isp/debayer_egl.cpp\n> @@ -525,8 +525,6 @@ int DebayerEGL::debayerGPU(FrameBuffer *input, FrameBuffer *output, std::vector<\n>   \tif (err != GL_NO_ERROR) {\n>   \t\tLOG(eGL, Error) << \"Drawing scene fail \" << err;\n>   \t\treturn -ENODEV;\n> -\t} else {\n> -\t\tegl_.syncOutput();\n>   \t}\n>   \n>   \treturn 0;\n> @@ -549,8 +547,6 @@ void DebayerEGL::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output\n>   \t\tgoto error;\n>   \t}\n>   \n> -\tbench_.finishFrame();\n> -\n>   \tmetadata.planes()[0].bytesused = output->planes()[0].length;\n>   \n>   \t/* Calculate stats for the whole frame */\n> @@ -559,6 +555,9 @@ void DebayerEGL::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output\n>   \tstats_->processFrame(frame, 0, input);\n>   \tdmaSyncers.clear();\n>   \n> +\tegl_.syncOutput();\n> +\tbench_.finishFrame();\n> +\n>   \toutputBufferReady.emit(output);\n>   \tinputBufferReady.emit(input);\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 A0B2DBDCB5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 May 2026 09:25:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B3C0A62FEC;\n\tMon,  4 May 2026 11:25:52 +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 AA59A6271A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 May 2026 11:25:50 +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 878809C;\n\tMon,  4 May 2026 11:25:48 +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=\"Bc+elYhp\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1777886748;\n\tbh=LoMab8Kzx9GbdtcfAUpR0pM8KrGqR12KiFdvAYgukJA=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=Bc+elYhpTrxIJuBcaagsTL6Sdp+8hf3ktfANxdC2SgOm5lCjdvZSBJrcH1fkwb9FX\n\tUp/7AkT71N97N0u0c3jgciAjtQsIYLjjA9YJBbFOVJ2nM2wIzVJzVG4hBqD7Jbbg6K\n\tSJe711H6DsNboDP/bSVfmdrUxEVSVEVSLDuYPxMA=","Message-ID":"<f2f10ddf-f145-48c4-96e2-4b8e0c5521b5@ideasonboard.com>","Date":"Mon, 4 May 2026 11:25:46 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 3/3] debayer_egl: Sync output buffer after processing\n\tstats","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-4-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-4-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>"}}]