ipa: rkisp1: Report and use sensor controls

The pipeline handler populates a new sensorControls ControlList, to
have the effective exposure and gain values for the current frame. This
is done when a statistics buffer is received.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Jean-Michel Hautbois 2021-11-18 15:19:28 +01:00
parent 55c07ed4db
commit 431749b399
3 changed files with 5 additions and 2 deletions

View file

@ -21,11 +21,13 @@ struct RkISP1Event {
uint32 frame; uint32 frame;
uint32 bufferId; uint32 bufferId;
libcamera.ControlList controls; libcamera.ControlList controls;
libcamera.ControlList sensorControls;
}; };
struct RkISP1Action { struct RkISP1Action {
RkISP1Operations op; RkISP1Operations op;
libcamera.ControlList controls; libcamera.ControlList controls;
libcamera.ControlList sensorControls;
}; };
interface IPARkISP1Interface { interface IPARkISP1Interface {

View file

@ -314,7 +314,7 @@ void IPARkISP1::setControls(unsigned int frame)
ControlList ctrls(ctrls_); ControlList ctrls(ctrls_);
ctrls.set(V4L2_CID_EXPOSURE, static_cast<int32_t>(exposure_)); ctrls.set(V4L2_CID_EXPOSURE, static_cast<int32_t>(exposure_));
ctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain_)); ctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain_));
op.controls = ctrls; op.sensorControls = ctrls;
queueFrameAction.emit(frame, op); queueFrameAction.emit(frame, op);
} }

View file

@ -333,7 +333,7 @@ void RkISP1CameraData::queueFrameAction(unsigned int frame,
{ {
switch (action.op) { switch (action.op) {
case ipa::rkisp1::ActionV4L2Set: { case ipa::rkisp1::ActionV4L2Set: {
const ControlList &controls = action.controls; const ControlList &controls = action.sensorControls;
delayedCtrls_->push(controls); delayedCtrls_->push(controls);
break; break;
} }
@ -1124,6 +1124,7 @@ void PipelineHandlerRkISP1::statReady(FrameBuffer *buffer)
ev.op = ipa::rkisp1::EventSignalStatBuffer; ev.op = ipa::rkisp1::EventSignalStatBuffer;
ev.frame = info->frame; ev.frame = info->frame;
ev.bufferId = info->statBuffer->cookie(); ev.bufferId = info->statBuffer->cookie();
ev.sensorControls = data->delayedCtrls_->get(buffer->metadata().sequence);
data->ipa_->processEvent(ev); data->ipa_->processEvent(ev);
} }