From: yao liu Date: Tue, 3 Sep 2019 09:44:18 +0000 (-0400) Subject: dv: display abnormal after hotplug hdmi [1/1] X-Git-Tag: hardkernel-4.9.236-104~689 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27c28074f7cfba62fb262ce099b3e93c314f83c8;p=platform%2Fkernel%2Flinux-amlogic.git dv: display abnormal after hotplug hdmi [1/1] PD#SWPL-13367 Problem: HDMI hotplugged during video pause, system control first set disable_video 1, then DV core turn on due to sink changed, then OMX sets disable video 2. DV core 1 is disabled after video_onoff_state is set to OFF. Solution: Monitor video status, parser and toggle once to enable core1 when video off->on. Verify: SM1 Change-Id: Ied6f1f05ed1592f9917c093b5d567904a3bdc61c Signed-off-by: yao liu --- diff --git a/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c b/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c index 5f83a99..706ce4d 100644 --- a/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c +++ b/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c @@ -276,6 +276,8 @@ static bool is_osd_off; static bool force_reset_core2; static int core1_switch; static int core3_switch; +static int video_enable; + module_param(vtotal_add, uint, 0664); MODULE_PARM_DESC(vtotal_add, "\n vtotal_add\n"); module_param(vpotch, uint, 0664); @@ -2601,6 +2603,21 @@ static int is_graphic_changed(void) } return ret; } + +static int is_video_turn_on(void) +{ + int ret = 0; + int new_video_enable = get_video_enabled(); + + if (video_enable != new_video_enable) { + pr_dolby_dbg("video_enable changed %d-%d\n", + video_enable, new_video_enable); + ret = new_video_enable ? 1 : -1; + } + video_enable = new_video_enable; + return ret; +} + static void adjust_vpotch(void) { const struct vinfo_s *vinfo = get_current_vinfo(); @@ -6814,6 +6831,10 @@ int dolby_vision_process(struct vframe_s *vf, u32 display_size, dolby_vision_parse_metadata(vf, 1, false); dolby_vision_set_toggle_flag(1); } + if (is_video_turn_on() == 1) { + if (vf && !dolby_vision_parse_metadata(vf, 0, false)) + dolby_vision_set_toggle_flag(1); + } /* only monitor dolby_vision_policy */ /* other policy will be updated for video */