From patchwork Tue May 19 19:39:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Mader X-Patchwork-Id: 26785 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 23889C3301 for ; Tue, 19 May 2026 19:39:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 85EE663042; Tue, 19 May 2026 21:39:47 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=collabora.com header.i=robert.mader@collabora.com header.b="aAZzoyjN"; dkim-atps=neutral Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7E53C63039 for ; Tue, 19 May 2026 21:39:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; t=1779219580; cv=none; d=zohomail.com; s=zohoarc; b=lQw0oBvo1Fynu5UUsuz1cSSxjy+SCnQ1Qi7hQHDvqqiDiTSzFVlwu5xIU5zA8lX4umEbepaWZ+pvLsuaqR6VkTlNtWEuI4X9uW4fXfY4YWU1Y3HGB7hMRr+sqA+XoTMRepJF8M7o7hSP0JQnT3FxxTFZV5ZJhXJigl30hsn1edI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779219580; h=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; bh=9IpGrraSJ7sUGI34EHGr3n24fwxPRGwvRVz0XyOZyZI=; b=EyccH1Yb2UH2oikNNCzxeXWN4GJ4COBeOEVcW4oB+Yc1zGEQF7HMh6ZSC0wS8Tfp1jleE7x6TvkTSv9HqZDq1Z12Hpd6srqk6kac1k+q74s0493VmqS9CgNQ/jtxVLNVqLVBXKnpRijmTxetxad837KWE+r995SoobXpMpZF9l4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=robert.mader@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1779219580; s=zohomail; d=collabora.com; i=robert.mader@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=9IpGrraSJ7sUGI34EHGr3n24fwxPRGwvRVz0XyOZyZI=; b=aAZzoyjN+kFGhQO0gZLufXrg+0JLfjLzRvk+2sPybukXSIuiBcojW+eJI+L0qgFR eEfLkroynlVQyx2vBseB2nhBZGYl9UHtgTT42xoFP4y5JHw78QmiahrpQmGLDPRux2y 7RFDy4PCCSrhHzc7Zi0j31n8O4nPBk+sMuH3jl5o= Received: by mx.zohomail.com with SMTPS id 1779219579147677.4954399650786; Tue, 19 May 2026 12:39:39 -0700 (PDT) From: Robert Mader To: libcamera-devel@lists.libcamera.org Cc: Robert Mader , =?utf-8?q?Barnab=C3=A1s_P?= =?utf-8?b?xZFjemU=?= Subject: [PATCH v3 5/5] debayer_egl: Sync output buffer after processing stats Date: Tue, 19 May 2026 21:39:07 +0200 Message-ID: <20260519193907.86812-6-robert.mader@collabora.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260519193907.86812-1-robert.mader@collabora.com> References: <20260519193907.86812-1-robert.mader@collabora.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Instead of waiting for the GPU to finish the output buffer *before* computing stats, do so afterwards. This allows work to happen in parallel on the GPU and CPU, potentially improving throughput and reducing latency. This, however, requires us to include stats computation into the debayer benchmark data. Signed-off-by: Robert Mader Reviewed-by: Barnabás Pőcze --- src/libcamera/software_isp/debayer_egl.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp index 750895d10..41176973b 100644 --- a/src/libcamera/software_isp/debayer_egl.cpp +++ b/src/libcamera/software_isp/debayer_egl.cpp @@ -536,8 +536,6 @@ int DebayerEGL::debayerGPU(FrameBuffer *input, std::optional *inputBu if (err != GL_NO_ERROR) { LOG(eGL, Error) << "Drawing scene fail " << err; return -ENODEV; - } else { - egl_.syncOutput(); } return 0; @@ -560,8 +558,6 @@ void DebayerEGL::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output goto error; } - bench_.finishFrame(); - metadata.planes()[0].bytesused = output->planes()[0].length; /* Calculate stats for the whole frame */ @@ -570,6 +566,9 @@ void DebayerEGL::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output stats_->processFrame(frame, 0, input); inputBufferDmaSyncer.reset(); + egl_.syncOutput(); + bench_.finishFrame(); + outputBufferReady.emit(output); inputBufferReady.emit(input);