stb_dv: fix the dv dual layer playing out-sync
authorBrian Zhu <brian.zhu@amlogic.com>
Tue, 27 Mar 2018 15:09:19 +0000 (23:09 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Thu, 29 Mar 2018 06:28:56 +0000 (22:28 -0800)
PD#163116:
1. vfm: increase the receiver size from 16 to 32
2. vpp: put el vframe toggle when omx dropping frame

Change-Id: Iecb0686e08a0bfb66ef259ea5fc32333fbbbd3e4
Signed-off-by: Brian Zhu <brian.zhu@amlogic.com>
drivers/amlogic/media/common/vfm/vframe_receiver.c
drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c
drivers/amlogic/media/video_sink/video.c
include/linux/amlogic/media/amdolbyvision/dolby_vision.h

index f25b39f..fb77c81 100644 (file)
@@ -28,7 +28,7 @@
 /* Local headers */
 #include "vfm.h"
 
-#define MAX_RECEIVER_NUM    16
+#define MAX_RECEIVER_NUM    32
 struct vframe_receiver_s *receiver_table[MAX_RECEIVER_NUM];
 
 int receiver_list(char *buf)
index cdf4716..f3cadf3 100644 (file)
@@ -3399,7 +3399,7 @@ static int dolby_vision_policy_process(
        return mode_change;
 }
 
-static bool is_dovi_frame(struct vframe_s *vf)
+bool is_dovi_frame(struct vframe_s *vf)
 {
        struct provider_aux_req_s req;
        char *p;
@@ -3447,6 +3447,7 @@ static bool is_dovi_frame(struct vframe_s *vf)
        }
        return false;
 }
+EXPORT_SYMBOL(is_dovi_frame);
 
 #define signal_color_primaries ((vf->signal_type >> 16) & 0xff)
 #define signal_transfer_characteristic ((vf->signal_type >> 8) & 0xff)
index 23c5002..03c2ff9 100644 (file)
@@ -4402,13 +4402,24 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id)
                struct vframe_s *vf = NULL;
 
                while (1) {
-                       vf = vf_peek(RECEIVER_NAME);
+                       vf = video_vf_peek();
+
+#ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION
+                       if (is_dolby_vision_enable()
+                               && vf && is_dovi_frame(vf)) {
+                               pr_info("vsync_isr_in, ignore the omx %d frames drop for dv frame\n",
+                                       omx_need_drop_frame_num);
+                               omx_need_drop_frame_num = 0;
+                               omx_drop_done = true;
+                               break;
+                       }
+#endif
                        if (vf) {
                                if (omx_need_drop_frame_num >= vf->omx_index) {
                                        //pr_info("vsync drop omx_index %d\n",
                                                //vf->omx_index);
-                                       vf = vf_get(RECEIVER_NAME);
-                                       vf_put(vf, RECEIVER_NAME);
+                                       vf = video_vf_get();
+                                       video_vf_put(vf);
                                } else {
                                        omx_drop_done = true;
                                        break;
@@ -6349,6 +6360,14 @@ static void set_omx_pts(u32 *p)
 
                while (try_cnt--) {
                        vf = vf_peek(RECEIVER_NAME);
+#ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION
+                       if (is_dolby_vision_enable()
+                               && vf && is_dovi_frame(vf)) {
+                               pr_info("set_omx_pts ignore the omx %d frames drop for dv frame\n",
+                                       frame_num);
+                               break;
+                       }
+#endif
                        if (vf) {
                                if (frame_num >= vf->omx_index) {
                                        vf = vf_get(RECEIVER_NAME);
index 9adc16b..8bf8196 100644 (file)
@@ -49,5 +49,6 @@ extern void tv_dolby_vision_el_info(void);
 extern int enable_rgb_to_yuv_matrix_for_dvll(
        int32_t on, uint32_t *coeff_orig, uint32_t bits);
 
+extern bool is_dovi_frame(struct vframe_s *vf);
 
 #endif