From 83ff9cb5251a10d27feedb7adf6b4d7c1feed51d Mon Sep 17 00:00:00 2001 From: yao liu Date: Fri, 28 Jun 2019 21:16:21 +0800 Subject: [PATCH] dolby: demo-debug.apk test fail [1/1] 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 Signed-off-by: Luan Yuan --- .../enhancement/amdolby_vision/amdolby_vision.c | 22 ++++++++++++++++++++++ drivers/amlogic/media/video_sink/video.c | 12 +++++++++++- .../amlogic/media/amdolbyvision/dolby_vision.h | 2 +- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c b/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c index 0562a48..b7ee75a 100644 --- a/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c +++ b/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c @@ -4118,6 +4118,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) diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index 8c9a7ce..117eb59 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -8866,7 +8866,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; } @@ -8889,6 +8889,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); @@ -8898,6 +8899,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 @@ -8917,6 +8920,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); } diff --git a/include/linux/amlogic/media/amdolbyvision/dolby_vision.h b/include/linux/amlogic/media/amdolbyvision/dolby_vision.h index 59ba5231..f5e0e1c 100644 --- a/include/linux/amlogic/media/amdolbyvision/dolby_vision.h +++ b/include/linux/amlogic/media/amdolbyvision/dolby_vision.h @@ -75,5 +75,5 @@ extern int enable_rgb_to_yuv_matrix_for_dvll( extern bool is_dovi_frame(struct vframe_s *vf); extern void update_graphic_width_height(unsigned int width, unsigned int height); - +extern bool is_dovi_dual_layer_frame(struct vframe_s *vf); #endif -- 2.7.4