-
Notifications
You must be signed in to change notification settings - Fork 1
Jmondi/rkisp1 ipu3 ipa/kbingham rfc/v2 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jmondi
wants to merge
15
commits into
master
Choose a base branch
from
jmondi/rkisp1-ipu3-ipa/kbingham-rfc/v2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
cbb5740
libcamera: request: Add support for error flags
Rahi374 e56fb99
fixup: libcamera: request: Add support for error flags
jmondi 2b4531f
libcamera: pipeline: uvcvideo: Report control errors
ed21439
libcamera: request: Add PFCError flag
98bde7d
ipa: ipu3: Move the Frame Context queue to libipa
4d3364d
fixup: Address Umang's review comments
jmondi e9e354a
fixup: Clean context at IPA::stop()
jmondi db69b09
fixup: Apply minor review comments
jmondi d351a6a
fixup: Harden frame context overwrite error condition
jmondi d9de4f7
ipa: rkisp1: Rename frameContext to activeState
6903b63
ipa: libipa: Provide a common base for FrameContexts
97d07ed
ipa: rkisp1: Convert to use the FCQueue
a1ff48b
ipa: libipa: algorithm: prepare(): Pass frame and frame Context
234db01
ipa: libipa: algorithm: process(): Pass frame number
0a30b3c
ipa: libipa: algorithm: queueRequest(): Pass frame context
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| /* SPDX-License-Identifier: LGPL-2.1-or-later */ | ||
| /* | ||
| * Copyright (C) 2022, Google Inc. | ||
| * | ||
| * fc_queue.cpp - IPA Frame context queue | ||
| */ | ||
|
|
||
| #include "fc_queue.h" | ||
|
|
||
| #include <libcamera/base/log.h> | ||
|
|
||
| namespace libcamera { | ||
|
|
||
| LOG_DEFINE_CATEGORY(FCQueue) | ||
|
|
||
| namespace ipa { | ||
|
|
||
| /** | ||
| * \file fc_queue.h | ||
| * \brief Queue to access per-frame Context | ||
| */ | ||
|
|
||
| /** | ||
| * \class FCQueue | ||
| * \brief A support class for queueing FrameContext instances through the IPA | ||
| * \tparam FrameContext The IPA specific FrameContext derived class type | ||
| * | ||
| * The frame context queue provides a simple circular buffer implementation to | ||
| * store IPA specific context for each frame through its lifetime within the | ||
| * IPA. | ||
| * | ||
| * FrameContext instances are expected to be referenced by a monotonically | ||
| * increasing sequence count corresponding to a frame sequence number. | ||
| * | ||
| * A FrameContext is initialised for a given frame when the corresponding | ||
| * Request is first queued into the IPA. From that point on the FrameContext can | ||
| * be obtained by the IPA and its algorithms by referencing it from the frame | ||
| * sequence number. | ||
| * | ||
| * A frame sequence number from the image source must correspond to the request | ||
| * sequence number for this implementation to be supported in an IPA. It is | ||
| * expected that the same sequence number will be used to reference the context | ||
| * of the Frame from the point of queueing the request, specifying controls for | ||
| * a given frame, and processing of any ISP related controls and statistics for | ||
| * the same corresponding image. | ||
| * | ||
| * IPA specific frame context implementations shall inherit from the | ||
| * IPAFrameContext base class to support the minimum required features for a | ||
| * FrameContext, including the frame number and the error flags that relate to | ||
| * the frame. | ||
| * | ||
| * FrameContexts are overwritten when they are recycled and re-initialised by | ||
| * the first access made on them by either initialise(frame) or get(frame). It | ||
| * is required that the number of available slots in the frame context queue is | ||
| * larger or equal to the maximum number of in-flight requests a pipeline can | ||
| * handle to avoid overwriting frame context instances that still have to be | ||
| * processed. | ||
| * | ||
| * In the case an application does not queue requests to the Camera fast | ||
| * enough, frames can be produced and processed by the IPA without a | ||
| * corresponding Request being queued. In this case the IPA algorithm | ||
| * will try to access the FrameContext with a call to get() before it | ||
| * had been initialized at queueRequest() time. In this case there | ||
| * is now way the controls associated with the late Request could be | ||
| * applied in time, as the frame as already been processed by the IPA, | ||
| * the PFCError flag is automatically raised on the FrameContext. | ||
| */ | ||
|
|
||
| /** | ||
| * \fn FCQueue::clear() | ||
| * \brief Clear the context queue | ||
| * | ||
| * Reset the queue and ensure all FrameContext slots are re-initialised. | ||
| * IPA modules are expected to clear the frame context queue at the beginning of | ||
| * a new streaming session, in IPAModule::start(). | ||
| */ | ||
|
|
||
| /** | ||
| * \fn FCQueue::initialise(uint32_t frame) | ||
| * \brief Initialize and return the Frame Context at slot specified by \a frame | ||
| * \param[in] frame The frame context sequence number | ||
| * | ||
| * The first call to obtain a FrameContext from the FCQueue should be handled | ||
| * through this call. The FrameContext will be initialised for the frame and | ||
| * returned to the caller if it was not already initialised. | ||
| * | ||
| * If the FrameContext was already initialized for this sequence, a warning will | ||
| * be reported and the previously initialized FrameContext is returned. | ||
| * | ||
| * Frame contexts are expected to be initialised when a Request is first passed | ||
| * to the IPA module in IPAModule::queueRequest(). | ||
| * | ||
| * \return A reference to the FrameContext for sequence \a frame | ||
| */ | ||
|
|
||
| /** | ||
| * \fn FCQueue::get() | ||
| * \brief Obtain the Frame Context at slot specified by \a frame | ||
| * \param[in] frame The frame context sequence number | ||
| * | ||
| * Obtains an existing FrameContext from the queue and returns it to the caller. | ||
| * | ||
| * If the FrameContext is not correctly initialised for the \a frame, it will be | ||
| * initialised and a PFCError will be flagged on the context to be transferred | ||
| * to the Request when it completes. | ||
| * | ||
| * \return A reference to the FrameContext for sequence \a frame | ||
| */ | ||
|
|
||
| } /* namespace ipa */ | ||
|
|
||
| } /* namespace libcamera */ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would still call this ErrorFlag
Each one is a flag that can be set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes indeed sense, I'll change it back