ipa: rpi: Add statsInline to the Controller hardware description

Add a new boolean field (statsInline) to Controller::HardwareConfigMap.
This field indicates where the statistics are generated in the hardware
ISP pipeline. For statsInline == true, statistics are generated before
the frame is processed (e.g. the PiSP case), and statsInline == false
indicates statistics are generated after the frame is processed (e.g.
the VC4 case).

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Naushir Patuck 2023-10-13 08:48:28 +01:00 committed by Kieran Bingham
parent 0548079581
commit 11c939a200
3 changed files with 17 additions and 6 deletions

View file

@ -429,11 +429,10 @@ void IpaBase::prepareIsp(const PrepareParams &params)
} }
/* /*
* If a statistics buffer has been passed in, call processStats * If the statistics are inline (i.e. already available with the Bayer
* directly now before prepare() since the statistics are available in-line * frame), call processStats() now before prepare().
* with the Bayer frame.
*/ */
if (params.buffers.stats) if (controller_.getHardwareConfig().statsInline)
processStats({ params.buffers, params.ipaContext }); processStats({ params.buffers, params.ipaContext });
/* Do we need/want to call prepare? */ /* Do we need/want to call prepare? */
@ -445,6 +444,10 @@ void IpaBase::prepareIsp(const PrepareParams &params)
frameCount_++; frameCount_++;
/* If the statistics are inline the metadata can be returned early. */
if (controller_.getHardwareConfig().statsInline)
reportMetadata(ipaContext);
/* Ready to push the input buffer into the ISP. */ /* Ready to push the input buffer into the ISP. */
prepareIspComplete.emit(params.buffers, false); prepareIspComplete.emit(params.buffers, false);
} }
@ -479,7 +482,13 @@ void IpaBase::processStats(const ProcessParams &params)
} }
} }
reportMetadata(ipaContext); /*
* If the statistics are not inline the metadata must be returned now,
* before the processStatsComplete signal.
*/
if (!controller_.getHardwareConfig().statsInline)
reportMetadata(ipaContext);
processStatsComplete.emit(params.buffers); processStatsComplete.emit(params.buffers);
} }

View file

@ -34,7 +34,8 @@ static const std::map<std::string, Controller::HardwareConfig> HardwareConfigMap
.focusRegions = { 4, 3 }, .focusRegions = { 4, 3 },
.numHistogramBins = 128, .numHistogramBins = 128,
.numGammaPoints = 33, .numGammaPoints = 33,
.pipelineWidth = 13 .pipelineWidth = 13,
.statsInline = false,
} }
}, },
}; };

View file

@ -45,6 +45,7 @@ public:
unsigned int numHistogramBins; unsigned int numHistogramBins;
unsigned int numGammaPoints; unsigned int numGammaPoints;
unsigned int pipelineWidth; unsigned int pipelineWidth;
bool statsInline;
}; };
Controller(); Controller();