author | robin zhu <robin.zhu@amlogic.com> | 2019-10-01 03:16:32 (GMT) |
---|---|---|
committer | zihuan.ling <zihuan.ling@amlogic.com> | 2019-10-12 01:38:17 (GMT) |
commit | b9932b505b6c8e33612b8be91be5e1f1495c2002 (patch) | |
tree | 0820fe1b771640cbd4834400c6a4aec9ba8e477b | |
parent | b69c991c11005681b00c2a51f0129eb36bced4a8 (diff) | |
download | common-b9932b505b6c8e33612b8be91be5e1f1495c2002.zip common-b9932b505b6c8e33612b8be91be5e1f1495c2002.tar.gz common-b9932b505b6c8e33612b8be91be5e1f1495c2002.tar.bz2 |
dv: flash when start playing dv [1/1]
PD#SWPL-14836
Problem:
1) video enable flag is not update correctly
2) source format not update correctly,
which cause wrong dv control path reset
3) when start play video off and repeat frame,
triggers wrong fake sdr frame
Solution:
1) change video enable flag to use both
video_global_output and video_enabled
2) use latest src format insdead of using cur format
3) add repeat frame and video on to off flag to
prevent wrong fake sdr frame
Verify:
Verified on AC213
Change-Id: Ia8ee7bea0b8bcb33e18275611287e0b563caf978
Signed-off-by: robin zhu <robin.zhu@amlogic.com>
-rw-r--r-- | drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c | 39 | ||||
-rw-r--r-- | drivers/amlogic/media/video_sink/video.c | 4 |
2 files changed, 29 insertions, 14 deletions
diff --git a/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c b/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c index eb9efa1..c744865 100644 --- a/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c +++ b/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c @@ -5827,6 +5827,8 @@ int dolby_vision_parse_metadata( enum signal_format_e src_format = FORMAT_SDR; enum signal_format_e check_format; enum signal_format_e dst_format; + enum signal_format_e cur_src_format; + enum signal_format_e cur_dst_format; int total_md_size = 0; int total_comp_size = 0; bool el_flag = 0; @@ -6477,10 +6479,25 @@ int dolby_vision_parse_metadata( graphic_min = graphic_max = 0; #ifdef V2_4 - if ((src_format != dovi_setting.src_format) - || (dst_format != dovi_setting.dst_format) || - ((!(dolby_vision_flags & FLAG_CERTIFICAION)) - && (frame_count == 0))) { + if (new_dovi_setting.video_width && new_dovi_setting.video_height) { + /* Toggle multiple frames in one vsync case: */ + /* new_dovi_setting.video_width will be available, but not be applied */ + /* So use new_dovi_setting as reference instead of dovi_setting. */ + /* To avoid unnecessary reset control_path. */ + cur_src_format = new_dovi_setting.src_format; + cur_dst_format = new_dovi_setting.dst_format; + } else { + cur_src_format = dovi_setting.src_format; + cur_dst_format = dovi_setting.dst_format; + } + + if ((src_format != cur_src_format) || + (dst_format != cur_dst_format)) { + pr_dolby_dbg( + "reset control path: format changed: src:%d->%d, dst:%d-%d, frame_count:%d, dolby_vision_flags:0x%x\n", + cur_src_format, src_format, + cur_dst_format, dst_format, + frame_count, dolby_vision_flags); p_funcs_stb->control_path( FORMAT_INVALID, 0, comp_buf[currentId], 0, @@ -6490,11 +6507,6 @@ int dolby_vision_parse_metadata( 0, &hdr10_param, &new_dovi_setting); - pr_dolby_dbg( - "reset control path: format changed: src:%d->%d, dst:%d-%d, frame_count:%d, dolby_vision_flags:0x%x\n", - dovi_setting.src_format, src_format, - dovi_setting.dst_format, dst_format, - frame_count, dolby_vision_flags); } if (!vsvdb_config_set_flag) { memset(&new_dovi_setting.vsvdb_tbl[0], @@ -7087,7 +7099,7 @@ int dolby_vision_process( get_hdr_module_status(VD1_PATH) != HDR_MODULE_ON) { vf = NULL; - rpt_vf = NULL; + /* rpt_vf = NULL; */ } graphic_status = is_graphic_changed(); @@ -7131,7 +7143,8 @@ int dolby_vision_process( } } - if (!vf && video_turn_off) { + if ((!vf && !rpt_vf && video_turn_off) || + (video_status == -1)) { if (dolby_vision_policy_process(&mode, FORMAT_SDR)) { pr_dolby_dbg("Fake SDR, mode->%d\n", mode); if (dolby_vision_policy == DOLBY_VISION_FOLLOW_SOURCE && @@ -7143,9 +7156,11 @@ int dolby_vision_process( } else dolby_vision_set_toggle_flag(1); } - if (dolby_vision_flags & FLAG_TOGGLE_FRAME) + if (dolby_vision_flags & FLAG_TOGGLE_FRAME) { + pr_dolby_dbg("update when video off\n"); dolby_vision_parse_metadata( NULL, 1, false, false); + } } if (dolby_vision_mode == DOLBY_VISION_OUTPUT_MODE_BYPASS) { diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index 4181ede..7cc3a72 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -1024,13 +1024,13 @@ static u32 hold_video; u32 get_video_enabled(void) { - return video_enabled; + return video_enabled && video_global_output; } EXPORT_SYMBOL(get_video_enabled); u32 get_videopip_enabled(void) { - return video2_enabled; + return video2_enabled && pip_global_output; } EXPORT_SYMBOL(get_videopip_enabled); |