From patchwork Thu May 22 07:48:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 23416 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 D8EC7C31E9 for ; Thu, 22 May 2025 07:52:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7846868D9C; Thu, 22 May 2025 09:52:53 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="erC//0aG"; dkim-atps=neutral Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A2D0568D85 for ; Thu, 22 May 2025 09:52:48 +0200 (CEST) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3a36977f261so759925f8f.1 for ; Thu, 22 May 2025 00:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1747900368; x=1748505168; 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=7kayUoIMXpwu00j/brvCdM7ksfHri9lnN79748W/YaY=; b=erC//0aGiif6kN17Aiw2ynzh5NE2xV6fu0xCuoOUntOdULuqSY4Wn1m/XU6DiRg1qJ h4Jo4WcVQUyJL3110IHMbDVYYWP0qO2HkSwjiWfjHxqzPO+yy0blYjBC3d4v4aEDTLtc ZxEZLQw9+1jpNjenMZXzGyWTE+U9VMKgkk1HbOa3bm/198+Bn3EwOcKid1iiDewEpH3r 5JaMBkOfMuBHtWmHaw1AqWL8R2uePokeY3iJoqeRMacpZmmBThPcCh8RGMc9toWvloMt fMK/q1lU4v9K2qzOE+BEzvZEkNka4CRZfboIMQBk7Kdap65qfQ85xgx3aLJ6FaX/PLif rBAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747900368; x=1748505168; 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=7kayUoIMXpwu00j/brvCdM7ksfHri9lnN79748W/YaY=; b=ZlGmi70g/YSjs/+Nkimxvg/g+50JBCpQtrI158S8Cg5qAAwUhN9f3mbh16S3rrKQhm vqDozvohroqBdEg3rCIHGHQiTLMloo/0N5q/OyVHdt4VYtgQnFkV/4B5FrUpt6fEvKc4 hNXx39+BoG0YqkBRItMOgqSOkY1t4WUj8ZGVuDh9RNC7w91L4zHIUJi/A7rb4n+8g54o PnTLjdCQRO3s+SHodXtQlvT0YDCjtpWvaJOUcExnfqXRTlhEWhsx4B3cPIP+1P+AkPLM QRsL1r3reFpk5a6CXBXE5HIGqWlSyJ5QoThIZU8U2JQZbS+K0DFJBy3wRHaYRlcd5Tqe KKsA== X-Gm-Message-State: AOJu0YyK86s8voWWhb99JEVmtCJ+vtXhWCVGYf1NAchDWB0k95ZJ58vn /frvqegH4n5EfRFaFx6Mse+7SR0zn1pGz5IVtAmWFbeTHq9ofkcW/2Y3zUIi+ApayIWsu0UvneJ YKod+ X-Gm-Gg: ASbGncsxPNrGrtbmY5AjuzZ7o4Wj1zR/aO+pFdgpKeg84SAORJAv76MtDL60yZVDMFZ 3sIaXpbrZHyzNjTOxeUuyRgK+47inE6L0V/dtf+tDdMFkiyNxiDSqRbsid+5zbQJgMdJJXzChZv gZSD0VBZBjuQv5FJoebeIaaQo7Dx8mjO2o5KJ/rCLiRw9AorMNbdJg68xHvHz+n7ZNbsZavszEy VMJ00flglZypzTzYGtdexKy15Nfy4VXJthkqLiMzwrWRB3feiYbCM9lqZstNELwSCjMkbE3px2d fmOJOgVcNfljmbtSTG5mdub07KFroBCcmD63N9rINZctRd6Ee+XIHN1Z2P6/6+VM5JefdjL4+Ag zIf0cBw== X-Google-Smtp-Source: AGHT+IHM7X6ypTp7FpdsQW8WofCwrmZj5vVnUYpkWX/0xUqzhS4XXJLTmEsIn4i6h73/Tn6S9p4EbQ== X-Received: by 2002:a05:600c:a07:b0:442:f97a:fee7 with SMTP id 5b1f17b1804b1-442fd6770e0mr85986315e9.6.1747900367926; Thu, 22 May 2025 00:52:47 -0700 (PDT) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a3ca066eb7sm4191516f8f.2.2025.05.22.00.52.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 00:52:47 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , David Plowman Subject: [PATCH v2 1/6] libcamera: framebuffer: Add FrameMetadata::Status::FrameStartup Date: Thu, 22 May 2025 08:48:17 +0100 Message-ID: <20250522075244.1198110-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250522075244.1198110-1-naush@raspberrypi.com> References: <20250522075244.1198110-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 cover the 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 | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 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..93be497be052 100644 --- a/src/libcamera/framebuffer.cpp +++ b/src/libcamera/framebuffer.cpp @@ -43,12 +43,19 @@ LOG_DEFINE_CATEGORY(Buffer) * The frame has been captured with success and contains valid data. All fields * 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. + * The frame data is partly or fully corrupted, missing or otherwise invalid. + * This can for instance indicate a hardware transmission error, or invalid data + * produced by the sensor during its startup phase. The sequence and timestamp + * fields of the FrameMetadata structure is valid, all 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 other fields of the FrameMetadata structure are + * valid. */ /**