From patchwork Mon Sep 18 09:30:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Vinnicombe X-Patchwork-Id: 19055 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 9CF17BE080 for ; Mon, 18 Sep 2023 09:31:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0C93A62938; Mon, 18 Sep 2023 11:31:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1695029464; bh=uidR6VBRgk8hzyWN0fDV98DK9Kb9PlBgGbSTe8iXCOc=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=CCmF9Vjpa30fDlta82TQxlw3eY81zpmJeigQe0hh2iXxCeJQhpowO78GWM2ad0oru DzPinIPeO2X2/YsKIKD1IlTdK/kLBMEvTxapySBuo9LQk5O7Z6iEI++YS5s4Qz1N9L yh3KWxKz+MTQ7eT8w5EIpyzDdq3Adp/Pp37BADx1BAXfl5BCjHk3a+QIaL+vNMkKCk 5OExsdrEaNn8Vy59FJQ3lpXnE1K1MJBPdMzVsQvT+b4k/XyaUjQSfxxY0szaygbCwr M+xsqrFSHZNRHby1Et9KnSLx+I9OAemh7UsPgmMUE6xHLGdfdJe0H3X39kPRb2dw8f 0WZaZ0c7Px3ZQ== Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6767F61DEC for ; Mon, 18 Sep 2023 11:31:02 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="S+xwm4Ch"; dkim-atps=neutral Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-31ff985e292so2475232f8f.1 for ; Mon, 18 Sep 2023 02:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1695029461; x=1695634261; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=A6i05fcgB+dNiTWtI2Y8WsIMCjEipeIPSY2IM8U8LkU=; b=S+xwm4Chov2HvvkSe44BZX/STcfIdLt3m3uz1wTIAxerWt3cncB9mmAcrDdd4JNX4S d6+InVbjfY04aw2jvUHRPDpafQLFP4sLqi/GTN6g7VGQfP5qtYBigrJJRaJ0D5C1GkDE HmCk+2XTY9FE/epKIbP4rfk50Jl2dNm43iBYoTLi07zHRZQN/gs8kq57cVucbxDW7sXI dPPS8rdFhLOcFfexKtpNMqIdhsmoxL9AdOm7V7B8ccY7cPVqjJH/F2ezU/a5K14/eeHn 3j51u4iMVLKeqv3WYteBqH1OjR5SVraDTTKzESoL+DnQO1nAhwRENXF//1q9ZyWNhzIb BsNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695029461; x=1695634261; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=A6i05fcgB+dNiTWtI2Y8WsIMCjEipeIPSY2IM8U8LkU=; b=VOW/eFyM+by5EnkZLqBVztOLi0FsOtYM7UeNSB5BJimRweloBFB1SO4ELYKLWoXaAo Gk5J5KHeRLd4+m86rNDct/dEyaaxnSOrPgm5XoO21ZkDYvnpCEtpTM3lIq5p+cfeOOhq TBlKFTEgeXCCpLaKlQNRBpqUgjcqPlmM99r90aSH5PRN6OSuE9m6Ig15ggAjCiLHYy/C T5ceL/G7ZFATUfBGjxUcJa6TDgBKc5uYez14KzVQB4EJKNw2CIHMNg8mt78nj3ifZ/FT nAEI0b+IB795xN4y+XAHjdU/wV+CPYp+J3FCRiBNOXbr4hYlmti8ziORZ4XJvb53/n1H IKMw== X-Gm-Message-State: AOJu0YxnuLO990J4/Zlhvh4oDUkPIM2DsLBeBTl1C1mqRAjnTA3wPToC 0sPDDUnBtECVm7ZBltbwk1davglfYC37C4hBxMIpYA== X-Google-Smtp-Source: AGHT+IFrBXZLmT+KGCaMBVbzYL5bQWnJGAEzjB7UCg4pWLQ+xPB3y1ApAizHuUSebpD+O72vLmOO2g== X-Received: by 2002:adf:e585:0:b0:31f:b79a:c4b7 with SMTP id l5-20020adfe585000000b0031fb79ac4b7mr6942376wrm.24.1695029461452; Mon, 18 Sep 2023 02:31:01 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id l18-20020a5d4112000000b0031c6581d55esm12092807wrp.91.2023.09.18.02.31.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 02:31:00 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 18 Sep 2023 10:30:16 +0100 Message-Id: <20230918093016.22948-1-william.vinnicombe@raspberrypi.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] pipeline: rpi: vc4: Allocate more embedded data buffers 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: , X-Patchwork-Original-From: William Vinnicombe via libcamera-devel From: William Vinnicombe Reply-To: William Vinnicombe Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" If the pipeline runs out of embedded data buffers, then it will pass the frame to the IPA without the metadata. The IPA then has to use the delayed controls as inputs to the algorithms. This can cause problems with the subsequent algorithms if the sensor did not action the controls, especially with the autofocus as that doesn't have controls which can be passed in lieu of the metadata. Reduce the likelihood of this by increasing the number of embedded data buffers, as they are small so a generous number can be allocated. Signed-off-by: William Vinnicombe Reviewed-by: Naushir Patuck --- src/libcamera/pipeline/rpi/vc4/vc4.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp index 018cf488..6777c697 100644 --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp @@ -262,9 +262,9 @@ int PipelineHandlerVc4::prepareBuffers(Camera *camera) } else if (stream == &data->unicam_[Unicam::Embedded]) { /* * Embedded data buffers are (currently) for internal use, - * so allocate the minimum required to avoid frame drops. + * so allocate a generous number as they are small. */ - numBuffers = minBuffers; + numBuffers = 12; } else { /* * Since the ISP runs synchronous with the IPA and requests,