From patchwork Wed May 7 07:52:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 23342 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 A54A5C3226 for ; Wed, 7 May 2025 08:28:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1B1FB68B2C; Wed, 7 May 2025 10:28:01 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="gisJUzeO"; dkim-atps=neutral Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E9D7C68AD3 for ; Wed, 7 May 2025 10:27:57 +0200 (CEST) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-43cf825f46bso5806365e9.3 for ; Wed, 07 May 2025 01:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1746606477; x=1747211277; 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=gisJUzeOnjFP/YsqXgkkGQd8hRAgIwhsVaO66VyZf5FA6M/I9hqhJE05QuaENvIPXT LxgRlwjwlgn0d6pSiBp5Zkh0KCWXyUt8swjOkYBCRXcCNRNHMN7c3PPwJ89UiK6cvM7H K6Y0HN6SGHzLdyc/hiujSEMPRtmdH+R2RikcWUnk4mqaoYSove3qjOz5yn6YVDlEN9IL gnOm1y+NLyWcvpUjFJxOYMtZrq2BOay434vYtC6BTBCkbeeEraxTupLQQbJWbXzfD8sM RI0wmP5sb9+ntQn95LJ8mDUsqD/+BFEVCJwbbAuASM9YcdeM2mdbQ/5hjHitiPR4yF3L vHVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746606477; x=1747211277; 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=AR9rJcNDYvTG/dW5DgTcU3nR0k2eU1z/oM14K3OSWsjGCD4WPEg4vKdSG+VYc+IPXS CUMkq5m2EKzwmzBpQ0S+d7DbAP6OeI+P9WHIZHCjxRLsklQt0arjrPeeLP04zJ/huNj6 jiUgpC1enCYyVs8Z/QVbh7SdoDT4pgNuXMQwc2A9cdO4TjzjD3jYimMVwWCA8RXiZ3r1 n+s4bCwJ9ZQJvWn0cav+Xujg4Y8jCfdXuU3df86bRr8EBm0r3cjdQHevzXqI8pwReNum NcIHXbqLz5491HZf3h90XfohBuFGq9gdN+Boo75kO6QQmqbccY7M7MuwfXBVokvbYom3 qGLw== X-Gm-Message-State: AOJu0YzDt09SvfdXuO46p0RMyKHs8kc2SE+Q2LLGmN8Rit7W3FWrqlWI nqySWPVxzaZOnbJM/1zpn9057SSXvTf4LhyNTd2DN3RUExD2ji0niv558W12P+Xrpa9v7nBaEs+ I X-Gm-Gg: ASbGncsRGHBWnBJ0Z0zwd//A5k6Tq+/PPnQhbv5Yg5k07wtxGGi4Wwt19sh0mD0VBVM 3pcrl98gbXkB/uhEuoKKHNLVwFXIlTt0lAWH3/cjJ1ylGInB9Z73E2Vj0JoOc4T4jnOKnGgwsc4 8XswWxQwMpChwKW8HVJtc/S7ZgZVCP0pWpV0mIzETapw8YVt9UXvhFcqzz2gPpwOw1WmNFnCf4g dVDFog52QsOYfPuDLylFnFpozahODN0evNVsNFRpIS+GMRiwo1P0FqwDAlDm96Z0Dm+4kbLl83e fO3a5htW31qR/ZF81sqdwX0RpHCA4Fjo04I7ktUyYByBE9fEd9JyZNJqxOeBmaTdc7uuBTM= X-Google-Smtp-Source: AGHT+IGu+sIxewoMnakQwFrd+WtpFgPW8oYU700bgvVtqjA/1ds+luR965SVMGpBuRSl7mKdcytpiA== X-Received: by 2002:a05:600c:3554:b0:441:c5ee:cdb4 with SMTP id 5b1f17b1804b1-441d44dd442mr6653345e9.4.1746606477201; Wed, 07 May 2025 01:27:57 -0700 (PDT) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-441d440fff6sm22182575e9.25.2025.05.07.01.27.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 May 2025 01:27:56 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [RFC PATCH 1/6] libcamera: framebuffer: Add FrameMetadata::Status::FrameStartup Date: Wed, 7 May 2025 08:52:08 +0100 Message-ID: <20250507082753.2306743-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250507082753.2306743-1-naush@raspberrypi.com> References: <20250507082753.2306743-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 --- 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. */ /**