[COMMON] fimc-is2: force vsync generation
authorWooki Min <wooki.min@samsung.com>
Thu, 31 May 2018 09:58:14 +0000 (18:58 +0900)
committerWooyeon Kim <wooy88.kim@samsung.com>
Fri, 6 Jul 2018 01:43:23 +0000 (10:43 +0900)
Change-Id: I4f62b3bda66320276e38db614790704e106fb1fa
Signed-off-by: Wooki Min <wooki.min@samsung.com>
drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi.h
drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi_v4.c
drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-ddk.c

index d0d385e39ea9a0b2652eb9fff0006fd60672e0ec..ff8ef287ef066b350f323dd0e719ca5199b01c8e 100644 (file)
@@ -130,6 +130,7 @@ struct fimc_is_device_csi_dma {
        spinlock_t                      barrier;
 };
 
+void csi_frame_start_inline(struct fimc_is_device_csi *csi);
 int __must_check fimc_is_csi_dma_probe(struct fimc_is_device_csi_dma *csi_dma, struct platform_device *pdev);
 
 int __must_check fimc_is_csi_probe(void *parent, u32 instance);
index 594fb0dad7c70333729f5c1ea39fa9c1e116acd8..2375633106e342dcd5d37862c7de1cc9b4045c9e 100644 (file)
@@ -48,7 +48,7 @@ static enum hrtimer_restart csis_early_buf_done(struct hrtimer *timer)
 }
 #endif
 
-static inline void csi_frame_start_inline(struct fimc_is_device_csi *csi)
+inline void csi_frame_start_inline(struct fimc_is_device_csi *csi)
 {
        /* frame start interrupt */
        csi->sw_checker = EXPECT_FRAME_END;
index 2a92e8a988f42b77dfa042286317b28de0e28f5e..90dabd1db57bc2545ebc885fa3cfb5d6a51b54a9 100644 (file)
@@ -400,6 +400,42 @@ static void fimc_is_lib_camera_callback(void *this, enum lib_cb_event_type event
                fimc_is_hardware_config_lock(hw_ip, instance_id, (u32)fcount);
                break;
        case LIB_EVENT_FRAME_START_ISR:
+               if (sysfs_debug.pattern_en && (hw_ip->id == DEV_HW_3AA0 || hw_ip->id == DEV_HW_3AA1)) {
+                       struct fimc_is_group *group;
+                       struct v4l2_subdev *subdev;
+                       struct fimc_is_device_csi *csi;
+
+                       group = hw_ip->group[instance_id];
+                       if (IS_ERR_OR_NULL(group)) {
+                               mserr_hw("group is NULL", instance_id, hw_ip);
+                               return;
+                       }
+
+                       if (IS_ERR_OR_NULL(group->device)) {
+                               mserr_hw("device is NULL", instance_id, hw_ip);
+                               return;
+                       }
+
+                       if (IS_ERR_OR_NULL(group->device->sensor)) {
+                               mserr_hw("sensor is NULL", instance_id, hw_ip);
+                               return;
+                       }
+
+                       if (IS_ERR_OR_NULL(group->device->sensor->subdev_csi)) {
+                               mserr_hw("subdev_csi is NULL", instance_id, hw_ip);
+                               return;
+                       }
+
+                       subdev = group->device->sensor->subdev_csi;
+                       csi = v4l2_get_subdevdata(subdev);
+                       if (IS_ERR_OR_NULL(csi)) {
+                               mserr_hw("csi is NULL", instance_id, hw_ip);
+                               return;
+                       }
+
+                       csi_frame_start_inline(csi);
+               }
+
                hw_ip->debug_index[1] = hw_ip->debug_index[0] % DEBUG_FRAME_COUNT;
                index = hw_ip->debug_index[1];
                hw_ip->debug_info[index].fcount = hw_ip->debug_index[0];