deinterlace: vpp: change mc update flow [1/1]
authorJihong Sui <jihong.sui@amlogic.com>
Mon, 16 Sep 2019 11:35:32 +0000 (19:35 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Fri, 20 Sep 2019 11:46:49 +0000 (04:46 -0700)
PD#SWPL-14142

Problem:
display abnormal after play 1 hour.
this is because rdma can't been called in two thread.
mc update bit in hw timer, this causes pps's register
to be set incorrectly.

Solution:
call mc update function in video.c

Verify:
txlx

Change-Id: I750aa5c242a1077691f82c3b2361ee46b3202313
Signed-off-by: Jihong Sui <jihong.sui@amlogic.com>
drivers/amlogic/media/deinterlace/deinterlace.c
drivers/amlogic/media/di_local/di_local.c
drivers/amlogic/media/di_local/di_local.h
drivers/amlogic/media/di_multi/di_api.c
drivers/amlogic/media/video_sink/video.c
include/linux/amlogic/media/video_sink/video.h

index 7c851e0..e5bb5bf 100644 (file)
@@ -462,6 +462,7 @@ static int lDI_POST_WR_REG_BITS(u32 adr, u32 val, u32 start, u32 len)
 static const struct di_ext_ops di_ext = {
        .di_post_reg_rd             = lDI_POST_REG_RD,
        .di_post_wr_reg_bits        = lDI_POST_WR_REG_BITS,
+       .post_update_mc             = di_patch_post_update_mc,
 };
 
 #endif
@@ -7320,7 +7321,7 @@ static enum hrtimer_restart di_pre_hrtimer_func(struct hrtimer *timer)
        if (!di_pre_stru.bypass_flag)
                di_pre_trigger_work(&di_pre_stru);
        hrtimer_forward_now(&di_pre_hrtimer, ms_to_ktime(10));
-       di_patch_post_update_mc();
+       /*di_patch_post_update_mc();*/
        return HRTIMER_RESTART;
 }
 
index 18fb0e5..3d86532 100644 (file)
@@ -127,6 +127,13 @@ int DI_POST_WR_REG_BITS(u32 adr, u32 val, u32 start, u32 len)
 }
 EXPORT_SYMBOL(DI_POST_WR_REG_BITS);
 
+void DI_POST_UPDATE_MC(void)
+{
+       if (dil_api && dil_api->post_update_mc)
+               dil_api->post_update_mc();
+}
+EXPORT_SYMBOL(DI_POST_UPDATE_MC);
+
 /***************************************
  * reserved mem for di *
  **************************************/
index b956011..7f4b548 100644 (file)
@@ -21,6 +21,7 @@
 struct di_ext_ops {
        unsigned int (*di_post_reg_rd)(unsigned int addr);
        int (*di_post_wr_reg_bits)(u32 adr, u32 val, u32 start, u32 len);
+       void (*post_update_mc)(void);
 };
 
 #endif /*__DI_LOCAL_H__*/
index 554bdf1..33e9154 100644 (file)
@@ -26,6 +26,7 @@
 static const struct di_ext_ops di_ext = {
        .di_post_reg_rd             = l_DI_POST_REG_RD,
        .di_post_wr_reg_bits        = l_DI_POST_WR_REG_BITS,
+       .post_update_mc             = NULL,
 };
 
 void dim_attach_to_local(void)
index e9692c6..7186590 100644 (file)
@@ -6681,6 +6681,7 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id)
        struct vframe_s *cur_dispbuf_back = cur_dispbuf;
        static  struct vframe_s *pause_vf;
        int force_flush = 0;
+       bool di_post_process_done = false;
        static u32 interrupt_count;
        int ret = 0;
        u32 next_afbc_request = atomic_read(&gAfbc_request);
@@ -8290,9 +8291,15 @@ SET_FILTER:
                                          24) | (frame_par_di_set << 16),
                                         zoom_end_x_lines, zoom_start_y_lines,
                                         zoom_end_y_lines, cur_dispbuf);
+               di_post_process_done = true;
        }
 
  exit:
+       if (legacy_vpp &&
+           !di_post_process_done &&
+           (DI_POST_REG_RD(DI_POST_CTRL) & 0x100))
+               DI_POST_UPDATE_MC();
+
 #if defined(PTS_LOGGING) || defined(PTS_TRACE_DEBUG)
                pts_trace++;
 #endif
index 6004ec2..640271b 100644 (file)
@@ -247,5 +247,7 @@ void set_video_angle(u32 s_value);
 u32 get_video_angle(void);
 extern unsigned int DI_POST_REG_RD(unsigned int addr);
 extern int DI_POST_WR_REG_BITS(u32 adr, u32 val, u32 start, u32 len);
+void DI_POST_UPDATE_MC(void);
+
 extern void videosync_pcrscr_update(s32 inc, u32 base);
 #endif /* VIDEO_H */