ipa: ipu3: Introduce IPAConfigInfo in IPC

IPAConfigInfo is a consolidated data structure passed from IPU3
pipeline-handler to IPU3 IPA. The structure can be extended with
additional parameters to accommodate the requirements of multiple
IPU3 IPA modules.

Adapt the in-tree IPU3 IPA to use IPAConfigInfo as well.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Umang Jain 2021-05-24 14:50:22 +05:30 committed by Laurent Pinchart
parent 231d93557d
commit c76ca01323
3 changed files with 21 additions and 13 deletions

View file

@ -30,13 +30,19 @@ struct IPU3Action {
libcamera.ControlList controls; libcamera.ControlList controls;
}; };
struct IPAConfigInfo {
libcamera.IPACameraSensorInfo sensorInfo;
map<uint32, ControlInfoMap> entityControls;
libcamera.Size bdsOutputSize;
libcamera.Size iif;
};
interface IPAIPU3Interface { interface IPAIPU3Interface {
init(libcamera.IPASettings settings) => (int32 ret); init(libcamera.IPASettings settings) => (int32 ret);
start() => (int32 ret); start() => (int32 ret);
stop(); stop();
configure(map<uint32, libcamera.ControlInfoMap> entityControls, configure(IPAConfigInfo configInfo) => ();
libcamera.Size bdsOutputSize) => ();
mapBuffers(array<libcamera.IPABuffer> buffers); mapBuffers(array<libcamera.IPABuffer> buffers);
unmapBuffers(array<uint32> ids); unmapBuffers(array<uint32> ids);

View file

@ -43,8 +43,7 @@ public:
int start() override; int start() override;
void stop() override {} void stop() override {}
void configure(const std::map<uint32_t, ControlInfoMap> &entityControls, void configure(const IPAConfigInfo &configInfo) override;
const Size &bdsOutputSize) override;
void mapBuffers(const std::vector<IPABuffer> &buffers) override; void mapBuffers(const std::vector<IPABuffer> &buffers) override;
void unmapBuffers(const std::vector<unsigned int> &ids) override; void unmapBuffers(const std::vector<unsigned int> &ids) override;
@ -139,13 +138,12 @@ void IPAIPU3::calculateBdsGrid(const Size &bdsOutputSize)
<< (int)bdsGrid_.height << " << " << (int)bdsGrid_.block_height_log2 << ")"; << (int)bdsGrid_.height << " << " << (int)bdsGrid_.block_height_log2 << ")";
} }
void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls, void IPAIPU3::configure(const IPAConfigInfo &configInfo)
const Size &bdsOutputSize)
{ {
if (entityControls.empty()) if (configInfo.entityControls.empty())
return; return;
ctrls_ = entityControls.at(0); ctrls_ = configInfo.entityControls.at(0);
const auto itExp = ctrls_.find(V4L2_CID_EXPOSURE); const auto itExp = ctrls_.find(V4L2_CID_EXPOSURE);
if (itExp == ctrls_.end()) { if (itExp == ctrls_.end()) {
@ -169,10 +167,10 @@ void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls
params_ = {}; params_ = {};
calculateBdsGrid(bdsOutputSize); calculateBdsGrid(configInfo.bdsOutputSize);
awbAlgo_ = std::make_unique<IPU3Awb>(); awbAlgo_ = std::make_unique<IPU3Awb>();
awbAlgo_->initialise(params_, bdsOutputSize, bdsGrid_); awbAlgo_->initialise(params_, configInfo.bdsOutputSize, bdsGrid_);
agcAlgo_ = std::make_unique<IPU3Agc>(); agcAlgo_ = std::make_unique<IPU3Agc>();
agcAlgo_->initialise(bdsGrid_); agcAlgo_->initialise(bdsGrid_);

View file

@ -636,9 +636,13 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)
return ret; return ret;
} }
std::map<uint32_t, ControlInfoMap> entityControls; ipa::ipu3::IPAConfigInfo configInfo;
entityControls.emplace(0, data->cio2_.sensor()->controls()); configInfo.entityControls.emplace(0, data->cio2_.sensor()->controls());
data->ipa_->configure(entityControls, config->imguConfig().bds); configInfo.sensorInfo = sensorInfo;
configInfo.bdsOutputSize = config->imguConfig().bds;
configInfo.iif = config->imguConfig().iif;
data->ipa_->configure(configInfo);
return 0; return 0;
} }