vdec: add interlace second field secure flag [1/1]
authorapollo.ling <apollo.ling@amlogic.com>
Wed, 2 Dec 2020 09:34:37 +0000 (17:34 +0800)
committerapollo.ling <apollo.ling@amlogic.com>
Wed, 2 Dec 2020 09:34:42 +0000 (17:34 +0800)
PD#SWPL-38222

Problem:
nagra video was green screen

Solution:
add interlace second field secure flag

Verify:
ah212

Change-Id: I43fa2d624a751570db23a25da2d65e42354dcc72
Signed-off-by: apollo.ling <apollo.ling@amlogic.com>
drivers/frame_provider/decoder/avs2/vavs2.c
drivers/frame_provider/decoder/avs_multi/avs_multi.c
drivers/frame_provider/decoder/h264_multi/vmh264.c
drivers/frame_provider/decoder/h265/vh265.c
drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c
drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c
drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c
drivers/frame_provider/decoder/utils/vdec.c
drivers/frame_provider/decoder/vav1/vav1.c
drivers/frame_provider/decoder/vp9/vvp9.c

index fb8a5f95058e4d173f18929e4df8baec88e35398..dc8782a5542f76686489ea2e64fafbe8f930babc 100644 (file)
@@ -4624,6 +4624,7 @@ static int avs2_prepare_display_buf(struct AVS2Decoder_s *dec)
                        struct vdec_info tmp4x;
                        int stream_offset = pic->stream_offset;
                        set_vframe(dec, vf, pic, 0);
+                       decoder_do_frame_check(pvdec, vf);
                        vdec_vframe_ready(pvdec, vf);
                        kfifo_put(&dec->display_q, (const struct vframe_s *)vf);
                        ATRACE_COUNTER(MODULE_NAME, vf->pts);
index ae341c470cf5b7cf61465343e4f2c6e099ece54c..ae324719b85d1aaa8348a3f97d465f2ba444f47d 100644 (file)
@@ -3495,6 +3495,7 @@ static irqreturn_t vmavs_isr_thread_fn(struct vdec_s *vdec, int irq)
 
                                debug_print(hw, PRINT_FLAG_PTS,
                                        "interlace1 vf->pts = %d, vf->pts_us64 = %lld, pts_valid = %d\n", vf->pts, vf->pts_us64, pts_valid);
+                               vdec_vframe_ready(vdec, vf);
                                kfifo_put(&hw->display_q,
                                                  (const struct vframe_s *)vf);
                                avs_vf_notify_receiver(hw, PROVIDER_NAME,
@@ -3576,6 +3577,7 @@ static irqreturn_t vmavs_isr_thread_fn(struct vdec_s *vdec, int irq)
                                }
                                debug_print(hw, PRINT_FLAG_PTS,
                                        "interlace2 vf->pts = %d, vf->pts_us64 = %lld, pts_valid = %d\n", vf->pts, vf->pts_us64, pts_valid);
+                               vdec_vframe_ready(vdec, vf);
                                kfifo_put(&hw->display_q,
                                                  (const struct vframe_s *)vf);
                                avs_vf_notify_receiver(hw, PROVIDER_NAME,
@@ -3675,7 +3677,8 @@ static irqreturn_t vmavs_isr_thread_fn(struct vdec_s *vdec, int irq)
                                                (((u64)vf->duration << 32) & 0xffffffff00000000) | offset;
                                        vf->pts = 0;
                                }
-                               vdec_vframe_ready(hw_to_vdec(hw), vf);
+                               decoder_do_frame_check(hw_to_vdec(hw), vf);
+                               vdec_vframe_ready(vdec, vf);
                                kfifo_put(&hw->display_q,
                                                  (const struct vframe_s *)vf);
                                avs_vf_notify_receiver(hw, PROVIDER_NAME,
index 4d180916ec367be53c5605ea1667fe851d3aed29..7ff9f51ade8022142b6674f2e2ea479ab97d2ad2 100644 (file)
@@ -3067,7 +3067,7 @@ static int post_video_frame(struct vdec_s *vdec, struct FrameStore *frame)
                        pvdec = hw_to_vdec(hw);
                        memset(&vs, 0, sizeof(struct vdec_info));
                        pvdec->dec_status(pvdec, &vs);
-                       vdec_vframe_ready(pvdec, vf);
+                       decoder_do_frame_check(pvdec, vf);
                        vdec_fill_vdec_frame(pvdec, &hw->vframe_qos, &vs, vf, frame->hw_decode_time);
 
                        dpb_print(DECODE_ID(hw), PRINT_FLAG_DPB_DETAIL,
@@ -3090,6 +3090,7 @@ static int post_video_frame(struct vdec_s *vdec, struct FrameStore *frame)
                                vf->pts = 0;
                        }
                }
