[COMMON] fimc-is2: Check too fast H/W frame handling condition
authorSanghoon Lee <shoon114.lee@samsung.com>
Fri, 1 Jun 2018 06:22:30 +0000 (15:22 +0900)
committerEunyoung Lee <ey470.lee@samsung.com>
Tue, 19 Jun 2018 08:43:40 +0000 (17:43 +0900)
When it receives the frame end interrupt callback from DDK,
driver must compare the current frame count from DDK and the selected H/W frame's fcount.
If the fcount of frame is too earlier than frame count from DDK,
it should be skipped for the correct frame end interrupt callback.

Change-Id: I1f0a5543e2f7e35027373401e1fe8c2c2f3294c1
Signed-off-by: Sanghoon Lee <shoon114.lee@samsung.com>
drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-ddk.c

index e203a7163104a1f5cfb46be49c2927deeb496648..46f926c2a9213228a12fc25c9f69ebfc8e3146d7 100644 (file)
@@ -101,6 +101,12 @@ flush_wait_done_frame:
                                        framemgr_x_barrier_common(framemgr, 0, flags);
                                        fimc_is_hardware_frame_ndone(hw_ip, frame, frame->instance, IS_SHOT_INVALID_FRAMENUMBER);
                                        goto flush_wait_done_frame;
+                               } else if (unlikely(frame->fcount > expected_fcount)) {
+                                       mswarn_hw("%s:[F%d] Too early frame. Skip it.",
+                                                       instance_id, hw_ip,
+                                                       __func__, frame->fcount);
+                                       framemgr_x_barrier_common(framemgr, 0, flags);
+                                       return true;
                                }
                        } else {
                                framemgr_x_barrier_common(framemgr, 0, flags);