mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 15:29:45 +03:00
pipeline: ipa: raspberrypi: Replace entityControls
Replace the legacy entityControls map passed into ipa::configure() with explicit fields for sensor and ISP controls. This removes any ambiguity over which set of controls corresponds with specific integer keys. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
d70c38dca8
commit
c204a67bae
3 changed files with 9 additions and 19 deletions
|
@ -36,6 +36,8 @@ struct ISPConfig {
|
||||||
struct IPAConfig {
|
struct IPAConfig {
|
||||||
uint32 transform;
|
uint32 transform;
|
||||||
libcamera.SharedFD lsTableHandle;
|
libcamera.SharedFD lsTableHandle;
|
||||||
|
libcamera.ControlInfoMap sensorControls;
|
||||||
|
libcamera.ControlInfoMap ispControls;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IPAConfigResult {
|
struct IPAConfigResult {
|
||||||
|
@ -59,7 +61,6 @@ interface IPARPiInterface {
|
||||||
* \fn configure()
|
* \fn configure()
|
||||||
* \brief Configure the IPA stream and sensor settings
|
* \brief Configure the IPA stream and sensor settings
|
||||||
* \param[in] sensorInfo Camera sensor information
|
* \param[in] sensorInfo Camera sensor information
|
||||||
* \param[in] entityControls Controls provided by the pipeline entities
|
|
||||||
* \param[in] ipaConfig Pipeline-handler-specific configuration data
|
* \param[in] ipaConfig Pipeline-handler-specific configuration data
|
||||||
* \param[out] controls Controls to apply by the pipeline entity
|
* \param[out] controls Controls to apply by the pipeline entity
|
||||||
* \param[out] result Other results that the pipeline handler may require
|
* \param[out] result Other results that the pipeline handler may require
|
||||||
|
@ -74,7 +75,6 @@ interface IPARPiInterface {
|
||||||
* pipeline handler to the IPA and back.
|
* pipeline handler to the IPA and back.
|
||||||
*/
|
*/
|
||||||
configure(libcamera.IPACameraSensorInfo sensorInfo,
|
configure(libcamera.IPACameraSensorInfo sensorInfo,
|
||||||
map<uint32, libcamera.ControlInfoMap> entityControls,
|
|
||||||
IPAConfig ipaConfig)
|
IPAConfig ipaConfig)
|
||||||
=> (int32 ret, libcamera.ControlList controls, IPAConfigResult result);
|
=> (int32 ret, libcamera.ControlList controls, IPAConfigResult result);
|
||||||
|
|
||||||
|
|
|
@ -119,9 +119,7 @@ public:
|
||||||
void start(const ControlList &controls, StartConfig *startConfig) override;
|
void start(const ControlList &controls, StartConfig *startConfig) override;
|
||||||
void stop() override {}
|
void stop() override {}
|
||||||
|
|
||||||
int configure(const IPACameraSensorInfo &sensorInfo,
|
int configure(const IPACameraSensorInfo &sensorInfo, const IPAConfig &data,
|
||||||
const std::map<unsigned int, ControlInfoMap> &entityControls,
|
|
||||||
const IPAConfig &data,
|
|
||||||
ControlList *controls, IPAConfigResult *result) override;
|
ControlList *controls, IPAConfigResult *result) 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;
|
||||||
|
@ -380,18 +378,11 @@ void IPARPi::setMode(const IPACameraSensorInfo &sensorInfo)
|
||||||
mode_.sensitivity = helper_->getModeSensitivity(mode_);
|
mode_.sensitivity = helper_->getModeSensitivity(mode_);
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPARPi::configure(const IPACameraSensorInfo &sensorInfo,
|
int IPARPi::configure(const IPACameraSensorInfo &sensorInfo, const IPAConfig &ipaConfig,
|
||||||
const std::map<unsigned int, ControlInfoMap> &entityControls,
|
|
||||||
const IPAConfig &ipaConfig,
|
|
||||||
ControlList *controls, IPAConfigResult *result)
|
ControlList *controls, IPAConfigResult *result)
|
||||||
{
|
{
|
||||||
if (entityControls.size() != 2) {
|
sensorCtrls_ = ipaConfig.sensorControls;
|
||||||
LOG(IPARPI, Error) << "No ISP or sensor controls found.";
|
ispCtrls_ = ipaConfig.ispControls;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
sensorCtrls_ = entityControls.at(0);
|
|
||||||
ispCtrls_ = entityControls.at(1);
|
|
||||||
|
|
||||||
if (!validateSensorControls()) {
|
if (!validateSensorControls()) {
|
||||||
LOG(IPARPI, Error) << "Sensor control validation failed.";
|
LOG(IPARPI, Error) << "Sensor control validation failed.";
|
||||||
|
|
|
@ -1522,8 +1522,8 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config, ipa::RPi::IPA
|
||||||
std::map<unsigned int, ControlInfoMap> entityControls;
|
std::map<unsigned int, ControlInfoMap> entityControls;
|
||||||
ipa::RPi::IPAConfig ipaConfig;
|
ipa::RPi::IPAConfig ipaConfig;
|
||||||
|
|
||||||
entityControls.emplace(0, sensor_->controls());
|
ipaConfig.sensorControls = sensor_->controls();
|
||||||
entityControls.emplace(1, isp_[Isp::Input].dev()->controls());
|
ipaConfig.ispControls = isp_[Isp::Input].dev()->controls();
|
||||||
|
|
||||||
/* Always send the user transform to the IPA. */
|
/* Always send the user transform to the IPA. */
|
||||||
ipaConfig.transform = static_cast<unsigned int>(config->transform);
|
ipaConfig.transform = static_cast<unsigned int>(config->transform);
|
||||||
|
@ -1551,8 +1551,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config, ipa::RPi::IPA
|
||||||
|
|
||||||
/* Ready the IPA - it must know about the sensor resolution. */
|
/* Ready the IPA - it must know about the sensor resolution. */
|
||||||
ControlList controls;
|
ControlList controls;
|
||||||
ret = ipa_->configure(sensorInfo_, entityControls, ipaConfig,
|
ret = ipa_->configure(sensorInfo_, ipaConfig, &controls, result);
|
||||||
&controls, result);
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
LOG(RPI, Error) << "IPA configuration failed!";
|
LOG(RPI, Error) << "IPA configuration failed!";
|
||||||
return -EPIPE;
|
return -EPIPE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue