[{"id":31023,"web_url":"https://patchwork.libcamera.org/comment/31023/","msgid":"<a7044cb9-b5d7-4102-9f0c-ec47386c15de@collabora.com>","date":"2024-08-31T19:02:21","subject":"Re: [PATCH] libcamera: debayer_cpu: Report buffer sync times","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"Whoops, this was the wrong commit, please ignore. Sorry!\n\nOn 31.08.24 20:59, Robert Mader wrote:\n> ---\n>   src/libcamera/software_isp/debayer_cpu.cpp | 10 ++++++++++\n>   1 file changed, 10 insertions(+)\n>\n> diff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp\n> index 6c953b03..e51ab6ff 100644\n> --- a/src/libcamera/software_isp/debayer_cpu.cpp\n> +++ b/src/libcamera/software_isp/debayer_cpu.cpp\n> @@ -735,6 +735,8 @@ void DebayerCpu::process(FrameBuffer *input, FrameBuffer *output, DebayerParams\n>   \t\tclock_gettime(CLOCK_MONOTONIC_RAW, &frameStartTime);\n>   \t}\n>   \n> +\ttimespec time0 = {};\n> +\tclock_gettime(CLOCK_MONOTONIC_RAW, &time0);\n>   \tfor (const FrameBuffer::Plane &plane : output->planes()) {\n>   \t\tconst int fd = plane.fd.get();\n>   \t\tstruct dma_buf_sync sync = { DMA_BUF_SYNC_START };\n> @@ -744,6 +746,10 @@ void DebayerCpu::process(FrameBuffer *input, FrameBuffer *output, DebayerParams\n>   \t\tif (ioctl (fd, DMA_BUF_IOCTL_SYNC, &sync) < 0)\n>   \t\t\tLOG(Debayer, Error) << \"Syncing buffer FD \" << fd << \"failed: \" << errno;\n>   \t}\n> +\ttimespec time1 = {};\n> +\tclock_gettime(CLOCK_MONOTONIC_RAW, &time1);\n> +\tint64_t time_sync = timeDiff(time1, time0);\n> +\tLOG(Debayer, Warning) << \"Syncing input buffers start: \" << time_sync / 1000 << \"us\";\n>   \n>   \tgreen_ = params.green;\n>   \tred_ = swapRedBlueGains_ ? params.blue : params.red;\n> @@ -772,6 +778,7 @@ void DebayerCpu::process(FrameBuffer *input, FrameBuffer *output, DebayerParams\n>   \n>   \tmetadata.planes()[0].bytesused = out.planes()[0].size();\n>   \n> +\tclock_gettime(CLOCK_MONOTONIC_RAW, &time0);\n>   \tfor (const FrameBuffer::Plane &plane : output->planes()) {\n>   \t\tconst int fd = plane.fd.get();\n>   \t\tstruct dma_buf_sync sync = { DMA_BUF_SYNC_END };\n> @@ -781,6 +788,9 @@ void DebayerCpu::process(FrameBuffer *input, FrameBuffer *output, DebayerParams\n>   \t\tif (ioctl (fd, DMA_BUF_IOCTL_SYNC, &sync) < 0)\n>   \t\t\tLOG(Debayer, Error) << \"Syncing buffer FD \" << fd << \"failed: \" << errno;\n>   \t}\n> +\tclock_gettime(CLOCK_MONOTONIC_RAW, &time1);\n> +\ttime_sync = timeDiff(time1, time0);\n> +\tLOG(Debayer, Warning) << \"Syncing input buffers end: \" << time_sync / 1000 << \"us\";\n>   \n>   \t/* Measure before emitting signals */\n>   \tif (measuredFrames_ < DebayerCpu::kLastFrameToMeasure &&","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 0E1D6C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 31 Aug 2024 19:02:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EDB0463471;\n\tSat, 31 Aug 2024 21:02:29 +0200 (CEST)","from sender4-op-o10.zoho.com (sender4-op-o10.zoho.com\n\t[136.143.188.10])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CB1D561900\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 31 Aug 2024 21:02:27 +0200 (CEST)","by mx.zohomail.com with SMTPS id 1725130943260776.2864129746788;\n\tSat, 31 Aug 2024 12:02:23 -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=\"O4i3V6Y5\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1725130945; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=O944hG+LNkOAko3fPwlaoczwwPMetJZNkrNlcgT8qKEAyL9AKcBQKQO0n5A+aGvggKR6v+PHkx0nACa3RjFiuJW0HBlpfpGSoJ9d8mmfaFDjsqGvIanB3j9cC6LUhFuldkaQI4cRXX2A9F07qnqG2iCRSfTMdJ5PPPix5hByWxs=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1725130945;\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=+3rh59CZOEON4ge1KnFdYaCXsLUuscRRR2Gw1U51f90=; \n\tb=nqJHO1ZFH6up+ItQJ3dfF9M2kbiu7+IJcTGHoh87OqpafUe8IkeoaaGWxJZ/j/iUJvbB0dkGR5XjxTIOvxYBNVqXNzHaa/OpFzEYFf+X6fLVXjHWZJRyE3qS+Jpwq9X20KF8mrT9sueQvIUUTA3JEUGu4OlUnxLDjnEzmn/MCr4=","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=1725130945;\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=+3rh59CZOEON4ge1KnFdYaCXsLUuscRRR2Gw1U51f90=;\n\tb=O4i3V6Y5FsNRRtttERVTElHdcgxeCh6Gd5og679ntwUXANaGbulGcq3y1amlZ6p1\n\t7CmY/invUROwAXXQfToR9n563SLXTbXE5rS8tig0HiiHwo8IVfbTHzx9dyAsHTnN+f3\n\tWsEKhFPqxmtetTcQOdYr2CFZQwBCjNjOxNCJlKIg=","Message-ID":"<a7044cb9-b5d7-4102-9f0c-ec47386c15de@collabora.com>","Date":"Sat, 31 Aug 2024 21:02:21 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] libcamera: debayer_cpu: Report buffer sync times","To":"libcamera-devel@lists.libcamera.org","References":"<20240831185927.125879-1-robert.mader@collabora.com>","Content-Language":"en-US, de-DE","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<20240831185927.125879-1-robert.mader@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>"}}]