[COMMON] fimc-is2: implement Fast AF Triggering for decrease AF control delay
authorWooyeon Kim <wooy88.kim@samsung.com>
Wed, 30 Jan 2019 07:07:45 +0000 (16:07 +0900)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:30:43 +0000 (17:30 +0800)
 - copy afMode & afTrigger at only CONTINUOUS mode & trigger start
   when qbuf frame, copy queued frame

Change-Id: I5f5bffbfa659b6ddf027338937404b8add3a718c
Signed-off-by: Wooyeon Kim <wooy88.kim@samsung.com>
drivers/media/platform/exynos/fimc-is2/fimc-is-groupmgr.c

index 7a7db2a9810ef87ad14ef638bcfa11bb8bcc2468..419ec5036b1367f38e0cce2c227a71a3c5423aed 100644 (file)
@@ -2550,6 +2550,32 @@ int fimc_is_group_buffer_queue(struct fimc_is_groupmgr *groupmgr,
                }
 #endif
 
+#ifdef ENABLE_FAST_AF_TRIGGER
+               /* for reduce AF control delay,
+                * it need to copy "afMode & afTrigger" in queued frame
+                * at only AF mode == CONTINUOUS_PICTURE or CONTINUOUS_VIDEO
+                *         AF trigger == START
+                */
+               if (test_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state)) {
+                       struct fimc_is_frame *prev;
+
+                       if ((frame->shot->ctl.aa.afMode == AA_AFMODE_CONTINUOUS_VIDEO ||
+                               frame->shot->ctl.aa.afMode == AA_AFMODE_CONTINUOUS_PICTURE)
+                               && frame->shot->ctl.aa.afTrigger == AA_AF_TRIGGER_START) {
+
+                               list_for_each_entry_reverse(prev, &framemgr->queued_list[FS_REQUEST], list) {
+                                       prev->shot->ctl.aa.afMode = frame->shot->ctl.aa.afMode;
+                                       prev->shot->ctl.aa.afTrigger = frame->shot->ctl.aa.afTrigger;
+                               }
+
+                               list_for_each_entry_reverse(prev, &framemgr->queued_list[FS_PROCESS], list) {
+                                       prev->shot->ctl.aa.afMode = frame->shot->ctl.aa.afMode;
+                                       prev->shot->ctl.aa.afTrigger = frame->shot->ctl.aa.afTrigger;
+                               }
+                       }
+               }
+#endif
+
 #ifdef SENSOR_REQUEST_DELAY
                if (test_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state) &&
                        (frame->shot->uctl.opMode == CAMERA_OP_MODE_HAL3_GED)) {