summaryrefslogtreecommitdiff
path: root/src/ipa/libipa/fc_queue.h
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo.mondi@ideasonboard.com>2024-10-16 12:20:16 +0200
committerJacopo Mondi <jacopo.mondi@ideasonboard.com>2024-10-30 15:48:18 +0100
commit93aa0ba55d6eaa0164fbe1d6c82fa245d3b2e5b1 (patch)
treeb041ccd8c2a4d6b2d837e24c1e1c666cc360b139 /src/ipa/libipa/fc_queue.h
parent66df26f7aa655c31a876c3f9baa4389a583b776e (diff)
libipa: FCQueue: Initialize FrameContext with activeState
Pass to the FCQueue the algorithm's active state to use the most recent state of IPA algorithms to initialize a FrameContext. Modify all IPA modules that use libipa to pass a const ActiveState reference to the FCQueue function and make their IPAActiveState implementation derive a base ActiveState structure. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Diffstat (limited to 'src/ipa/libipa/fc_queue.h')
-rw-r--r--src/ipa/libipa/fc_queue.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/ipa/libipa/fc_queue.h b/src/ipa/libipa/fc_queue.h
index bfcce5a8..48842e54 100644
--- a/src/ipa/libipa/fc_queue.h
+++ b/src/ipa/libipa/fc_queue.h
@@ -21,9 +21,16 @@ namespace ipa {
template<typename FrameContext>
class FCQueue;
+struct ActiveState {
+};
+
struct FrameContext {
+public:
+ virtual ~FrameContext() = default;
+
protected:
- virtual void init(const uint32_t frameNum)
+ virtual void init(const uint32_t frameNum,
+ [[maybe_unused]] const ActiveState &activeState)
{
frame = frameNum;
initialised = true;
@@ -52,7 +59,7 @@ public:
}
}
- FrameContext &alloc(const uint32_t frame)
+ FrameContext &alloc(const uint32_t frame, const ActiveState &activeState)
{
FrameContext &frameContext = contexts_[frame % contexts_.size()];
@@ -71,12 +78,12 @@ public:
LOG(FCQueue, Warning)
<< "Frame " << frame << " already initialised";
else
- frameContext.init(frame);
+ frameContext.init(frame, activeState);
return frameContext;
}
- FrameContext &get(uint32_t frame)
+ FrameContext &get(uint32_t frame, const ActiveState &activeState)
{
FrameContext &frameContext = contexts_[frame % contexts_.size()];
@@ -103,7 +110,7 @@ public:
* Make sure the FrameContext gets initialised if get()
* is called before alloc() by the IPA for frame#0.
*/
- frameContext.init(frame);
+ frameContext.init(frame, activeState);
return frameContext;
}
@@ -123,7 +130,7 @@ public:
LOG(FCQueue, Warning)
<< "Obtained an uninitialised FrameContext for " << frame;
- frameContext.init(frame);
+ frameContext.init(frame, activeState);
return frameContext;
}