[{"id":38924,"web_url":"https://patchwork.libcamera.org/comment/38924/","msgid":"<50c4f6ae-d9b3-4f75-bc28-cbc5c5117a2f@linaro.org>","date":"2026-05-19T16:01:39","subject":"Re: [PATCH v2 4/4] debayer_egl: Sync output buffer after processing\n\tstats","submitter":{"id":175,"url":"https://patchwork.libcamera.org/api/people/175/","name":"Bryan O'Donoghue","email":"bryan.odonoghue@linaro.org"},"content":"On 18/05/2026 21:15, Robert Mader wrote:\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> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\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 e5a661d2c..9ad0c871f 100644\n> --- a/src/libcamera/software_isp/debayer_egl.cpp\n> +++ b/src/libcamera/software_isp/debayer_egl.cpp\n> @@ -530,8 +530,6 @@ int DebayerEGL::debayerGPU(FrameBuffer *input, std::optional<DmaSyncer> *inputBu\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> @@ -554,8 +552,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> @@ -564,6 +560,9 @@ void DebayerEGL::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output\n>   \tstats_->processFrame(frame, 0, input);\n>   \tinputBufferDmaSyncer.reset();\n> \n> +\tegl_.syncOutput();\n> +\tbench_.finishFrame();\n> +\n>   \toutputBufferReady.emit(output);\n>   \tinputBufferReady.emit(input);\n> \n> --\n> 2.54.0\n> \n\nInteresting.\n\nI'm wondering what effect if any there is on the CPU cache as a result \nof this change.\n\nIn the round I think its a good change in theory but, being difficult \nI'd also like some metrics to prove it out.\n\nCan we valgrind this or oprofile it and see what kind of before/after \nmetrics we get.\n\n---\nbod","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 592A7BDCBC\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 May 2026 16:01:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5B04663020;\n\tTue, 19 May 2026 18:01:47 +0200 (CEST)","from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com\n\t[IPv6:2a00:1450:4864:20::32c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DCAA262FD3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 May 2026 18:01:45 +0200 (CEST)","by mail-wm1-x32c.google.com with SMTP id\n\t5b1f17b1804b1-48909558b3aso40228115e9.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 May 2026 09:01:45 -0700 (PDT)","from [192.168.0.35] ([51.37.145.233])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-48ff43f8799sm226138495e9.2.2026.05.19.09.01.40\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tTue, 19 May 2026 09:01:40 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"XroPyW1Y\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1779206505; x=1779811305;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:in-reply-to:from:content-language\n\t:references:cc:to:subject:user-agent:mime-version:date:message-id\n\t:from:to:cc:subject:date:message-id:reply-to;\n\tbh=5L/jsXcefFvBBpWffzI3EMB7+k25xrChgMHQFFuotjc=;\n\tb=XroPyW1YjAwxARsM/IWlZL8YmMxNBhbN/YYIpsLjK2G+4EiJCxfBCEeTA6xIApRNtb\n\t15ukPDeRxaNpdBKzQq+SyfJCOg3aYmvJdmyUf25VnL+tZ2PLCL7T0k18eptlUgU+DzdM\n\tOPeuygKFVa0vcuowohBvjPtkfXJ5ZW5az0BpLcfYwompLC8e79mLNDYuABF/t3u75mBS\n\t7roRzjKAzS3aqU0Q+mvcqDSR5W7nsgIpnBtKOhhVr2DO9qvZ6ho0FdDZUcaKE2uaFNie\n\t70FYHTUjkRX91IoQaH/Pr4v/dqYefZqKCqELXBL/GJx2mtnX3DYeyzeiuKpNydwoFAzH\n\tkOIw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1779206505; x=1779811305;\n\th=content-transfer-encoding:in-reply-to:from:content-language\n\t:references:cc:to:subject:user-agent:mime-version:date:message-id\n\t:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=5L/jsXcefFvBBpWffzI3EMB7+k25xrChgMHQFFuotjc=;\n\tb=YG/+81QQDnrEytLwMc0Bnk7k7VS1Rqr27aSioqnYGRqDAjNZbjEt7TzgGD7ydxqEj4\n\tLBprrECxkObDiNqwcBIF0KqP2dQDSlYN8XvVuK5JPZPbL23Hvqi90O3laB+iu7jtIs4L\n\tO6qUu00XAxDY1OMVHS9yionSLuNBnL9O6X5RFCkuGucwQEQQW/bi6UK8ka9NoGSOZHQi\n\tX9gQHSD2PY6awGfHgPedL4MTh4Yt97pKPKu5a0fNtqUObWy/8ap9hmN0j55eJrSAmPmZ\n\teHiisMnaCb76d5V6vac5v5Ate5nxgmUyUiU2OJi/hCR+wDz45rxXpTvWCut/Sle5K3pj\n\tKgBA==","X-Forwarded-Encrypted":"i=1;\n\tAFNElJ8aIyQEkOAC21u3LVva7g4feIYTPVhcrsGP0mEOqMdtHMImgLAKphfnQomF8u5tvFGAXUzt6dFjRJAFgz3C6cc=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YxU7CQGGCjhdTrJbsEVXKD7GHriit+WbJGZw6TKPJrFel3gz0RL\n\t8NUtcDSurXGeQvSuI0ukugqVneOfEF8oVwhXcxeebbUYLf62TK8OibPVgdG8jbUXEok=","X-Gm-Gg":"Acq92OEyT82Ix+oJ75jiWzKJLdGSN2q6P+wJR295wjBVG1FR1GWN/Dou+owO+CT+bD0\n\t1LouIv9n7Y16ERhM6/i2oegHHNf2EajQHoiNuSv5Ar7QoVockdnpjyzlypzCjtg8frrihgW4Sq8\n\tMPVOWIa0X/yPnA2A8e+yeql7IPljnhvEw4OGhbU1e7CfENfF5xJyp8KjiePM4MPZ66LTT0vXjGT\n\tm4UdEcdSygen0lKN4Bu0DJzG/5N6TvkL9W82j7o4kuYoXcV23oreD7tYFem+rx9jQixvFe3BkQo\n\tpOzr9D7APjtvxipH7OIWW9F2Aoru2QZ2PE3FI4MAHOnwVHM3X+U8wti431hvcx1lzdIIZ1Nq/VQ\n\tZgi8Slyir1WTT5u6YsrE+OwYeCCSm3ZDYV/Od4vcz76fJPViVuDXU9NQRJOlnKRWm20B0VzREiM\n\tf0fOG7c/Po4OdYw4yn1v8dAqPswuMt+3Hyds55QW6427L1","X-Received":"by 2002:a05:600c:628d:b0:490:1642:3d4d with SMTP id\n\t5b1f17b1804b1-49016423dd1mr106284145e9.22.1779206505295; \n\tTue, 19 May 2026 09:01:45 -0700 (PDT)","Message-ID":"<50c4f6ae-d9b3-4f75-bc28-cbc5c5117a2f@linaro.org>","Date":"Tue, 19 May 2026 17:01:39 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 4/4] debayer_egl: Sync output buffer after processing\n\tstats","To":"Robert Mader <robert.mader@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","References":"<20260518201508.140849-1-robert.mader@collabora.com>\n\t<0oKkG3ndOJeXx0ZaFU3T0XSPgEMyGVBGSJWLfq9oVtKrRYuUpEcm6lZv_ihUvUE1EG1PH3fzTByV9xU-g3Ya9g==@protonmail.internalid>\n\t<20260518201508.140849-5-robert.mader@collabora.com>","Content-Language":"en-US","From":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","In-Reply-To":"<20260518201508.140849-5-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":38929,"web_url":"https://patchwork.libcamera.org/comment/38929/","msgid":"<a505b5fb-d33c-457b-9ec5-8e04167ea339@collabora.com>","date":"2026-05-19T19:50:37","subject":"Re: [PATCH v2 4/4] debayer_egl: Sync output buffer after processing\n\tstats","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"On 19.05.26 18:01, Bryan O'Donoghue wrote:\n> Interesting.\n>\n> I'm wondering what effect if any there is on the CPU cache as a result \n> of this change.\n>\n> In the round I think its a good change in theory but, being difficult \n> I'd also like some metrics to prove it out.\n>\n> Can we valgrind this or oprofile it and see what kind of before/after \n> metrics we get. \nI'll try to do some benchmarks. In theory the improved parallelism \nshould simply shorten the overall time spend in process().","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 9F700BDCBC\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 May 2026 19:50:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0F8C26303B;\n\tTue, 19 May 2026 21:50:48 +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 E543063024\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 May 2026 21:50:45 +0200 (CEST)","by mx.zohomail.com with SMTPS id 17792202397761016.2690436165632; \n\tTue, 19 May 2026 12:50:39 -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=\"LyZeYjFM\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1779220243; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=j669n9KKiq+ZchwdXlL/fsqBGf9SnNzZBwm9g4vu1BHWD9s5P3ceVkDR+TIS5zCflRx1DY0wvFIiqgH1A7D3zkjNljlfF1mAK3IfXSDTnDxdtMqx7JBvk8972FlANtH4QhYQgau1/utY08YnnbJ457vz5bM/6b3kGmlsFtoA+Ts=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1779220243;\n\th=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To;\n\tbh=beK+AbkFawfARucE0TtOI36CYhPmv456q0SKyx7m9TQ=; \n\tb=D0sYxLhE96n1l9FVItBObaUVh1QU8jEtVTpXeDIvRpC8E4KjP8UCJ/62tbC3aHSJj4NPBrHBfmBImrxKmmBnypC8Ol/uXvjK5Ebm1hQQZt2SrLGctykhth8nsfJhHyKae3BbhuH+h3emwAcG0HcQ3bFxC85XQdWgEgpU7iM1b3s=","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=1779220242;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;\n\tbh=beK+AbkFawfARucE0TtOI36CYhPmv456q0SKyx7m9TQ=;\n\tb=LyZeYjFMEi4BhqlqsUnF7DqQw0InSwlx4TsvhzsXmyKTxVqpwmudgs1/0M5QDguM\n\tTA4khjJ3D8jzLYFXLqcjfnQs12V8cgg1Fhho3+wWJ8McF2YXWLHVbpJLDGJSKh5rSqz\n\tu6evH4iVhRHhywrGBcpSGoVMaELCWSuRxodwVZ1s=","Message-ID":"<a505b5fb-d33c-457b-9ec5-8e04167ea339@collabora.com>","Date":"Tue, 19 May 2026 21:50:37 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 4/4] debayer_egl: Sync output buffer after processing\n\tstats","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","References":"<20260518201508.140849-1-robert.mader@collabora.com>\n\t<0oKkG3ndOJeXx0ZaFU3T0XSPgEMyGVBGSJWLfq9oVtKrRYuUpEcm6lZv_ihUvUE1EG1PH3fzTByV9xU-g3Ya9g==@protonmail.internalid>\n\t<20260518201508.140849-5-robert.mader@collabora.com>\n\t<50c4f6ae-d9b3-4f75-bc28-cbc5c5117a2f@linaro.org>","Content-Language":"en-US, de-DE, en-GB","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<50c4f6ae-d9b3-4f75-bc28-cbc5c5117a2f@linaro.org>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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":38932,"web_url":"https://patchwork.libcamera.org/comment/38932/","msgid":"<6fe20dee-58db-43ec-aa25-5d2f59c67982@linaro.org>","date":"2026-05-20T07:42:12","subject":"Re: [PATCH v2 4/4] debayer_egl: Sync output buffer after processing\n\tstats","submitter":{"id":175,"url":"https://patchwork.libcamera.org/api/people/175/","name":"Bryan O'Donoghue","email":"bryan.odonoghue@linaro.org"},"content":"On 19/05/2026 20:50, Robert Mader wrote:\n> On 19.05.26 18:01, Bryan O'Donoghue wrote:\n>> Interesting.\n>>\n>> I'm wondering what effect if any there is on the CPU cache as a result \n>> of this change.\n>>\n>> In the round I think its a good change in theory but, being difficult \n>> I'd also like some metrics to prove it out.\n>>\n>> Can we valgrind this or oprofile it and see what kind of before/after \n>> metrics we get. \n> I'll try to do some benchmarks. In theory the improved parallelism \n> should simply shorten the overall time spend in process().\n\nI'm really just probing - now that we will operate on the same data in \nparallel in the CPU and GPU - or could - what side-effect if any is \nthere on caches...\n\nShould be none, each xPU has its own view of memory, its own cache, its \nown PTEs...\n\n---\nbod","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 24F95BDCBC\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 20 May 2026 07:42:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B6F2063022;\n\tWed, 20 May 2026 09:42:16 +0200 (CEST)","from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com\n\t[IPv6:2a00:1450:4864:20::42e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A54BD6175A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 May 2026 09:42:14 +0200 (CEST)","by mail-wr1-x42e.google.com with SMTP id\n\tffacd0b85a97d-44985f4ab0fso2330483f8f.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 May 2026 00:42:14 -0700 (PDT)","from [192.168.0.35] ([109.76.255.129])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-48febe582d0sm152649055e9.18.2026.05.20.00.42.12\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tWed, 20 May 2026 00:42:13 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"hZIknK4S\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1779262934; x=1779867734;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:in-reply-to:from:content-language\n\t:references:cc:to:subject:user-agent:mime-version:date:message-id\n\t:from:to:cc:subject:date:message-id:reply-to;\n\tbh=UkU0i+aSJvECgbKVUvGM1MCgmIShBn5hoMB2R/I4alQ=;\n\tb=hZIknK4SgOb+Htp5OHA9OW2cbQU376WNxmBU4/awqdsauoqIN9/6DTX82BcC25clK2\n\tAH4luIl7+OokI/VfTgA4T82mgxTgAZAm2Ap4HuPzrMbQjSD+mRBl7SQG/ddrPyrsTlaS\n\tg82kUbE2H3upkuf8EHymFhsktp86hL22ShHdywXNAAOaraykmNz27CtR8YpRrkHoFsJ0\n\tNsgCHBzu+TpjhYFDQAUwWRfpYDtq7kU5LNAuGHUxf3U7uq/aXB6GRJk7K8MY1evgYzpE\n\tfQWjmRd08UH5tHha6rcEOOF63TtA6xVgMAGP5BXq8oORfa6cMWyoZEuRNDhN6AEDOp5n\n\tWPFw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1779262934; x=1779867734;\n\th=content-transfer-encoding:in-reply-to:from:content-language\n\t:references:cc:to:subject:user-agent:mime-version:date:message-id\n\t:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=UkU0i+aSJvECgbKVUvGM1MCgmIShBn5hoMB2R/I4alQ=;\n\tb=n+6IbP0nFaRUaqXpk7yf2tbpd0i9ylbui+R8ZHFq9NugsJPomlxBcmPtsT+vjmj4Wu\n\tqlf/QAOUdHWuOq6kAnUq57lFl30zngQgNcG81OkIkuxOdUf48Gawj/4cZptFC4uFB+hL\n\tHBbAvLngxE/1H9o8m72XYrOUKtPxLTOl9cIOZR7/IRE4GxsnQydnZQxE7pcASh/fJR7c\n\tpXDS4xmXAiO4XoLywD4JUDiitqZp9Fb8hidCJHVVTJvmW2gfMrZ1mKh5hAh1Fxn1/FTS\n\tFcEQc1vw4J0/S/uNhxPLQnPu/Ry0petoox5OcsUG+VmcEbH9FVVTS76E3+mURBMpSwnL\n\toQPA==","X-Forwarded-Encrypted":"i=1;\n\tAFNElJ8xa9oKGB2RZ80Ny3551YuBLadM8g9qqfPKFs6DFQrVa5IUtk4JAULYiAUkX7nWoAuzh6/Np0Xf3ULmeVnthEw=@lists.libcamera.org","X-Gm-Message-State":"AOJu0Yzc401ytJ+CgSpRDyqJphnp8ijcENpJvsUvwE9hwpWqT0TREvd1\n\tt6YopuT60RC4qjeteWMcNmEh+0n0vthsdnFaZfIZcuytPjVDLURPZ1FJstU25MF4Dlk=","X-Gm-Gg":"Acq92OGoYdkTr1pf+gPUZxpJxUYQPiVgr35BW7ApqNLxmM5ulUNq3rktGd1Eo2nUsxY\n\tFma5etDq7bGqLNxR4ELmdEv8b5ElET1xU+OHT1TIaDR5k+xevO04O99DKCVkc0cy31P0kIrJzld\n\tOGOo6loIjRbddC0CiEFCS0/JRhpHf+U6IXcr+Hnrw47xnIUO4/CgkiSI22ujMl6kYLt9eNGDcH/\n\tN+qse6WsIqRAePbM12+L6wfeOkomsEbDPn56/j/Dm1Zc49K4qHDYmds9DFz95ECgrrosaAZIAWa\n\tabNyJ5R4KBEH5yrj5W3i6EIFSRWtLxHYWQV+w7Qerl54gvN8177s369WZeB1JOQm0sFaqVmrJkD\n\tGUELLp9guUnfSpsBioXEPFpjtddqaZLCR7/1rwCDiShTBA7UO6w+YyQGZzhGnvdQvoO+eG3elzw\n\t+SYPCC/P/eXRexRpQZjgSI7w6hoDft1JrA2hw=","X-Received":"by 2002:a05:600d:8496:10b0:48f:eb8b:997e with SMTP id\n\t5b1f17b1804b1-48feb8b9ab1mr221088735e9.26.1779262933488; \n\tWed, 20 May 2026 00:42:13 -0700 (PDT)","Message-ID":"<6fe20dee-58db-43ec-aa25-5d2f59c67982@linaro.org>","Date":"Wed, 20 May 2026 08:42:12 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 4/4] debayer_egl: Sync output buffer after processing\n\tstats","To":"Robert Mader <robert.mader@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","References":"<20260518201508.140849-1-robert.mader@collabora.com>\n\t<0oKkG3ndOJeXx0ZaFU3T0XSPgEMyGVBGSJWLfq9oVtKrRYuUpEcm6lZv_ihUvUE1EG1PH3fzTByV9xU-g3Ya9g==@protonmail.internalid>\n\t<20260518201508.140849-5-robert.mader@collabora.com>\n\t<50c4f6ae-d9b3-4f75-bc28-cbc5c5117a2f@linaro.org>\n\t<a505b5fb-d33c-457b-9ec5-8e04167ea339@collabora.com>","Content-Language":"en-US","From":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","In-Reply-To":"<a505b5fb-d33c-457b-9ec5-8e04167ea339@collabora.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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":38935,"web_url":"https://patchwork.libcamera.org/comment/38935/","msgid":"<5f27b2bb-61d5-4c8a-b077-3148b3b016c5@collabora.com>","date":"2026-05-20T09:16:59","subject":"Re: [PATCH v2 4/4] debayer_egl: Sync output buffer after processing\n\tstats","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"On 20.05.26 09:42, Bryan O'Donoghue wrote:\n> On 19/05/2026 20:50, Robert Mader wrote:\n>> On 19.05.26 18:01, Bryan O'Donoghue wrote:\n>>> Interesting.\n>>>\n>>> I'm wondering what effect if any there is on the CPU cache as a \n>>> result of this change.\n>>>\n>>> In the round I think its a good change in theory but, being \n>>> difficult I'd also like some metrics to prove it out.\n>>>\n>>> Can we valgrind this or oprofile it and see what kind of \n>>> before/after metrics we get. \n>> I'll try to do some benchmarks. In theory the improved parallelism \n>> should simply shorten the overall time spend in process().\n>\n> I'm really just probing - now that we will operate on the same data in \n> parallel in the CPU and GPU - or could - what side-effect if any is \n> there on caches...\n>\n> Should be none, each xPU has its own view of memory, its own cache, \n> its own PTEs... \n\nI just tried to get some numbers for this running `cam -c ... -s \nwidth=1920,height=1080 --capture=60` a bunch of times on my Fairphone 5 \nand Pixel 3a (both set to the power safe governor). For the FP5 I \ncouldn't observe any meaningful difference, but on the (much weaker) \nPixel the impact seems to be both reliably reproducible and significant. \nFor the front camera - where dmabuf import works at this resolution - \nframe times drop from ~23000 us/frame to ~16000 us/frame. When changing \nkStatPerNumFrames from 4 to 1 - collecting stats every frame, as we only \nexpect to see changes on frames where stats are collected - the \ndifference is even more dramatic: dropping from ~39000 us/frame to \n~18000 us/frame. In both cases this is also reflected in the reported \nfps, 60 fps being reached much more reliably with the patch.\n\nSo at least in this specific scenario collecting stats every frame is \nnow almost as fast as only collecting them on every 4th frame, \nsuggesting that the limiting factor are the (pretty weak) GPU cores.\n\nI'll do some more tests later and include them in the commit message for v4.\n\nIn any case the numbers look quite encouraging, especially considering \nthat more complex shaders will likely tilt the balance even more to the \nGPU being the blocker.","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 B937FBDCBC\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 20 May 2026 09:17:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C84996175A;\n\tWed, 20 May 2026 11:17:11 +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 EA50B6175A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 May 2026 11:17:08 +0200 (CEST)","by mx.zohomail.com with SMTPS id 1779268623007765.5757900593458;\n\tWed, 20 May 2026 02:17:03 -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=\"EjXV7M0N\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1779268625; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=cTxRZdAALJJRdHajP2CwFHH+l1TVeaxDYZNET7ibrG674kYUnmTJPDgEIYWs75S7hoUmEE2q49uBuExjOgZM4zgjfuMTykMJe8+VT/UzPw1itTx9ANcpj0AjIhxkYekc6q4VqL7xdlyh0Lmr5zc/zoiXv/9IVklHFzfQGC18wcs=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1779268625;\n\th=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To;\n\tbh=RyCvia0ado4JmT0t/3mLV5afiKBAFiubFJmENnnaqcM=; \n\tb=EkXgWYfBp7g+XOiQBshGF8O7mH0UphT3DYgz8rug8ntxpnM3eRj4z/Zvm6z6ncfWu2hHHVqwFZArNFZhasDRw9WfUdk602lDUtYxGeZL/GdBMe1fzCebBs+XnXHdBitlTDLPKsgFA4ow/HB7lzWQD13KhCsNak+WoRB36bh40M4=","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=1779268625;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;\n\tbh=RyCvia0ado4JmT0t/3mLV5afiKBAFiubFJmENnnaqcM=;\n\tb=EjXV7M0NqDPL9dHEAz4bLap3/0V2t2oOeDAOi+TkD6z+LpRavVlT+OvqJnk0CBhG\n\tBsu6Qr85hlIKA+jEdl8/0wNbIkx2yq0Fg8xoykPNeKEgDoPQArp98BT+j7ouRxOcfgn\n\tr7cdFUaKkHVx1ZFgqcCH8YAxZYnOTA08ED/WK4ew=","Message-ID":"<5f27b2bb-61d5-4c8a-b077-3148b3b016c5@collabora.com>","Date":"Wed, 20 May 2026 11:16:59 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 4/4] debayer_egl: Sync output buffer after processing\n\tstats","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","References":"<20260518201508.140849-1-robert.mader@collabora.com>\n\t<0oKkG3ndOJeXx0ZaFU3T0XSPgEMyGVBGSJWLfq9oVtKrRYuUpEcm6lZv_ihUvUE1EG1PH3fzTByV9xU-g3Ya9g==@protonmail.internalid>\n\t<20260518201508.140849-5-robert.mader@collabora.com>\n\t<50c4f6ae-d9b3-4f75-bc28-cbc5c5117a2f@linaro.org>\n\t<a505b5fb-d33c-457b-9ec5-8e04167ea339@collabora.com>\n\t<6fe20dee-58db-43ec-aa25-5d2f59c67982@linaro.org>","Content-Language":"en-US, de-DE","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<6fe20dee-58db-43ec-aa25-5d2f59c67982@linaro.org>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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":38936,"web_url":"https://patchwork.libcamera.org/comment/38936/","msgid":"<e7bdbe9e-bf08-44ee-881d-c0832d95df46@collabora.com>","date":"2026-05-20T09:28:56","subject":"Re: [PATCH v2 4/4] debayer_egl: Sync output buffer after processing\n\tstats","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"On 20.05.26 11:16, Robert Mader wrote:\n>\n> On 20.05.26 09:42, Bryan O'Donoghue wrote:\n>> On 19/05/2026 20:50, Robert Mader wrote:\n>>> On 19.05.26 18:01, Bryan O'Donoghue wrote:\n>>>> Interesting.\n>>>>\n>>>> I'm wondering what effect if any there is on the CPU cache as a \n>>>> result of this change.\n>>>>\n>>>> In the round I think its a good change in theory but, being \n>>>> difficult I'd also like some metrics to prove it out.\n>>>>\n>>>> Can we valgrind this or oprofile it and see what kind of \n>>>> before/after metrics we get. \n>>> I'll try to do some benchmarks. In theory the improved parallelism \n>>> should simply shorten the overall time spend in process().\n>>\n>> I'm really just probing - now that we will operate on the same data \n>> in parallel in the CPU and GPU - or could - what side-effect if any \n>> is there on caches...\n>>\n>> Should be none, each xPU has its own view of memory, its own cache, \n>> its own PTEs... \n>\n> I just tried to get some numbers for this running `cam -c ... -s \n> width=1920,height=1080 --capture=60` a bunch of times on my Fairphone \n> 5 and Pixel 3a (both set to the power safe governor). For the FP5 I \n> couldn't observe any meaningful difference, but on the (much weaker) \n> Pixel the impact seems to be both reliably reproducible and \n> significant. For the front camera - where dmabuf import works at this \n> resolution - frame times drop from ~23000 us/frame to ~16000 us/frame. \n> When changing kStatPerNumFrames from 4 to 1 - collecting stats every \n> frame, as we only expect to see changes on frames where stats are \n> collected - the difference is even more dramatic: dropping from ~39000 \n> us/frame to ~18000 us/frame. In both cases this is also reflected in \n> the reported fps, 60 fps being reached much more reliably with the patch.\n>\n> So at least in this specific scenario collecting stats every frame is \n> now almost as fast as only collecting them on every 4th frame, \n> suggesting that the limiting factor are the (pretty weak) GPU cores.\n>\n> I'll do some more tests later and include them in the commit message \n> for v4.\n>\n> In any case the numbers look quite encouraging, especially considering \n> that more complex shaders will likely tilt the balance even more to \n> the GPU being the blocker.\n>\nP.S.: if anyone wants to test this before I send out v4, please use this \nbranch: \nhttps://gitlab.freedesktop.org/rmader/libcamera/-/commits/swisp-dmabuf-import-v4\n\nIt turned out that the improvement is only possible when running \nglFlush() before doing the CPU work (see last commit) - IIUC because we \notherwise starve the GPU.","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 83B1FBDCBD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 20 May 2026 09:29:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6837A62FD3;\n\tWed, 20 May 2026 11:29:07 +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 D6AE06175A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 May 2026 11:29:04 +0200 (CEST)","by mx.zohomail.com with SMTPS id 1779269339543711.0017489377036;\n\tWed, 20 May 2026 02:28:59 -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=\"JQwuCPIY\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1779269340; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=nCMlmXuQGph/JPOgTB5eVK5h9I4oTbCJGXyKBFA5cGdWJFB37jidN8Qk+lsInVo+3YsXobC4v82Swqs7tV1oCD+9kMQvO73rFU0s5kx7BoEH6hF2wkEc+7ZZi5B3abcc/4PV9vv0Bt+mwHXa6+4ReLyAYopZXQ+Mpvw4Ly3TIOk=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1779269340;\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=eP4W4YyM9ynuFc4wpDJtYYgfifnm7hU2Mi5FiAyGaL0=; \n\tb=B3RfeIe+q+eke/T76qFsT4ImkopGlKv7ytRSLmh1+0tWVgnna2xYzytOcfWCi9iOJYcDr/NQ651oKF+tveCerKj6tYVLrypdCl7xg6zjemzigIgE/GTuX9zVDLLftOBJK9vRPb5g+J8PK8Xfvm8FDp3aCFFrekQ7FbJHHR6JV6Y=","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=1779269340;\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=eP4W4YyM9ynuFc4wpDJtYYgfifnm7hU2Mi5FiAyGaL0=;\n\tb=JQwuCPIYF9I4vLmSqLDaOc3onXcdlaqPpu31UWfUlDQvl/kt698aveObnyRNvS4l\n\tXC5Q46KQi6Jg5HHZBi2ztdx2HQnVvPI6xImbT3PMph60DFGO2x21x8opcZqEPrBvcfN\n\tQU1g8pee/vesY3jKqk0arnLirAw7rPjDwbjX9hC4=","Message-ID":"<e7bdbe9e-bf08-44ee-881d-c0832d95df46@collabora.com>","Date":"Wed, 20 May 2026 11:28:56 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 4/4] debayer_egl: Sync output buffer after processing\n\tstats","To":"libcamera-devel@lists.libcamera.org","References":"<20260518201508.140849-1-robert.mader@collabora.com>\n\t<0oKkG3ndOJeXx0ZaFU3T0XSPgEMyGVBGSJWLfq9oVtKrRYuUpEcm6lZv_ihUvUE1EG1PH3fzTByV9xU-g3Ya9g==@protonmail.internalid>\n\t<20260518201508.140849-5-robert.mader@collabora.com>\n\t<50c4f6ae-d9b3-4f75-bc28-cbc5c5117a2f@linaro.org>\n\t<a505b5fb-d33c-457b-9ec5-8e04167ea339@collabora.com>\n\t<6fe20dee-58db-43ec-aa25-5d2f59c67982@linaro.org>\n\t<5f27b2bb-61d5-4c8a-b077-3148b3b016c5@collabora.com>","Content-Language":"en-US, de-DE","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<5f27b2bb-61d5-4c8a-b077-3148b3b016c5@collabora.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>"}}]