@@ -10,6 +10,10 @@
#include <libcamera/control_ids.h>
#include <libcamera/controls.h>
+enum RPiConfigParameters {
+ RPI_IPA_CONFIG_LS_TABLE = (1 << 0),
+};
+
enum RPiOperations {
RPI_IPA_ACTION_V4L2_SET_STAGGERED = 1,
RPI_IPA_ACTION_V4L2_SET_ISP,
@@ -21,7 +25,6 @@ enum RPiOperations {
RPI_IPA_EVENT_SIGNAL_STAT_READY,
RPI_IPA_EVENT_SIGNAL_ISP_PREPARE,
RPI_IPA_EVENT_QUEUE_REQUEST,
- RPI_IPA_EVENT_LS_TABLE_ALLOCATION,
};
enum RPiIpaMask {
@@ -271,6 +271,12 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,
applyAGC(&agcStatus);
lastMode_ = mode_;
+
+ /* Store the lens shading table pointer and handle if available. */
+ if (ipaConfig.operation & RPI_IPA_CONFIG_LS_TABLE) {
+ lsTable_ = reinterpret_cast<void *>(ipaConfig.data[0]);
+ lsTableHandle_ = ipaConfig.data[1];
+ }
}
void IPARPi::mapBuffers(const std::vector<IPABuffer> &buffers)
@@ -352,12 +358,6 @@ void IPARPi::processEvent(const IPAOperationData &event)
break;
}
- case RPI_IPA_EVENT_LS_TABLE_ALLOCATION: {
- lsTable_ = reinterpret_cast<void *>(event.data[0]);
- lsTableHandle_ = event.data[1];
- break;
- }
-
default:
LOG(IPARPI, Error) << "Unknown event " << event.operation;
break;
@@ -1122,6 +1122,7 @@ int RPiCameraData::configureIPA()
{
std::map<unsigned int, IPAStream> streamConfig;
std::map<unsigned int, const ControlInfoMap &> entityControls;
+ IPAOperationData ipaConfig = {};
/* Get the device format to pass to the IPA. */
V4L2DeviceFormat sensorFormat;
@@ -1156,11 +1157,9 @@ int RPiCameraData::configureIPA()
* IPA module isolation and should be reworked when vc_sma_cma
* will permit.
*/
- IPAOperationData op;
- op.operation = RPI_IPA_EVENT_LS_TABLE_ALLOCATION;
- op.data = { static_cast<uint32_t>(ptr & 0xffffffff),
- vcsm_.getVCHandle(lsTable_) };
- ipa_->processEvent(op);
+ ipaConfig.operation = RPI_IPA_CONFIG_LS_TABLE;
+ ipaConfig.data = { static_cast<uint32_t>(ptr & 0xffffffff),
+ vcsm_.getVCHandle(lsTable_) };
}
CameraSensorInfo sensorInfo = {};
@@ -1171,7 +1170,6 @@ int RPiCameraData::configureIPA()
}
/* Ready the IPA - it must know about the sensor resolution. */
- IPAOperationData ipaConfig;
ipa_->configure(sensorInfo, streamConfig, entityControls, ipaConfig,
nullptr);