From patchwork Mon May 18 20:15:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Mader X-Patchwork-Id: 26772 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 066C7C32F4 for ; Mon, 18 May 2026 20:16:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AECCC63025; Mon, 18 May 2026 22:16:23 +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="hponlkvw"; 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 55F1263025 for ; Mon, 18 May 2026 22:16:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; t=1779135376; cv=none; d=zohomail.com; s=zohoarc; b=SdynNuFoxC6mRh3yRzRAy3kzZu+Qz5npyhRXEgiRcsLfFsYAQXFBMbO5NxsbqFfYgx+8Dyvo7NM3OU4/dZSjPCbIeDYklPcXx4HOF2AArXYe5gF51INRFYAR8i76+bu83g1ScWK21XFLiPw246QXSM76/T6FPkjvcHfnQhFR3/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779135376; 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=z04t+WWR8x1KGFPoPbqytUTK3kj7WYJMqqN20b+oqYw=; b=lS9nMvwinjj2NtOaMH3QiXOr9GyJQgynB1IMdrxnSLIgRSwVO4LMw7MynLzZCkCNYBdLOwiYmsVYxnuEKYBt/5nUWZVttgRdCOd+0BV3YaojrFH3TNAOafEAWmhTr2ikICOKe0hOaOrtkrNKuXPZAcicn/eHWXNyb1WXUD6APqQ= 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=1779135376; 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=z04t+WWR8x1KGFPoPbqytUTK3kj7WYJMqqN20b+oqYw=; b=hponlkvw1MbxAsfGcKyrYnkSveyVWokEVQnj1RE+zhbHbUCQrPx5SDe0khO3gF6M WASXrn9UzaEiYtTdyoI2aj4fN1Fp2GRWK3tBbbQUcxB/rnS2200fFTnfs15XPmyCDy8 rFvQl3bjoNjiLNI5H/cir5PZ09UTse/pwcwPymyQ= Received: by mx.zohomail.com with SMTPS id 1779135375002510.8641157658823; Mon, 18 May 2026 13:16:15 -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 v2 4/4] debayer_egl: Sync output buffer after processing stats Date: Mon, 18 May 2026 22:15:08 +0200 Message-ID: <20260518201508.140849-5-robert.mader@collabora.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260518201508.140849-1-robert.mader@collabora.com> References: <20260518201508.140849-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 e5a661d2c..9ad0c871f 100644 --- a/src/libcamera/software_isp/debayer_egl.cpp +++ b/src/libcamera/software_isp/debayer_egl.cpp @@ -530,8 +530,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; @@ -554,8 +552,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 */ @@ -564,6 +560,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);