[COMMON] fimc-is2: moved get_timestamp to Frame start ISR
authorWooyeon Kim <wooy88.kim@samsung.com>
Thu, 30 Aug 2018 11:33:38 +0000 (20:33 +0900)
committerhskang <hs1218.kang@samsung.com>
Wed, 5 Sep 2018 10:14:39 +0000 (19:14 +0900)
 (AS-IS) get_timestamp is located to notify_by_fstr
         notify_by_fstr is called in tasklet
 if tasklet scheduling is delayed, it can't gurantee
 timestamp interval between frame to frame.
 (TO-BE) get_timestamp before tasklet scheduled.
         move ISR.

 PR JIRA ID: CPR-232

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

index 6f5968ad2e6bd5ce9fde8d49dd19385457e7d0b6..a697023b776868c7a4239adcc253b5d2b5d04c08 100644 (file)
@@ -59,6 +59,18 @@ inline void csi_frame_start_inline(struct fimc_is_device_csi *csi)
        atomic_inc(&csi->vvalid);
        {
                u32 vsync_cnt = atomic_read(&csi->fcount);
+               struct fimc_is_device_sensor *sensor;
+               u32 hashkey;
+
+               sensor = v4l2_get_subdev_hostdata(*csi->subdev);
+               if (!sensor) {
+                       err("sensor is NULL");
+                       BUG();
+               }
+
+               hashkey = vsync_cnt % FIMC_IS_TIMESTAMP_HASH_KEY;
+               sensor->timestamp[hashkey] = fimc_is_get_timestamp();
+               sensor->timestampboot[hashkey] = fimc_is_get_timestamp_boot();
 
                v4l2_subdev_notify(*csi->subdev, CSI_NOTIFY_VSYNC, &vsync_cnt);
        }
index e76e98c55a27ad59a34848b173d44cee86f1ec77..d73901246513a7d4e5aad1e9e29865d14239ea52 100644 (file)
@@ -1022,7 +1022,6 @@ static int fimc_is_sensor_notify_by_fstr(struct fimc_is_device_sensor *device, v
        int ret = 0;
        struct fimc_is_framemgr *framemgr;
        struct fimc_is_frame *frame;
-       u32 hashkey;
        struct fimc_is_device_csi *csi;
        struct fimc_is_subdev *dma_subdev;
        struct v4l2_control ctrl;
@@ -1042,12 +1041,6 @@ static int fimc_is_sensor_notify_by_fstr(struct fimc_is_device_sensor *device, v
                        wake_up(&device->instant_wait);
        }
 
-#if !defined(ENABLE_HW_FAST_READ_OUT)
-       hashkey = device->fcount % FIMC_IS_TIMESTAMP_HASH_KEY;
-       device->timestamp[hashkey] = fimc_is_get_timestamp();
-       device->timestampboot[hashkey] = fimc_is_get_timestamp_boot();
-#endif
-
 #ifdef MEASURE_TIME
 #ifdef MONITOR_TIME
        {
@@ -1062,16 +1055,6 @@ static int fimc_is_sensor_notify_by_fstr(struct fimc_is_device_sensor *device, v
                        TIME_SHOT(TMS_SHOT2);
        }
 
-#ifdef ENABLE_HW_FAST_READ_OUT
-       if ((frame) && (device->image.framerate > 240)
-               && (group->tail->id == FULL_OTF_TAIL_GROUP_ID))         /* FULL OTF path + 480fps */
-               hashkey = frame->fcount % FIMC_IS_TIMESTAMP_HASH_KEY;
-       else
-               hashkey = device->fcount % FIMC_IS_TIMESTAMP_HASH_KEY;
-
-       device->timestamp[hashkey] = fimc_is_get_timestamp();
-       device->timestampboot[hashkey] = fimc_is_get_timestamp_boot();
-#endif
 #endif
 #endif