When running with sensors that had no embedded data, the pipeline handler would fill a dummy embedded data buffer with gain/exposure values, and pass this buffer to the IPA together with the bayer buffer. The IPA would extract these values for use in the controller algorithms. Rework this logic entirely by having a new RPiCameraData::BayerFrame queue to replace the existing bayer queue. In addition to storing the FrameBuffer pointer, this also stores all the controls tracked by DelayedControls for that frame in a ControlList. This includes include exposure and gain values. On signalling RPi::IPA_EVENT_SIGNAL_ISP_PREPARE IPA event, the pipeline handler now passes this ControlList from the RPiCameraData::BayerFrame queue. The IPA now extracts the gain and exposure values from the ControlList instead of using RPiController::MdParserRPi to parse the embedded data buffer. 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>
134 lines
3.9 KiB
Plaintext
134 lines
3.9 KiB
Plaintext
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
|
|
module ipa.RPi;
|
|
|
|
import "include/libcamera/ipa/core.mojom";
|
|
|
|
enum BufferMask {
|
|
MaskID = 0x00ffff,
|
|
MaskStats = 0x010000,
|
|
MaskEmbeddedData = 0x020000,
|
|
MaskBayerData = 0x040000,
|
|
MaskExternalBuffer = 0x100000,
|
|
};
|
|
|
|
/* Size of the LS grid allocation. */
|
|
const uint32 MaxLsGridSize = 0x8000;
|
|
|
|
enum ConfigOutputParameters {
|
|
ConfigSensorParams = 0x01,
|
|
};
|
|
|
|
struct SensorConfig {
|
|
uint32 gainDelay;
|
|
uint32 exposureDelay;
|
|
uint32 vblank;
|
|
uint32 sensorMetadata;
|
|
};
|
|
|
|
struct ISPConfig {
|
|
uint32 embeddedBufferId;
|
|
uint32 bayerBufferId;
|
|
bool embeddedBufferPresent;
|
|
ControlList controls;
|
|
};
|
|
|
|
struct ConfigInput {
|
|
uint32 op;
|
|
uint32 transform;
|
|
FileDescriptor lsTableHandle;
|
|
};
|
|
|
|
struct ConfigOutput {
|
|
uint32 params;
|
|
SensorConfig sensorConfig;
|
|
ControlList controls;
|
|
};
|
|
|
|
struct StartControls {
|
|
ControlList controls;
|
|
int32 dropFrameCount;
|
|
};
|
|
|
|
interface IPARPiInterface {
|
|
init(IPASettings settings) => (int32 ret);
|
|
start(StartControls controls) => (StartControls result);
|
|
stop();
|
|
|
|
/**
|
|
* \fn configure()
|
|
* \brief Configure the IPA stream and sensor settings
|
|
* \param[in] sensorInfo Camera sensor information
|
|
* \param[in] streamConfig Configuration of all active streams
|
|
* \param[in] entityControls Controls provided by the pipeline entities
|
|
* \param[in] ipaConfig Pipeline-handler-specific configuration data
|
|
* \param[out] results Pipeline-handler-specific configuration result
|
|
*
|
|
* This method shall be called when the camera is configured to inform
|
|
* the IPA of the camera's streams and the sensor settings.
|
|
*
|
|
* The \a sensorInfo conveys information about the camera sensor settings that
|
|
* the pipeline handler has selected for the configuration.
|
|
*
|
|
* The \a ipaConfig and \a results parameters carry data passed by the
|
|
* pipeline handler to the IPA and back.
|
|
*/
|
|
configure(CameraSensorInfo sensorInfo,
|
|
map<uint32, IPAStream> streamConfig,
|
|
map<uint32, ControlInfoMap> entityControls,
|
|
ConfigInput ipaConfig)
|
|
=> (ConfigOutput results, int32 ret);
|
|
|
|
/**
|
|
* \fn mapBuffers()
|
|
* \brief Map buffers shared between the pipeline handler and the IPA
|
|
* \param[in] buffers List of buffers to map
|
|
*
|
|
* This method informs the IPA module of memory buffers set up by the pipeline
|
|
* handler that the IPA needs to access. It provides dmabuf file handles for
|
|
* each buffer, and associates the buffers with unique numerical IDs.
|
|
*
|
|
* IPAs shall map the dmabuf file handles to their address space and keep a
|
|
* cache of the mappings, indexed by the buffer numerical IDs. The IDs are used
|
|
* in all other IPA interface methods to refer to buffers, including the
|
|
* unmapBuffers() method.
|
|
*
|
|
* All buffers that the pipeline handler wishes to share with an IPA shall be
|
|
* mapped with this method. Buffers may be mapped all at once with a single
|
|
* call, or mapped and unmapped dynamically at runtime, depending on the IPA
|
|
* protocol. Regardless of the protocol, all buffers mapped at a given time
|
|
* shall have unique numerical IDs.
|
|
*
|
|
* The numerical IDs have no meaning defined by the IPA interface, and
|
|
* should be treated as opaque handles by IPAs, with the only exception
|
|
* that ID zero is invalid.
|
|
*
|
|
* \sa unmapBuffers()
|
|
*/
|
|
mapBuffers(array<IPABuffer> buffers);
|
|
|
|
/**
|
|
* \fn unmapBuffers()
|
|
* \brief Unmap buffers shared by the pipeline to the IPA
|
|
* \param[in] ids List of buffer IDs to unmap
|
|
*
|
|
* This method removes mappings set up with mapBuffers(). Numerical IDs
|
|
* of unmapped buffers may be reused when mapping new buffers.
|
|
*
|
|
* \sa mapBuffers()
|
|
*/
|
|
unmapBuffers(array<uint32> ids);
|
|
|
|
[async] signalStatReady(uint32 bufferId);
|
|
[async] signalQueueRequest(ControlList controls);
|
|
[async] signalIspPrepare(ISPConfig data);
|
|
};
|
|
|
|
interface IPARPiEventInterface {
|
|
statsMetadataComplete(uint32 bufferId, ControlList controls);
|
|
runIsp(uint32 bufferId);
|
|
embeddedComplete(uint32 bufferId);
|
|
setIspControls(ControlList controls);
|
|
setDelayedControls(ControlList controls);
|
|
};
|