libcamera: software_isp: Make stats frame and buffer aware

This patch adds frame and bufferId arguments to stats related calls.
Although the parameters are currently unused, because frame ids are not
tracked and used and the stats buffer is passed around directly rather
than being referred by its id, they bring the internal APIs closer to
their counterparts in hardware pipelines.

It serves as a preparation for followup patches that will introduce:

- Frame number tracking in order to switch to DelayedControls
  (software ISP TODO #11 + #12).
- A ring buffer for stats in order to improve passing the stats
  (software ISP TODO #2).

Frame and buffer ids are unrelated for the given purposes but since they
are passed together at the same places, the change is implemented as a
single patch rather than two, basically the same, patches.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Milan Zamazal
2024-09-27 15:46:11 +02:00
committed by Kieran Bingham
parent 0cc74c492a
commit c64f2f197a
8 changed files with 38 additions and 18 deletions
+5 -3
View File
@@ -13,6 +13,7 @@
#include <memory>
#include <queue>
#include <set>
#include <stdint.h>
#include <string.h>
#include <string>
#include <unordered_map>
@@ -291,7 +292,7 @@ private:
void conversionInputDone(FrameBuffer *buffer);
void conversionOutputDone(FrameBuffer *buffer);
void ispStatsReady();
void ispStatsReady(uint32_t frame, uint32_t bufferId);
void setSensorControls(const ControlList &sensorControls);
};
@@ -887,10 +888,11 @@ void SimpleCameraData::conversionOutputDone(FrameBuffer *buffer)
pipe->completeRequest(request);
}
void SimpleCameraData::ispStatsReady()
void SimpleCameraData::ispStatsReady(uint32_t frame, uint32_t bufferId)
{
/* \todo Use the DelayedControls class */
swIsp_->processStats(sensor_->getControls({ V4L2_CID_ANALOGUE_GAIN,
swIsp_->processStats(frame, bufferId,
sensor_->getControls({ V4L2_CID_ANALOGUE_GAIN,
V4L2_CID_EXPOSURE }));
}