ipa: ipu3: List the events in their order of calling

The IPU3 IPA has three events which are handled from the pipeline
handler.

The events are received in the sequence, EventProcessControls,
EventFillParams, and finally EventStatReady, while the code lists these
in a different order.

Update the flow of IPAIPU3::processEvent() to match the expected
sequence of events, to help support the reader in interpreting the flow
of events through the IPA.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Jean-Michel Hautbois
2021-11-05 15:57:22 +01:00
parent 4b8c50bda2
commit a5b323e05d
+21 -14
View File
@@ -509,6 +509,13 @@ void IPAIPU3::unmapBuffers(const std::vector<unsigned int> &ids)
/**
* \brief Process an event generated by the pipeline handler
* \param[in] event The event sent from pipeline handler
*
* The expected event handling over the lifetime of a Request has
* the following sequence:
*
* - EventProcessControls : Handle controls from a new Request
* - EventFillParams : Prepare the ISP to process the Request
* - EventStatReady : Process statistics after ISP completion
*/
void IPAIPU3::processEvent(const IPU3Event &event)
{
@@ -517,20 +524,6 @@ void IPAIPU3::processEvent(const IPU3Event &event)
processControls(event.frame, event.controls);
break;
}
case EventStatReady: {
auto it = buffers_.find(event.bufferId);
if (it == buffers_.end()) {
LOG(IPAIPU3, Error) << "Could not find stats buffer!";
return;
}
Span<uint8_t> mem = it->second.planes()[0];
const ipu3_uapi_stats_3a *stats =
reinterpret_cast<ipu3_uapi_stats_3a *>(mem.data());
parseStatistics(event.frame, event.frameTimestamp, stats);
break;
}
case EventFillParams: {
auto it = buffers_.find(event.bufferId);
if (it == buffers_.end()) {
@@ -545,6 +538,20 @@ void IPAIPU3::processEvent(const IPU3Event &event)
fillParams(event.frame, params);
break;
}
case EventStatReady: {
auto it = buffers_.find(event.bufferId);
if (it == buffers_.end()) {
LOG(IPAIPU3, Error) << "Could not find stats buffer!";
return;
}
Span<uint8_t> mem = it->second.planes()[0];
const ipu3_uapi_stats_3a *stats =
reinterpret_cast<ipu3_uapi_stats_3a *>(mem.data());
parseStatistics(event.frame, event.frameTimestamp, stats);
break;
}
default:
LOG(IPAIPU3, Error) << "Unknown event " << event.op;
break;