ipa: raspberrypi: Rationalise parameters to ipa::configure()

Rename ConfigInput to IPAConfig to be more consistent with the naming,
and remove ConfigInput::op, as it is never used.

Replace ConfigOutput with a ControlList type, as that is the only return
type from ipa::configure().

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Naushir Patuck 2021-03-23 14:36:10 +00:00 committed by Laurent Pinchart
parent b876c64613
commit 787852a240
3 changed files with 16 additions and 23 deletions

View file

@ -29,16 +29,11 @@ struct ISPConfig {
ControlList controls; ControlList controls;
}; };
struct ConfigInput { struct IPAConfig {
uint32 op;
uint32 transform; uint32 transform;
FileDescriptor lsTableHandle; FileDescriptor lsTableHandle;
}; };
struct ConfigOutput {
ControlList controls;
};
struct StartConfig { struct StartConfig {
ControlList controls; ControlList controls;
int32 dropFrameCount; int32 dropFrameCount;
@ -56,7 +51,7 @@ interface IPARPiInterface {
* \param[in] streamConfig Configuration of all active streams * \param[in] streamConfig Configuration of all active streams
* \param[in] entityControls Controls provided by the pipeline entities * \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] results Pipeline-handler-specific configuration result * \param[out] controls Controls to apply by the pipeline entity
* *
* This method shall be called when the camera is configured to inform * This method shall be called when the camera is configured to inform
* the IPA of the camera's streams and the sensor settings. * the IPA of the camera's streams and the sensor settings.
@ -64,14 +59,14 @@ interface IPARPiInterface {
* The \a sensorInfo conveys information about the camera sensor settings that * The \a sensorInfo conveys information about the camera sensor settings that
* the pipeline handler has selected for the configuration. * the pipeline handler has selected for the configuration.
* *
* The \a ipaConfig and \a results parameters carry data passed by the * The \a ipaConfig and \a controls parameters carry data passed by the
* pipeline handler to the IPA and back. * pipeline handler to the IPA and back.
*/ */
configure(CameraSensorInfo sensorInfo, configure(CameraSensorInfo sensorInfo,
map<uint32, IPAStream> streamConfig, map<uint32, IPAStream> streamConfig,
map<uint32, ControlInfoMap> entityControls, map<uint32, ControlInfoMap> entityControls,
ConfigInput ipaConfig) IPAConfig ipaConfig)
=> (int32 ret, ConfigOutput results); => (int32 ret, ControlList controls);
/** /**
* \fn mapBuffers() * \fn mapBuffers()

View file

@ -85,8 +85,8 @@ public:
int configure(const CameraSensorInfo &sensorInfo, int configure(const CameraSensorInfo &sensorInfo,
const std::map<unsigned int, IPAStream> &streamConfig, const std::map<unsigned int, IPAStream> &streamConfig,
const std::map<unsigned int, ControlInfoMap> &entityControls, const std::map<unsigned int, ControlInfoMap> &entityControls,
const ipa::RPi::ConfigInput &data, const ipa::RPi::IPAConfig &data,
ipa::RPi::ConfigOutput *response) override; ControlList *controls) 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;
void signalStatReady(const uint32_t bufferId) override; void signalStatReady(const uint32_t bufferId) override;
@ -313,8 +313,8 @@ void IPARPi::setMode(const CameraSensorInfo &sensorInfo)
int IPARPi::configure(const CameraSensorInfo &sensorInfo, int IPARPi::configure(const CameraSensorInfo &sensorInfo,
[[maybe_unused]] const std::map<unsigned int, IPAStream> &streamConfig, [[maybe_unused]] const std::map<unsigned int, IPAStream> &streamConfig,
const std::map<unsigned int, ControlInfoMap> &entityControls, const std::map<unsigned int, ControlInfoMap> &entityControls,
const ipa::RPi::ConfigInput &ipaConfig, const ipa::RPi::IPAConfig &ipaConfig,
ipa::RPi::ConfigOutput *result) ControlList *controls)
{ {
if (entityControls.size() != 2) { if (entityControls.size() != 2) {
LOG(IPARPI, Error) << "No ISP or sensor controls found."; LOG(IPARPI, Error) << "No ISP or sensor controls found.";
@ -377,7 +377,8 @@ int IPARPi::configure(const CameraSensorInfo &sensorInfo,
agcStatus.analogue_gain = DefaultAnalogueGain; agcStatus.analogue_gain = DefaultAnalogueGain;
applyAGC(&agcStatus, ctrls); applyAGC(&agcStatus, ctrls);
result->controls = std::move(ctrls); ASSERT(controls);
*controls = std::move(ctrls);
} }
return 0; return 0;

View file

@ -1236,7 +1236,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)
std::map<unsigned int, IPAStream> streamConfig; std::map<unsigned int, IPAStream> streamConfig;
std::map<unsigned int, ControlInfoMap> entityControls; std::map<unsigned int, ControlInfoMap> entityControls;
ipa::RPi::ConfigInput ipaConfig; ipa::RPi::IPAConfig ipaConfig;
/* Get the device format to pass to the IPA. */ /* Get the device format to pass to the IPA. */
V4L2DeviceFormat sensorFormat; V4L2DeviceFormat sensorFormat;
@ -1279,19 +1279,16 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)
} }
/* Ready the IPA - it must know about the sensor resolution. */ /* Ready the IPA - it must know about the sensor resolution. */
ipa::RPi::ConfigOutput result; ControlList controls;
ret = ipa_->configure(sensorInfo_, streamConfig, entityControls, ipaConfig, ret = ipa_->configure(sensorInfo_, streamConfig, entityControls, ipaConfig,
&result); &controls);
if (ret < 0) { if (ret < 0) {
LOG(RPI, Error) << "IPA configuration failed!"; LOG(RPI, Error) << "IPA configuration failed!";
return -EPIPE; return -EPIPE;
} }
if (!result.controls.empty()) { if (!controls.empty())
ControlList &ctrls = result.controls; unicam_[Unicam::Image].dev()->setControls(&controls);
unicam_[Unicam::Image].dev()->setControls(&ctrls);
}
/* /*
* Configure the H/V flip controls based on the combination of * Configure the H/V flip controls based on the combination of