From 943917b17646eeb4f0d74e39cceffc6d3ab0f59c Mon Sep 17 00:00:00 2001 From: "apollo.ling" Date: Wed, 2 Dec 2020 17:34:37 +0800 Subject: [PATCH] vdec: add interlace second field secure flag [1/1] 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 --- drivers/frame_provider/decoder/avs2/vavs2.c | 1 + drivers/frame_provider/decoder/avs_multi/avs_multi.c | 5 ++++- drivers/frame_provider/decoder/h264_multi/vmh264.c | 4 +++- drivers/frame_provider/decoder/h265/vh265.c | 10 ++++++++++ drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c | 2 ++ drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c | 6 +++--- drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c | 3 +++ drivers/frame_provider/decoder/utils/vdec.c | 1 - drivers/frame_provider/decoder/vav1/vav1.c | 2 ++ drivers/frame_provider/decoder/vp9/vvp9.c | 2 ++ 10 files changed, 30 insertions(+), 6 deletions(-) diff --git a/drivers/frame_provider/decoder/avs2/vavs2.c b/drivers/frame_provider/decoder/avs2/vavs2.c index fb8a5f9..dc8782a 100644 --- a/drivers/frame_provider/decoder/avs2/vavs2.c +++ b/drivers/frame_provider/decoder/avs2/vavs2.c @@ -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); diff --git a/drivers/frame_provider/decoder/avs_multi/avs_multi.c b/drivers/frame_provider/decoder/avs_multi/avs_multi.c index ae341c4..ae32471 100644 --- a/drivers/frame_provider/decoder/avs_multi/avs_multi.c +++ b/drivers/frame_provider/decoder/avs_multi/avs_multi.c @@ -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, diff --git a/drivers/frame_provider/decoder/h264_multi/vmh264.c b/drivers/frame_provider/decoder/h264_multi/vmh264.c index 4d18091..7ff9f51 100644 --- a/drivers/frame_provider/decoder/h264_multi/vmh264.c +++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c @@ -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); diff --git a/drivers/frame_provider/decoder/h265/vh265.c b/drivers/frame_provider/decoder/h265/vh265.c index 698cf22..f65c125 100644 --- a/drivers/frame_provider/decoder/h265/vh265.c +++ b/drivers/frame_provider/decoder/h265/vh265.c @@ -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); diff --git a/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c b/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c index 2570f65..5f39717 100644 --- a/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c +++ b/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c @@ -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); diff --git a/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c b/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c index e988ec5..8359c69 100644 --- a/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c +++ b/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c @@ -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); diff --git a/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c b/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c index 601d610..64fc836 100644 --- a/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c +++ b/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c @@ -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); diff --git a/drivers/frame_provider/decoder/utils/vdec.c b/drivers/frame_provider/decoder/utils/vdec.c index d8c2c11..72cfe0d 100644 --- a/drivers/frame_provider/decoder/utils/vdec.c +++ b/drivers/frame_provider/decoder/utils/vdec.c @@ -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 { diff --git a/drivers/frame_provider/decoder/vav1/vav1.c b/drivers/frame_provider/decoder/vav1/vav1.c index 9152e5e..6785d23 100644 --- a/drivers/frame_provider/decoder/vav1/vav1.c +++ b/drivers/frame_provider/decoder/vav1/vav1.c @@ -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); diff --git a/drivers/frame_provider/decoder/vp9/vvp9.c b/drivers/frame_provider/decoder/vp9/vvp9.c index 44461fb..6e2a974 100644 --- a/drivers/frame_provider/decoder/vp9/vvp9.c +++ b/drivers/frame_provider/decoder/vp9/vvp9.c @@ -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); -- 2.20.1