From patchwork Thu Oct 28 10:03:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanlin Chen X-Patchwork-Id: 14388 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 6A483BF415 for ; Thu, 28 Oct 2021 10:03:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1B08E600C4; Thu, 28 Oct 2021 12:03:29 +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="fslmLtEX"; dkim-atps=neutral Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3AB7C600BF for ; Thu, 28 Oct 2021 12:03:26 +0200 (CEST) Received: by mail-pj1-x102b.google.com with SMTP id nn3-20020a17090b38c300b001a03bb6c4ebso4282952pjb.1 for ; Thu, 28 Oct 2021 03:03:26 -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=KwoGT7NzquHqxePhlUMI5IGOo9vSGuIcTWArhUGmf98=; b=fslmLtEXoftsGPnXpqatmwWxnSqo5Q62ZnK4fTvhGa7c/I0Ew+eaJjMJRkQurKQtQv oBhjN47++KCRDLUu9reWWjWZb0pHl+WYLaXXzQkcVMltflKRLT1gsxW3dT9GudVVGD1x Fjfu2Fws7hjqwlJ7SOpYfpgaOjCKoS2QpYnLI= 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=KwoGT7NzquHqxePhlUMI5IGOo9vSGuIcTWArhUGmf98=; b=0LWvP6he48IpWbYBZO0ozoRAA5+NT6ngoJpClxzVIe1MCybybSHP2eRJWw4fsoL9Bb nQT5j9fTjrd2ZJQ+b8n1b+M5ocV43O4nrkF6vYfA1vLThQozJeg2upwsVExgDNPScVPD 1JX+JfkNNOyTxhgkYFz8rarzTUsnEN0OP2dR2QsN+qc5D0gp0REAIvh4UPBT7kmUYXTY UW4hmthi+YY7Uh/qV+8UL94O38LX5CuRMWy5lJ8KHsR5Wqzv85oYIIuK410yYV7j+LsH eg7399GqDMu1ufrrjLU+qYxFw9Zc7TxsIg4wGJ+FDcfi1ysggQdyNCEqgEpVFNeKbhDi o8Mw== X-Gm-Message-State: AOAM531PwEj5UYxFX7rNUbE+oKNSLsKAeDgTRZtLMFOzQZNqx0FR9YAL ZbGd7W3wi9UFIyRH/9Rh0cAifyw+rKS+JTyT X-Google-Smtp-Source: ABdhPJwsxFMF4mEl1k5V0gUUsS3SbuZEQ118xtDza7sllhAv2KfT9GSU+70nEczfRMb5RBwOFuA+hQ== X-Received: by 2002:a17:90b:1bce:: with SMTP id oa14mr11714387pjb.225.1635415404560; Thu, 28 Oct 2021 03:03:24 -0700 (PDT) Received: from localhost ([2401:fa00:1:10:1bc:52e7:6df5:c7cf]) by smtp.gmail.com with UTF8SMTPSA id y13sm2960550pfa.43.2021.10.28.03.03.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Oct 2021 03:03:24 -0700 (PDT) From: Han-Lin Chen To: libcamera-devel@lists.libcamera.org Date: Thu, 28 Oct 2021 18:03:17 +0800 Message-Id: <20211028100319.1097720-2-hanlinchen@chromium.org> X-Mailer: git-send-email 2.33.1.1089.g2158813163f-goog In-Reply-To: <20211028100319.1097720-1-hanlinchen@chromium.org> References: <20211028100319.1097720-1-hanlinchen@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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: , Cc: Han-Lin Chen 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); }