From patchwork Fri Oct 29 11:59:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanlin Chen X-Patchwork-Id: 14416 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 7FB2FBDB1C for ; Fri, 29 Oct 2021 11:59:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3407A600BF; Fri, 29 Oct 2021 13:59:33 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="bC5AkYXb"; dkim-atps=neutral Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 82B78600B8 for ; Fri, 29 Oct 2021 13:59:32 +0200 (CEST) Received: by mail-pg1-x534.google.com with SMTP id e65so9689451pgc.5 for ; Fri, 29 Oct 2021 04:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hjzU0vcbMQNXt//9GoOQNFctvc5bljeO++zFwPQaJEY=; b=bC5AkYXb0sxmIZsXY7v6NMpg2ZXYgqxa9HDGU5I94+8YiYIA2pS1RPvWriNfSAqLNS 8UD0UgU2shih1BrV14A0VUqp00JwNZOnLieTeieAT4lNU1Kd1x0CXn+ExJcqMmhq0Xxk Vs0Jfy+cKWDq2wl5fgd59aODzsHW56IVeRav0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hjzU0vcbMQNXt//9GoOQNFctvc5bljeO++zFwPQaJEY=; b=SucsQhQ1K6XCrQOMT6P3MedyuCCNfeAWddu4LBDkmz3inE+KFA1+4WqT0Ws+8ZaUcQ nEs3xYaLZjdUVu5mlPEHx7Hmr2wrDd3pLoVG8WaYg1+gvfv/3QrwxWOTgXEqge7qEfUx GcE505bXIpHdsv1f610HbPQZCyApPW1FB+A0McPM1wye8hiIryXRpo0FB0SNGaesTp// 4zCl+bh4V5BX2NpOY1iYIUCefKFOreEKupMYF80t8xQZfaDeIClBial8g0gZSpWSQQ2E X7MChuQEWrwjHt0bdGT8dWOKMcbgRfhQlowkABoTe3+wuR2NDYQXB0aZ0CB/oiMkyzhr 7LOA== X-Gm-Message-State: AOAM532Ch25BSD3H60PEOi5NqSznuG54SnMCnaSid4ruFihN2T1r4m7t 6bcVupsr88MEeWMlbx3qJ1wH/8/RRFsyGVOQ X-Google-Smtp-Source: ABdhPJzvqLcLCLS7y0XS6pEBWgplhrm52gKHpiOCj7wPDIROWlczNSzh6DRA0CXM2bypwpzsHFL/PQ== X-Received: by 2002:aa7:9633:0:b0:47b:ea78:f399 with SMTP id r19-20020aa79633000000b0047bea78f399mr10213250pfg.62.1635508770253; Fri, 29 Oct 2021 04:59:30 -0700 (PDT) Received: from localhost ([2401:fa00:1:10:35fe:d53b:684:b538]) by smtp.gmail.com with UTF8SMTPSA id s6sm7058044pfu.137.2021.10.29.04.59.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Oct 2021 04:59:30 -0700 (PDT) From: Han-Lin Chen To: libcamera-devel@lists.libcamera.org Date: Fri, 29 Oct 2021 19:59:15 +0800 Message-Id: <20211029115917.2467936-2-hanlinchen@chromium.org> X-Mailer: git-send-email 2.33.1.1089.g2158813163f-goog In-Reply-To: <20211029115917.2467936-1-hanlinchen@chromium.org> References: <20211029115917.2467936-1-hanlinchen@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/4] ipu3: ipa: Report effective sensor controls with stastistics to IPA 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" The Intel close sourced IPA requires the effective controls applied to the sensor when the stastistics are generated. Report effective sensor controls with the stastistics to IPA. Signed-off-by: Han-Lin Chen --- src/libcamera/pipeline/ipu3/frames.h | 3 +++ src/libcamera/pipeline/ipu3/ipu3.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/libcamera/pipeline/ipu3/frames.h b/src/libcamera/pipeline/ipu3/frames.h index 3ef7e445..a897e307 100644 --- a/src/libcamera/pipeline/ipu3/frames.h +++ b/src/libcamera/pipeline/ipu3/frames.h @@ -12,6 +12,7 @@ #include #include +#include #include namespace libcamera { @@ -34,6 +35,8 @@ public: FrameBuffer *paramBuffer; FrameBuffer *statBuffer; + ControlList effectiveSensorControls; + bool paramDequeued; bool metadataProcessed; }; diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 8816efc5..6a7f5b9a 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -667,6 +667,8 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c) return ret; } + data->delayedCtrls_->reset(); + return updateControls(data); } @@ -1363,6 +1365,8 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer) request->metadata().set(controls::SensorTimestamp, buffer->metadata().timestamp); + info->effectiveSensorControls = delayedCtrls_->get(buffer->metadata().sequence); + if (request->findBuffer(&rawStream_)) pipe()->completeBuffer(request, buffer); @@ -1419,6 +1423,7 @@ void IPU3CameraData::statBufferReady(FrameBuffer *buffer) ev.frame = info->id; ev.bufferId = info->statBuffer->cookie(); ev.frameTimestamp = request->metadata().get(controls::SensorTimestamp); + ev.sensorControls = info->effectiveSensorControls; ipa_->processEvent(ev); }