dolby: demo-debug.apk test fail [1/1]
authoryao liu <yao.liu@amlogic.com>
Fri, 28 Jun 2019 13:16:21 +0000 (21:16 +0800)
committerYao Liu <yao.liu@amlogic.com>
Thu, 4 Jul 2019 06:59:05 +0000 (23:59 -0700)
PD#SWPL-10167

Problem:
Apk drop several frames at beginning, but
dolby frames are not consumed, decoder has
no idle buffers.

Solution:
Ignore drop for dual layer dolby video

Verify:
verified on u212

Change-Id: I732d82e71c190c62a14c05accea44b4c55d04239
Signed-off-by: yao liu <yao.liu@amlogic.com>
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 b522f98..cf78b6d 100644 (file)
@@ -4122,6 +4122,28 @@ bool is_dovi_frame(struct vframe_s *vf)
 }
 EXPORT_SYMBOL(is_dovi_frame);
 
+bool is_dovi_dual_layer_frame(struct vframe_s *vf)
+{
+       struct provider_aux_req_s req;
+
+       req.vf = vf;
+       req.bot_flag = 0;
+       req.aux_buf = NULL;
+       req.aux_size = 0;
+       req.dv_enhance_exist = 0;
+
+       if (vf->source_type == VFRAME_SOURCE_TYPE_OTHERS) {
+               vf_notify_provider_by_name("dvbldec",
+                       VFRAME_EVENT_RECEIVER_GET_AUX_DATA,
+                       (void *)&req);
+               if (req.dv_enhance_exist)
+                       return true;
+       }
+       return false;
+}
+EXPORT_SYMBOL(is_dovi_dual_layer_frame);
+
+
 #define signal_color_primaries ((vf->signal_type >> 16) & 0xff)
 #define signal_transfer_characteristic ((vf->signal_type >> 8) & 0xff)
 static bool is_hdr10_frame(struct vframe_s *vf)
index d0ed11e..8714b80 100644 (file)
@@ -9286,7 +9286,7 @@ static void set_omx_pts(u32 *p)
        }
        /* kodi may render first frame, then drop dozens of frames */
        if (set_from_hwc == 0 && omx_run == true && frame_num <= 2
-                       && not_reset == 0) {
+                       && not_reset == 0 && omx_pts_set_from_hwc_count > 0) {
                pr_info("reset omx_run to false.\n");
                omx_run = false;
        }
@@ -9309,6 +9309,7 @@ static void set_omx_pts(u32 *p)
        } else if (set_from_hwc == 0 && !omx_run) {
                struct vframe_s *vf = NULL;
                u32 donot_drop = 0;
+               u32 dovi_dual_layer = 0;
 
                while (try_cnt--) {
                        vf = vf_peek(RECEIVER_NAME);
@@ -9318,6 +9319,8 @@ static void set_omx_pts(u32 *p)
                                pr_info("set_omx_pts ignore the omx %d frames drop for dv frame\n",
                                        frame_num);
                                donot_drop = 1;
+                               if (is_dovi_dual_layer_frame(vf))
+                                       dovi_dual_layer = 1;
                                break;
                        }
 #endif
@@ -9337,6 +9340,13 @@ static void set_omx_pts(u32 *p)
                        pr_info("reset omx_run to true.\n");
                        omx_run = true;
                }
+#ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION
+               if (dovi_dual_layer) {
+                       omx_run = true;
+                       omx_drop_done = true;
+                       pr_info("dolby dual layer donot drop.\n");
+               }
+#endif
        }
        mutex_unlock(&omx_mutex);
 }
index da2be09..b44d1e0 100644 (file)
@@ -76,4 +76,5 @@ extern bool is_dovi_frame(struct vframe_s *vf);
 extern void update_graphic_width_height(unsigned int width,
        unsigned int height);
 extern bool is_dolby_vision_el_disable(void);
+extern bool is_dovi_dual_layer_frame(struct vframe_s *vf);
 #endif