From b608984e78824f8738a089136721b1fe54016248 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Mon, 14 Feb 2022 17:51:36 +0800 Subject: ipa: ipu3: af: Auto focus for dw9719 Surface Go2 VCM Since VCM for surface Go 2 (dw9719) had been successfully driven, this Af module can be used to control the VCM and determine the focus value based on the IPU3 AF state. Based on the values from the IPU3 AF buffer, the variance of each focus step is determined and a greedy approach is used to find the maximum variance of the AF state and an appropriate focus value. The grid configuration is implemented as a context. Also, the grid parameter- AF_MIN_BLOCK_WIDTH is set to 4 (default is 3) since if the default value is used, x_start (x_start > 640) will be at an incorrect location of the image (rightmost of the sensor). Signed-off-by: Kate Hsuan Tested-by: Jean-Michel Hautbois Reviewed-by: Jean-Michel Hautbois Reviewed-by: Kieran Bingham Signed-off-by: Kieran Bingham --- src/ipa/ipu3/ipa_context.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/ipa/ipu3/ipa_context.h') diff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h index e7c49828..6b7a512e 100644 --- a/src/ipa/ipu3/ipa_context.h +++ b/src/ipa/ipu3/ipa_context.h @@ -25,6 +25,10 @@ struct IPASessionConfiguration { uint32_t stride; } grid; + struct { + ipu3_uapi_grid_config afGrid; + } af; + struct { utils::Duration minShutterSpeed; utils::Duration maxShutterSpeed; @@ -38,6 +42,12 @@ struct IPASessionConfiguration { }; struct IPAFrameContext { + struct { + uint32_t focus; + double maxVariance; + bool stable; + } af; + struct { uint32_t exposure; double gain; -- cgit v1.2.1