From: Wooyeon Kim Date: Thu, 30 Aug 2018 11:33:38 +0000 (+0900) Subject: [COMMON] fimc-is2: moved get_timestamp to Frame start ISR X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3b8946fd0ccbd259c7d0b363637950196016df42;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] fimc-is2: moved get_timestamp to Frame start ISR (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 --- diff --git a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi_v4.c b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi_v4.c index 6f5968ad2e6b..a697023b7768 100644 --- a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi_v4.c +++ b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi_v4.c @@ -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); } diff --git a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c index e76e98c55a27..d73901246513 100644 --- a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c +++ b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c @@ -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