[libcamera-devel] [PATCH 4/5] ipa: ipu3: Send lens controls to pipeline handler

Daniel Scally djrscally at gmail.com
Fri Dec 3 13:16:04 CET 2021


Hi Laurent

On 28/11/2021 22:23, Laurent Pinchart wrote:
> Hi Daniel,
>
> Thank you for the patch.
>
> On Fri, Nov 26, 2021 at 12:31:17AM +0000, Daniel Scally wrote:
>> Pick up the focus value from the AF algorithm and send lens controls
>> along in the frame context.
>>
>> Signed-off-by: Daniel Scally <djrscally at gmail.com>
>> ---
>>  src/ipa/ipu3/ipu3.cpp | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp
>> index 6c76193a..abdcd69d 100644
>> --- a/src/ipa/ipu3/ipu3.cpp
>> +++ b/src/ipa/ipu3/ipu3.cpp
>> @@ -173,6 +173,7 @@ private:
>>  	uint32_t gain_;
>>  	uint32_t minGain_;
>>  	uint32_t maxGain_;
>> +	uint32_t focus_;
> Do we need this ?


No more than exposure_ or gain_...I included it mostly for consistency.
It could become a variable in setControls() (it's useful to have there
to shorten the lines), but I think exposure_ and gain_ could too in that
case.


>>  
>>  	utils::Duration lineDuration_;
>>  
>> @@ -671,6 +672,9 @@ void IPAIPU3::setControls(unsigned int frame)
>>  	ctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain_));
>>  	op.sensorControls = ctrls;
>>  
>> +	focus_ = context_.frameContext.af.focus;
>> +	op.lensControls.set(V4L2_CID_FOCUS_ABSOLUTE, static_cast<int32_t>(focus_));
> I think you need to create a ControlList first, like for the sensor
> controls.


Ack; done now.

>
>> +
>>  	queueFrameAction.emit(frame, op);
>>  }
>>  


More information about the libcamera-devel mailing list