From patchwork Thu Sep 26 21:07:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Mader X-Patchwork-Id: 21392 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 6EA37C0F1B for ; Thu, 26 Sep 2024 21:08:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9B1EB6350F; Thu, 26 Sep 2024 23:08:16 +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="U2Amn3FO"; 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 6CE80618DA for ; Thu, 26 Sep 2024 23:08:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; t=1727384891; cv=none; d=zohomail.com; s=zohoarc; b=UzV9cXt4KPe9oOxVqJdhu+ydkoaO5u6JBHvkOjU+Oj4Id8z0DRwhv0SZsMkkbLFQTTCfUBoQVgVKUiFc1LgpEo6u+c0EcUGh63O1DgRK0t4S1RaOcMq1cpR6nmtwwSu1fkbQJ+86DkhSSOCHZCWfNs1nwTcbf6Cun4kJZlyIVVQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727384891; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=Xcrj9yt0awYj4NytEbp96oMa+ELg9DIiDQxb2JnccJE=; b=BjNBssfvq3glNVblW/1p01kJuxhbnYTQJEFCfQACfmr0TrwC4cmm5e35F9dKP18KgX+vDvxxQfPprmxrQ6iBzu2baFF/geVNruQkLAYobnqgFrVSaI+RVKL9p82vLmk3ips4Zal9IOvtXa8bM+8OA8CStp087Wfn132kszjm6pQ= 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=1727384891; s=zohomail; d=collabora.com; i=robert.mader@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=Xcrj9yt0awYj4NytEbp96oMa+ELg9DIiDQxb2JnccJE=; b=U2Amn3FOIrrOH5+X6Q2ZzYa9ELWf2lAYt4ZGhrGdepzrWhibb91WnvdUvboY2JId gI+DtRdi7pFVw8jf9lfxfEO2rqEOSnPILIsvjADnMnrgivF6blYXmWeZ8FQY9tYmCwS ENAkcySRieGRwfGKyPa1W2nQ5ZM4zDFDvZBKv6FQ= Received: by mx.zohomail.com with SMTPS id 17273848905881017.566238008793; Thu, 26 Sep 2024 14:08:10 -0700 (PDT) From: Robert Mader To: libcamera-devel@lists.libcamera.org Cc: Robert Mader Subject: [PATCH] pipeline: simple: Increase buffer count to four Date: Thu, 26 Sep 2024 23:07:39 +0200 Message-ID: <20240926210739.27480-1-robert.mader@collabora.com> X-Mailer: git-send-email 2.46.2 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" Which is not only what many other pipeline handlers use, but also a good lower limit when dealing with DRM and similar APIs. Even Mesas EGL and Vulkan WSI implementations use for the reason outlined in mesa commit 992a2dbba80aba35efe83202e1013bd6143f0dba: > When the compositor is directly scanning out from the application's buffer it > may end up holding on to three buffers. These are the one that is is currently > scanning out from, one that has been given to DRM as the next buffer to flip > to, and one that has been attached and will be given to DRM as soon as the > previous flip completes. When we attach a fourth buffer to the compositor it > should replace that third buffer so we should get a release event immediately > after that. This patch therefore also changes the number of buffer slots to 4 > so that we can accomodate that situation. Given the popularity of this buffer number the bump should be unlikely to cause problems. At the same time it may help with performance or even work around glitches. The previous number was introduced in commit a8964c28c80fb520ee3c7b10143371081d41405a without mentioning a specific reason against the change at hand. Signed-off-by: Robert Mader Reviewed-by: Umang Jain Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/simple/simple.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 81915573..78ce9232 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -1135,7 +1135,7 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate() cfg.frameSize = format.planes[0].size; } - cfg.bufferCount = 3; + cfg.bufferCount = 4; } return status;