+               vdec_vframe_ready(hw_to_vdec(hw), vf);
                kfifo_put(&hw->display_q, (const struct vframe_s *)vf);
                ATRACE_COUNTER(MODULE_NAME, vf->pts);
                hw->vf_pre_count++;
@@ -3218,6 +3219,7 @@ int notify_v4l_eos(struct vdec_s *vdec)
                vf->v4l_mem_handle      = (index == INVALID_IDX) ? (ulong)fb :
                                        hw->buffer_spec[index].cma_alloc_addr;
 
+               vdec_vframe_ready(vdec, vf);
                kfifo_put(&hw->display_q, (const struct vframe_s *)vf);
 
                ATRACE_COUNTER(MODULE_NAME, vf->pts);
index 698cf220e4ed849a9e30e0be6be5b9de0c8803ea..f65c12596e90c225f426d1f2dc5434ff1964d253 100644 (file)
@@ -8994,6 +8994,7 @@ static int process_pending_vframe(struct hevc_state_s *hevc,
                                                vf->type |= VIDTYPE_SCATTER;
                                }
                                hevc->vf_pre_count++;
+                               vdec_vframe_ready(hw_to_vdec(hevc), vf);
                                kfifo_put(&hevc->display_q,
                                (const struct vframe_s *)vf);
                                ATRACE_COUNTER(MODULE_NAME, vf->pts);
