summaryrefslogtreecommitdiff
path: root/src/ipa/rkisp1/ipa_context.cpp
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2022-07-21 13:13:05 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-09-28 05:41:12 +0300
commit05e6a1937388403a5e754352f94569ef3c4d85c9 (patch)
tree98e45537fc422b20d4358e1713c5431256bceaf0 /src/ipa/rkisp1/ipa_context.cpp
parent9f5ab89fb30c2f9da2b1b57c096c6fdf0793a68e (diff)
ipa: rkisp1: Convert to use the FCQueue
Establish a queue of FrameContexts using the new FCQueue and use it to supply the FrameContext to the algorithms. The algorithms on the RKISP1 do not use this yet themselves, but are able to do so after the introduction of this patch. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/rkisp1/ipa_context.cpp')
-rw-r--r--src/ipa/rkisp1/ipa_context.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp
index d18f4996..e9846742 100644
--- a/src/ipa/rkisp1/ipa_context.cpp
+++ b/src/ipa/rkisp1/ipa_context.cpp
@@ -205,8 +205,7 @@ namespace libcamera::ipa::rkisp1 {
* \struct IPAFrameContext
* \brief Per-frame context for algorithms
*
- * This structure is currently unused and will be replaced by a real per-frame
- * context.
+ * \todo Populate the frame context for all algorithms
*/
/**
@@ -219,7 +218,8 @@ namespace libcamera::ipa::rkisp1 {
* \var IPAContext::activeState
* \brief The IPA active state, storing the latest state for all algorithms
*
- * \todo Introduce per-frame contexts
+ * \var IPAContext::frameContexts
+ * \brief Ring buffer of per-frame contexts
*/
} /* namespace libcamera::ipa::rkisp1 */
href='#n174'>174 175 176 177 178
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright (C) 2018, Google Inc.
 *
 * byte_stream_buffer.cpp - ByteStreamBuffer tests
 */

#include <array>
#include <iostream>

#include "libcamera/internal/byte_stream_buffer.h"

#include "test.h"

using namespace std;
using namespace libcamera;

class ByteStreamBufferTest : public Test
{
protected:
	int run()
	{
		/*
		 * gcc 11.1.0 incorrectly raises a maybe-uninitialized warning
		 * when calling data.size() below (if the address sanitizer is
		 * disabled). Silence it by initializing the array.
		 */
		std::array<uint8_t, 100> data = {};
		unsigned int i;
		uint32_t value;
		int ret;

		/*
		 * Write mode.
		 */
		ByteStreamBuffer wbuf(data.data(), data.size());

		if (wbuf.base() != data.data() || wbuf.size() != data.size() ||
		    wbuf.offset() != 0 || wbuf.overflow()) {
			cerr << "Write buffer incorrectly constructed" << endl;
			return TestFail;
		}

		/* Test write. */
		value = 0x12345678;
		ret = wbuf.write(&value);