From patchwork Mon May 19 09:20:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 23386 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 2B90BBD78E for ; Mon, 19 May 2025 09:22:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0330A68D83; Mon, 19 May 2025 11:22:54 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="h/5VoRLR"; dkim-atps=neutral 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 32ABC68B66 for ; Mon, 19 May 2025 11:22:52 +0200 (CEST) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3a374754e03so15388f8f.1 for ; Mon, 19 May 2025 02:22:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1747646571; x=1748251371; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Zd5df1quEaR166Fq4cu5Y3EUJiRzpvBQBh9y5xYqZPs=; b=h/5VoRLRFSyQe+1Ort3JrtAbNQnUlOyef82a2IkmsXsjtIzJ52eCX7oE4hxYSUjJxI 2svevYPO07B4/D2KvgnI2Nmc5c2p/qOs+qgkoUQWxbBxjxGpmdJbtirungP+Ta7kcvms Lkgle/++izaP4s1KeI12NZi5F9JevQ4pAHI18XjD3m5XwhK7afB1hvYLmdNjuh4okAEg hZNbCsVAiYUn1/40tM1JhJfubWLNQBFo4vWuCSxDy9Foi357mK7svB13scFko7bcNP81 u94TrGQKlmo3wm0Di3MxDIcLqH0KHIcwhkSIZlUgYQ11AS6qS4WAXvKfG8WtZiruC10W zLIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747646571; x=1748251371; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Zd5df1quEaR166Fq4cu5Y3EUJiRzpvBQBh9y5xYqZPs=; b=t3HN0x1M2AsiB/m295HA/+PGyo2sh624noUHis5fiDUQkUa4ezqzT773MYqMfy3ggV GljQ8DKHLhO9K51jvNier3bImGt8IMgrTlvVYrkdcBzx7rfmBtvhmf8ne8e5twocAz6Z 7rfewB4/ZQd/sOjuvWd+yXU1qT5B1pZ46GZw8+KiNgBroya2bVI2ASxb8zFULz7TnzWG LfnejfiCOjWSLMzot11/J7F1BnCFtPiaUIWYTPonvUkrEAROTGjgk906s9hqfO4B6juW 3yjBpvX4VC5xRfi4JkMMaj5E6l3eXs36oZ4+2XWaTaIwVCoX3d7LBcwrFeiAUt+XazKW b7VA== X-Gm-Message-State: AOJu0YyKuNewrd1kVTWIR4gztt2OhXF1lok//kvqbGYSbEZO2xlIlTzA /xiigD3fUtUipGnp1zOOA3V+J4bHRKVE76Oiacaz2k4CUAFWgr3z9dEEKbErrK0jA+2VFWaby/Z aAD5e X-Gm-Gg: ASbGncuXmUOgL8UvyPPHkLSDKkKmI7BomGs4MH+bHzLrzCvD05BASxYvIpJt1uGOD4r I9L5XNHv3L2IAjxDgSonJC4cuuB17igb2kGdZZDkMtwv+cjgZzH8ILAvixCGwMj7MglcPOU0kIH YJdeRIm0k/jJJ65ai+G6flL6Rti48gKwSrrqqg9FUjU5W5hGPP1H4GhHu2VEBdSG3QHd/YdJJFJ 7seyWO9dgs2AonYbVmyhWJ3vxVuo1JUK1+Ls4Iq3kKN1r0I6bbxkJKCasScKT2Q6xfu13j4S6jQ a1dStCB8E7dhqnvou88uoie0LDyuf3/q27+vXssLT+UqNfeZFoGhu3sHPvSu96mae+HTBfE= X-Google-Smtp-Source: AGHT+IGH0jjMMjxZatKIOHlGIhGeB6XfaUzBtNyhsIC2uUcITvRjiMdiddJBL6Qf8nKvs4aKk2JufQ== X-Received: by 2002:a05:6000:3112:b0:39f:728:4324 with SMTP id ffacd0b85a97d-3a35c825f55mr3565664f8f.9.1747646571527; Mon, 19 May 2025 02:22:51 -0700 (PDT) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a366e08747sm8645961f8f.95.2025.05.19.02.22.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 May 2025 02:22:51 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [PATCH v1 1/6] libcamera: framebuffer: Add FrameMetadata::Status::FrameStartup Date: Mon, 19 May 2025 10:20:49 +0100 Message-ID: <20250519092245.269048-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250519092245.269048-1-naush@raspberrypi.com> References: <20250519092245.269048-1-naush@raspberrypi.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" Add a new status enum, FrameStartup, used to denote that even though the frame has been successfully captured, the IQ parameters set by the IPA will cause the frame to be unusable and applications are advised to not consume this frame. An example of this would be on a cold-start of the 3A algorithms, and there will be large oscillations to converge to a stable state quickly. Additional, update the definition of the FrameError state to include its usage when the sensor is known to produce a number of invalid/error frames after stream-on. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman --- include/libcamera/framebuffer.h | 1 + src/libcamera/framebuffer.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h index ff83924300ac..e83825b466aa 100644 --- a/include/libcamera/framebuffer.h +++ b/include/libcamera/framebuffer.h @@ -26,6 +26,7 @@ struct FrameMetadata { FrameSuccess, FrameError, FrameCancelled, + FrameStartup, }; struct Plane { diff --git a/src/libcamera/framebuffer.cpp b/src/libcamera/framebuffer.cpp index 826848f75a56..36e56d593bc3 100644 --- a/src/libcamera/framebuffer.cpp +++ b/src/libcamera/framebuffer.cpp @@ -44,11 +44,18 @@ LOG_DEFINE_CATEGORY(Buffer) * of the FrameMetadata structure are valid. * \var FrameMetadata::FrameError * An error occurred during capture of the frame. The frame data may be partly - * or fully invalid. The sequence and timestamp fields of the FrameMetadata - * structure is valid, the other fields may be invalid. + * or fully invalid. This status may also indicate an invalid frame produced by + * the sensor during its startup or restart phase. The sequence and timestamp + * fields of the FrameMetadata structure is valid, the other fields may be + * invalid. * \var FrameMetadata::FrameCancelled * Capture stopped before the frame completed. The frame data is not valid. All * fields of the FrameMetadata structure but the status field are invalid. + * \var FrameMetadata::FrameStartup The frame has been successfully captured. + * However, the IPA is in a cold-start or reset phase and will result in image + * quality parameters producing unusable images. Applications are recommended to + * not consume these frames. All fields of the FrameMetadata structure are + * valid. */ /**