From c4bdacb1b38e4e063a646f97e9beb851a7daa0dd Mon Sep 17 00:00:00 2001 From: Brian Zhu Date: Thu, 28 Nov 2019 14:06:09 +0800 Subject: [PATCH] amvideo: fix black screen issue when provide reset [1/1] PD#SWPL-17497 Problem: When decode resets before first frame coming, vpp will disable video layer. Solution: Only switch the dispbuf_mapping after available frame toggled Verify: Verifed on u212 Change-Id: I798997ac9355efd0c477a7c9c59513c82110748f Signed-off-by: Brian Zhu --- drivers/amlogic/media/video_sink/video.c | 12 ++++++++---- drivers/amlogic/media/video_sink/video_hw.c | 16 ++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index 8c8260e2a225..b4947ded6e28 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -4120,7 +4120,8 @@ SET_FILTER: new_frame = cur_pipbuf; } } - vd_layer[0].dispbuf_mapping = &cur_pipbuf; + if (new_frame || cur_pipbuf) + vd_layer[0].dispbuf_mapping = &cur_pipbuf; cur_blackout = blackout_pip | force_blackout; } else if (vd1_path_id != VFM_PATH_INVAILD) { /* priamry display on VD1 */ @@ -4140,7 +4141,8 @@ SET_FILTER: new_frame = cur_dispbuf; } } - vd_layer[0].dispbuf_mapping = &cur_dispbuf; + if (new_frame || cur_dispbuf) + vd_layer[0].dispbuf_mapping = &cur_dispbuf; cur_blackout = blackout | force_blackout; } else { cur_blackout = 1; @@ -4237,7 +4239,8 @@ SET_FILTER: new_frame2 = cur_dispbuf; } } - vd_layer[1].dispbuf_mapping = &cur_dispbuf; + if (new_frame2 || cur_dispbuf) + vd_layer[1].dispbuf_mapping = &cur_dispbuf; cur_blackout = blackout | force_blackout; } else if (vd2_path_id != VFM_PATH_INVAILD) { /* pip display in VD2 */ @@ -4256,7 +4259,8 @@ SET_FILTER: new_frame2 = cur_pipbuf; } } - vd_layer[1].dispbuf_mapping = &cur_pipbuf; + if (new_frame2 || cur_pipbuf) + vd_layer[1].dispbuf_mapping = &cur_pipbuf; cur_blackout = blackout_pip | force_blackout; } else { cur_blackout = 1; diff --git a/drivers/amlogic/media/video_sink/video_hw.c b/drivers/amlogic/media/video_sink/video_hw.c index ab8d27ce974d..c4405320a3d6 100644 --- a/drivers/amlogic/media/video_sink/video_hw.c +++ b/drivers/amlogic/media/video_sink/video_hw.c @@ -2329,10 +2329,10 @@ static void disable_vd1_blend(struct video_layer_s *layer) if (layer->dispbuf && is_local_vf(layer->dispbuf)) layer->dispbuf = NULL; - if (layer->dispbuf_mapping && - *layer->dispbuf_mapping && - is_local_vf(*layer->dispbuf_mapping)) { - *layer->dispbuf_mapping = NULL; + if (layer->dispbuf_mapping) { + if (*layer->dispbuf_mapping && + is_local_vf(*layer->dispbuf_mapping)) + *layer->dispbuf_mapping = NULL; layer->dispbuf_mapping = NULL; layer->dispbuf = NULL; } @@ -2364,10 +2364,10 @@ static void disable_vd2_blend(struct video_layer_s *layer) if (layer->dispbuf && is_local_vf(layer->dispbuf)) layer->dispbuf = NULL; - if (layer->dispbuf_mapping && - *layer->dispbuf_mapping && - is_local_vf(*layer->dispbuf_mapping)) { - *layer->dispbuf_mapping = NULL; + if (layer->dispbuf_mapping) { + if (*layer->dispbuf_mapping && + is_local_vf(*layer->dispbuf_mapping)) + *layer->dispbuf_mapping = NULL; layer->dispbuf_mapping = NULL; layer->dispbuf = NULL; }