[COMMON] fimc-is2: Skip flushing for hw frames from different instance
authorSanghoon Lee <shoon114.lee@samsung.com>
Thu, 4 Oct 2018 09:19:12 +0000 (18:19 +0900)
committerlingsen1 <lingsen1@lenovo.com>
Mon, 10 Jun 2019 03:24:56 +0000 (11:24 +0800)
H/W framemgr could have the multiple frames from different instance.
Currently, H/W frame can be flushed by checking old frame count, only,
and it could flush the other frame that doesn't mean to.
So, it is required to check the instnace number in frame to flush them.

PR JIRA ID: CPR-291

CRs-fixed: (CR)

Change-Id: I48a1b5b5cb579b1ea4299a896f2910c8d0eb24b6
Signed-off-by: Sanghoon Lee <shoon114.lee@samsung.com>
Reviewed-on: https://gerrit.mot.com/1332441
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Dawei Wang <wangdw10@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key

drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-control.c

index c5e1dafbf1889eddf4641154deb686127c8e8bdd..97b0d847dff315fc6ab57d6e2c08fba7643e8c68 100644 (file)
@@ -2486,15 +2486,17 @@ exit:
        /* Force flush the old H/W frames with DONE state */
        framemgr_e_barrier_common(framemgr, 0, flags);
        if (framemgr->queued_count[FS_HW_WAIT_DONE] > 0) {
+               struct fimc_is_frame *temp;
                u32 fcount = frame->fcount;
-
-               frame = peek_frame(framemgr, FS_HW_WAIT_DONE);
-               while (frame && frame->fcount < fcount) {
-                       msinfo_hw("[F%d]force flush\n",
-                                       frame->instance, hw_ip, frame->fcount);
-                       trans_frame(framemgr, frame, FS_HW_FREE);
-                       atomic_set(&frame->shot_done_flag, 0);
-                       frame = peek_frame(framemgr, FS_HW_WAIT_DONE);
+               u32 instance = frame->instance;
+
+               list_for_each_entry_safe(frame, temp, &framemgr->queued_list[FS_HW_WAIT_DONE], list) {
+                       if (frame && frame->instance == instance && frame->fcount < fcount) {
+                               msinfo_hw("[F%d]force flush\n",
+                                               frame->instance, hw_ip, frame->fcount);
+                               trans_frame(framemgr, frame, FS_HW_FREE);
+                               atomic_set(&frame->shot_done_flag, 0);
+                       }
                }
        }
        framemgr_x_barrier_common(framemgr, 0, flags);