@@ -9016,6 +9017,7 @@ static int process_pending_vframe(struct hevc_state_s *hevc,
                                vf->index |= (pair_pic->index << 8);
                                vf->canvas1Addr = spec2canvas(pair_pic);
                                pair_pic->vf_ref++;
+                               vdec_vframe_ready(hw_to_vdec(hevc), vf);
                                kfifo_put(&hevc->display_q,
                                (const struct vframe_s *)vf);
                                ATRACE_COUNTER(MODULE_NAME, vf->pts);
@@ -9043,6 +9045,7 @@ static int process_pending_vframe(struct hevc_state_s *hevc,
                                vf->index |= pair_pic->index;
                                vf->canvas0Addr = spec2canvas(pair_pic);
                                pair_pic->vf_ref++;
+                               vdec_vframe_ready(hw_to_vdec(hevc), vf);
                                kfifo_put(&hevc->display_q,
                                (const struct vframe_s *)vf);
                                ATRACE_COUNTER(MODULE_NAME, vf->pts);
@@ -9164,6 +9167,7 @@ static inline void hevc_update_gvs(struct hevc_state_s *hevc)
 static void put_vf_to_display_q(struct hevc_state_s *hevc, struct vframe_s *vf)
 {
        hevc->vf_pre_count++;
+       decoder_do_frame_check(hw_to_vdec(hevc), vf);
        vdec_vframe_ready(hw_to_vdec(hevc), vf);
        kfifo_put(&hevc->display_q, (const struct vframe_s *)vf);
        ATRACE_COUNTER(MODULE_NAME, vf->pts);
@@ -9550,6 +9554,7 @@ static int post_video_frame(struct vdec_s *vdec, struct PIC_s *pic)
                        }
                        put_vf_to_display_q(hevc, vf);
                        hevc->vf_pre_count++;
+                       vdec_vframe_ready(hw_to_vdec(hevc), vf2);
                        kfifo_put(&hevc->display_q,
                        (const struct vframe_s *)vf2);
                        ATRACE_COUNTER(MODULE_NAME, vf2->pts);
@@ -9595,10 +9600,12 @@ static int post_video_frame(struct vdec_s *vdec, struct PIC_s *pic)
                        }
                        put_vf_to_display_q(hevc, vf);
                        hevc->vf_pre_count++;
+                       vdec_vframe_ready(hw_to_vdec(hevc), vf2);
                        kfifo_put(&hevc->display_q,
                        (const struct vframe_s *)vf2);
                        ATRACE_COUNTER(MODULE_NAME, vf2->pts);
                        hevc->vf_pre_count++;
+                       vdec_vframe_ready(hw_to_vdec(hevc), vf3);
                        kfifo_put(&hevc->display_q,
                        (const struct vframe_s *)vf3);
                        ATRACE_COUNTER(MODULE_NAME, vf3->pts);
@@ -9616,6 +9623,7 @@ static int post_video_frame(struct vdec_s *vdec, struct PIC_s *pic)
                        process_pending_vframe(hevc,
                        pic, (pic->pic_struct == 9));
 
+                       decoder_do_frame_check(vdec, vf);
                        vdec_vframe_ready(vdec, vf);
                        /* process current vf */
                        kfifo_put(&hevc->pending_q,
@@ -9665,6 +9673,7 @@ static int post_video_frame(struct vdec_s *vdec, struct PIC_s *pic)
                                nv_order | VIDTYPE_VIU_FIELD;
                                vf->index = (pic->index << 8) | 0xff;
                        }
+                       decoder_do_frame_check(vdec, vf);
                        vdec_vframe_ready(vdec, vf);
                        kfifo_put(&hevc->pending_q,
                        (const struct vframe_s *)vf);
@@ -9858,6 +9867,7 @@ static int notify_v4l_eos(struct vdec_s *vdec)
                vf->flag                = VFRAME_FLAG_EMPTY_FRAME_V4L;
                vf->v4l_mem_handle      = (index == INVALID_IDX) ? (ulong)fb :
                                        hw->m_BUF[index].v4l_ref_buf_addr;
+               vdec_vframe_ready(vdec, vf);
                kfifo_put(&hw->display_q, (const struct vframe_s *)vf);
                vf_notify_receiver(vdec->vf_provider_name,
                        VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);
index 2570f65864d260700969c9cce0706037b341f05d..5f3971781654d3c5740b33ca93aec34fa4ecc159 100644 (file)
@@ -437,6 +437,7 @@ static irqreturn_t vmjpeg_isr_thread_fn(struct vdec_s *vdec, int irq)
        vf->mem_handle =
                decoder_bmmu_box_get_mem_handle(
                        hw->mm_blk_handle, index);
+       decoder_do_frame_check(vdec, vf);
        vdec_vframe_ready(vdec, vf);
        kfifo_put(&hw->display_q, (const struct vframe_s *)vf);
        ATRACE_COUNTER(MODULE_NAME, vf->pts);
@@ -1462,6 +1463,7 @@ static int notify_v4l_eos(struct vdec_s *vdec)
                        hw->buffer_spec[index].v4l_ref_buf_addr;
                vf->flag = VFRAME_FLAG_EMPTY_FRAME_V4L;
 
+               vdec_vframe_ready(vdec, vf);
                kfifo_put(&hw->display_q, (const struct vframe_s *)vf);
                vf_notify_receiver(vdec->vf_provider_name,
                        VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);
index e988ec50801ec8a25e52fa6ab5fc54fc0f0fd5cb..8359c695c9ef8d8d5fba29a1c17975ab5dbd9292 100644 (file)
@@ -1678,9 +1678,7 @@ static int prepare_display_buf(struct vdec_mpeg12_hw_s *hw,
                                vf->duration, vf->type, vf->pts, vf->pts_us64);
                        hw->disp_num++;
                        if (i == 0) {
-                               struct vdec_s *vdec = hw_to_vdec(hw);
-
-                               vdec_vframe_ready(vdec, vf);
+                               decoder_do_frame_check(vdec, vf);
                                hw_update_gvs(hw);
                                vdec_fill_vdec_frame(vdec, &hw->vframe_qos,
                                        &hw->gvs, vf, pic->hw_decode_time);
@@ -1701,6 +1699,7 @@ static int prepare_display_buf(struct vdec_mpeg12_hw_s *hw,
                                        vf->pts = 0;
                                }
                        }
+                       vdec_vframe_ready(vdec, vf);
                        kfifo_put(&hw->display_q,
                                (const struct vframe_s *)vf);
                        /* if (hw->disp_num == 1) { */
@@ -2206,6 +2205,7 @@ static int notify_v4l_eos(struct vdec_s *vdec)
                                                        hw->pics[index].v4l_ref_buf_addr;
                vf->flag = VFRAME_FLAG_EMPTY_FRAME_V4L;
 
+               vdec_vframe_ready(vdec, vf);
                kfifo_put(&hw->display_q, (const struct vframe_s *)vf);
                vf_notify_receiver(vdec->vf_provider_name,
                        VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);
index 601d61082bd33911b44040ab901f787f010ca8a8..64fc8368b0c2c199fc7ee3e9c4d27afbdd5b0b34 100644 (file)
@@ -812,6 +812,7 @@ static int prepare_display_buf(struct vdec_mpeg4_hw_s * hw,
                        vf->mem_handle =
                                decoder_bmmu_box_get_mem_handle(
                                        hw->mm_blk_handle, index);
+                       decoder_do_frame_check(vdec, vf);
                        vdec_vframe_ready(vdec, vf);
                        kfifo_put(&hw->display_q,
                                (const struct vframe_s *)vf);
@@ -900,6 +901,7 @@ static int prepare_display_buf(struct vdec_mpeg4_hw_s * hw,
                        vf->mem_handle =
                                decoder_bmmu_box_get_mem_handle(
                                        hw->mm_blk_handle, index);
+                       decoder_do_frame_check(vdec, vf);
                        vdec_vframe_ready(vdec, vf);
                        kfifo_put(&hw->display_q,
                                (const struct vframe_s *)vf);
@@ -1510,6 +1512,7 @@ static int notify_v4l_eos(struct vdec_s *vdec)
                                                        hw->pic[index].v4l_ref_buf_addr;;
                vf->flag = VFRAME_FLAG_EMPTY_FRAME_V4L;
 
+               vdec_vframe_ready(vdec, vf);
                kfifo_put(&hw->display_q, (const struct vframe_s *)vf);
                vf_notify_receiver(vdec->vf_provider_name,
                        VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);
index d8c2c1174498db0d2b47ba7c4e0436bc84e79e42..72cfe0d158db6f667921cdd2b33ec5d58e14dffb 100644 (file)
@@ -5592,7 +5592,6 @@ void vdec_fill_vdec_frame(struct vdec_s *vdec, struct vframe_qos_s *vframe_qos,
 EXPORT_SYMBOL(vdec_fill_vdec_frame);
 
 void vdec_vframe_ready(struct vdec_s *vdec, struct vframe_s *vf) {
-       decoder_do_frame_check(vdec, vf);
        if (vdec_secure(vdec)) {
                vf->flag |= VFRAME_FLAG_VIDEO_SECURE;
        } else {
index 9152e5e7b9a33ce79d3da688fb9478ec1fd1e92b..6785d2338dc1d86b6bb36931627bee13f4578617 100644 (file)
@@ -6274,6 +6274,7 @@ static int prepare_display_buf(struct AV1HW_s *hw,
                update_vf_memhandle(hw, vf, pic_config);
 
                av1_inc_vf_ref(hw, pic_config->index);
+               decoder_do_frame_check(hw_to_vdec(hw), vf);
                vdec_vframe_ready(hw_to_vdec(hw), vf);
                kfifo_put(&hw->display_q, (const struct vframe_s *)vf);
                ATRACE_COUNTER(MODULE_NAME, vf->pts);
@@ -6333,6 +6334,7 @@ static int notify_v4l_eos(struct vdec_s *vdec)
                vf->v4l_mem_handle      = (index == INVALID_IDX) ? (ulong)fb :
                                        hw->m_BUF[index].v4l_ref_buf_addr;
 
+               vdec_vframe_ready(vdec, vf);
                kfifo_put(&hw->display_q, (const struct vframe_s *)vf);
                vf_notify_receiver(vdec->vf_provider_name,
                        VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);
index 44461fb5cac8d13efb2132072488f591a77fed71..6e2a974307ba8124fab22fb86ba30918236d0034 100644 (file)
@@ -7498,6 +7498,7 @@ static int prepare_display_buf(struct VP9Decoder_s *pbi,
                        struct vdec_info tmp4x;
 
                        inc_vf_ref(pbi, pic_config->index);
+                       decoder_do_frame_check(pvdec, vf);
                        vdec_vframe_ready(pvdec, vf);
                        kfifo_put(&pbi->display_q, (const struct vframe_s *)vf);
                        ATRACE_COUNTER(MODULE_NAME, vf->pts);
@@ -7570,6 +7571,7 @@ static int notify_v4l_eos(struct vdec_s *vdec)
                vf->v4l_mem_handle      = (index == INVALID_IDX) ? (ulong)fb :
                                        hw->m_BUF[index].v4l_ref_buf_addr;
 
+               vdec_vframe_ready(vdec, vf);
                kfifo_put(&hw->display_q, (const struct vframe_s *)vf);
                vf_notify_receiver(vdec->vf_provider_name,
                        VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);