video_composer: fix tunnel mode seek black screen [1/1]
authorjintao xu <jintao.xu@amlogic.com>
Wed, 27 Nov 2019 06:23:53 +0000 (14:23 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Thu, 28 Nov 2019 03:06:11 +0000 (20:06 -0700)
PD#SWPL-17424

Problem:
tunnel mode seek black screen

Solution:
set block_policy 0 when sideband

Verify:
U212

Change-Id: Iac9aff1db39c0366178025fc06ca91571948fa7c
Signed-off-by: jintao xu <jintao.xu@amlogic.com>
drivers/amlogic/media/video_processor/video_composer/video_composer.c
drivers/amlogic/media/video_sink/video.c
drivers/amlogic/media/video_sink/video_hw.c

index 9c1c56330fb7f73299b9e51c219677917554e083..4ca7e141044b4c40152b1a3383b4de7eec2441eb 100644 (file)
@@ -1311,6 +1311,8 @@ static void set_frames_info(struct composer_dev *dev,
                                dev->need_empty_ready = true;
                                wake_up_interruptible(&dev->wq);
                        }
+                       if (!dev->is_sideband)
+                               set_blackout_policy(0);
                        dev->is_sideband = true;
                        current_is_sideband = true;
                }
@@ -1324,9 +1326,11 @@ static void set_frames_info(struct composer_dev *dev,
 
        if ((dev->is_sideband && !current_is_sideband) ||
            (dev->received_count == 0)) {
-               if (dev->is_sideband && !current_is_sideband)
+               if (dev->is_sideband && !current_is_sideband) {
+                       set_blackout_policy(1);
                        vc_print(dev->index, PRINT_OTHER,
                                 "sideband to non\n");
+               }
                dev->is_sideband = false;
                if (dev->index == 0)
                        set_video_path_select("video_render.0", 0);
@@ -1671,6 +1675,9 @@ static int video_composer_uninit(struct composer_dev *dev)
        int ret;
        int timeout = 0;
 
+       if (dev->is_sideband)
+               set_blackout_policy(1);
+
        disable_video_layer(dev, 1);
        video_set_global_output(dev->index, 0);
        ret = video_composer_release_path(dev);
index e11a0de72f0c28c6bb3b641b3b5a2662cc6e0b54..eb1334bb87add3e316f0ff5315d79a546d802fda 100644 (file)
@@ -4433,7 +4433,8 @@ SET_FILTER:
                                new_frame = gvideo_recv[0]->cur_buf;
                        }
                }
-               vd_layer[0].dispbuf_mapping = &gvideo_recv[0]->cur_buf;
+               if (new_frame || gvideo_recv[0]->cur_buf)
+                       vd_layer[0].dispbuf_mapping = &gvideo_recv[0]->cur_buf;
                cur_blackout = 1;
        } else if (gvideo_recv[1] &&
            (gvideo_recv[1]->path_id == vd1_path_id)) {
@@ -4455,7 +4456,8 @@ SET_FILTER:
                                new_frame = gvideo_recv[1]->cur_buf;
                        }
                }
-               vd_layer[0].dispbuf_mapping = &gvideo_recv[1]->cur_buf;
+               if (new_frame || gvideo_recv[1]->cur_buf)
+                       vd_layer[0].dispbuf_mapping = &gvideo_recv[1]->cur_buf;
                cur_blackout = 1;
        } else if (vd1_path_id == VFM_PATH_PIP) {
                /* pip display on VD1 */
@@ -4475,7 +4477,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 */
@@ -4495,7 +4498,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;
@@ -4612,7 +4616,8 @@ SET_FILTER:
                                new_frame2 = gvideo_recv[0]->cur_buf;
                        }
                }
-               vd_layer[1].dispbuf_mapping = &gvideo_recv[0]->cur_buf;
+               if (new_frame2 || gvideo_recv[0]->cur_buf)
+                       vd_layer[1].dispbuf_mapping = &gvideo_recv[0]->cur_buf;
                cur_blackout = 1;
        } else if (gvideo_recv[1] &&
            (gvideo_recv[1]->path_id == vd2_path_id)) {
@@ -4634,7 +4639,8 @@ SET_FILTER:
                                new_frame2 = gvideo_recv[1]->cur_buf;
                        }
                }
-               vd_layer[1].dispbuf_mapping = &gvideo_recv[1]->cur_buf;
+               if (new_frame2 || gvideo_recv[1]->cur_buf)
+                       vd_layer[1].dispbuf_mapping = &gvideo_recv[1]->cur_buf;
                cur_blackout = 1;
        } else if (vd2_path_id == VFM_PATH_AMVIDEO) {
                /* priamry display in VD2 */
@@ -4653,7 +4659,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 */
@@ -4672,7 +4679,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;
index 0a0ce1ede72765771880b894f435438b08ab403b..17df909e807f678a288ab03d8d567fafc9da9bca 100644 (file)
@@ -2399,10 +2399,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;
        }
@@ -2436,10 +2436,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;
        }