@@ -31,7 +31,7 @@ interface IPAIPU3Interface {
unmapBuffers(array<uint32> ids);
[async] queueRequest(uint32 frame, libcamera.ControlList controls);
- [async] fillParamsBuffer(uint32 frame, uint32 bufferId);
+ [async] fillParamsBuffers(uint32 frame, uint32 bufferId, uint32 captureBufferId);
[async] processStatsBuffer(uint32 frame, int64 frameTimestamp,
uint32 bufferId, libcamera.ControlList sensorControls);
};
@@ -25,7 +25,7 @@ from applications, and managing events from the pipeline handler.
└─┬───┬───┬──────┬────┬────┬────┬─┴────▼─┬──┘ 1: init()
│ │ │ │ ▲ │ ▲ │ ▲ │ ▲ │ 2: configure()
│1 │2 │3 │4│ │4│ │4│ │4│ │5 3: mapBuffers(), start()
- │ │ │ │ │ │ │ │ │ │ │ │ 4: (▼) queueRequest(), fillParamsBuffer(), processStatsBuffer()
+ │ │ │ │ │ │ │ │ │ │ │ │ 4: (▼) queueRequest(), fillParamsBuffers(), processStatsBuffer()
▼ ▼ ▼ ▼ │ ▼ │ ▼ │ ▼ │ ▼ (▲) setSensorControls, paramsBufferReady, metadataReady Signals
┌──────────────────┴────┴────┴────┴─────────┐ 5: stop(), unmapBuffers()
│ IPU3 IPA │
@@ -102,7 +102,7 @@ to operate when running:
- configure()
- queueRequest()
-- fillParamsBuffer()
+- fillParamsBuffers()
- processStatsBuffer()
The configuration phase allows the pipeline-handler to inform the IPA of
@@ -117,7 +117,7 @@ When configured, the IPA is notified by the pipeline handler of the
Camera ``start()`` event, after which incoming requests will be queued
for processing, requiring a parameter buffer (``ipu3_uapi_params``) to
be populated for the ImgU. This is given to the IPA through
-``fillParamsBuffer()``, and then passed directly to each algorithm
+``fillParamsBuffers()``, and then passed directly to each algorithm
through the ``prepare()`` call allowing the ISP configuration to be
updated for the needs of each component that the algorithm is
responsible for.
@@ -82,14 +82,14 @@ namespace ipa::ipu3 {
* parameter buffer, and adapting the settings of the sensor attached to the
* IPU3 CIO2 through sensor-specific V4L2 controls.
*
- * In fillParamsBuffer(), we populate the ImgU parameter buffer with
+ * In fillParamsBuffers(), we populate the ImgU parameter buffer with
* settings to configure the device in preparation for handling the frame
* queued in the Request.
*
* When the frame has completed processing, the ImgU will generate a statistics
* buffer which is given to the IPA with processStatsBuffer(). In this we run the
* algorithms to parse the statistics and cache any results for the next
- * fillParamsBuffer() call.
+ * fillParamsBuffers() call.
*
* The individual algorithms are split into modular components that are called
* iteratively to allow them to process statistics from the ImgU in a defined
@@ -146,7 +146,8 @@ public:
void unmapBuffers(const std::vector<unsigned int> &ids) override;
void queueRequest(const uint32_t frame, const ControlList &controls) override;
- void fillParamsBuffer(const uint32_t frame, const uint32_t bufferId) override;
+ void fillParamsBuffers(const uint32_t frame, const uint32_t bufferId,
+ const uint32_t captureBufferId) override;
void processStatsBuffer(const uint32_t frame, const int64_t frameTimestamp,
const uint32_t bufferId,
const ControlList &sensorControls) override;
@@ -508,12 +509,14 @@ void IPAIPU3::unmapBuffers(const std::vector<unsigned int> &ids)
/**
* \brief Fill and return a buffer with ISP processing parameters for a frame
* \param[in] frame The frame number
- * \param[in] bufferId ID of the parameter buffer to fill
+ * \param[in] bufferId ID of the video parameter buffer to fill
+ * \param[in] captureBufferId ID of the capture parameter buffer to fill
*
* Algorithms are expected to fill the IPU3 parameter buffer for the next
* frame given their most recent processing of the ImgU statistics.
*/
-void IPAIPU3::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)
+void IPAIPU3::fillParamsBuffers(const uint32_t frame, const uint32_t bufferId,
+ const uint32_t captureBufferId)
{
auto it = buffers_.find(bufferId);
if (it == buffers_.end()) {
@@ -536,6 +539,18 @@ void IPAIPU3::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)
*/
params->use = {};
+ for (auto const &algo : algorithms_)
+ algo->prepare(context_, params);
+
+ // TODO: use different algorithms to set StillCapture params.
+ it = buffers_.find(captureBufferId);
+ if (it == buffers_.end()) {
+ LOG(IPAIPU3, Error) << "Could not find capture param buffer!";
+ return;
+ }
+ mem = it->second.planes()[0];
+ params = reinterpret_cast<ipu3_uapi_params *>(mem.data());
+ params->use = {};
for (auto const &algo : algorithms_)
algo->prepare(context_, params);
@@ -1416,7 +1416,8 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer)
if (request->findBuffer(&rawStream_))
pipe()->completeBuffer(request, buffer);
- ipa_->fillParamsBuffer(info->id, info->paramBuffer->cookie());
+ ipa_->fillParamsBuffers(info->id, info->paramBuffer->cookie(),
+ info->captureParamBuffer->cookie());
}
void IPU3CameraData::paramBufferReady(FrameBuffer *buffer)