author | apollo.ling <apollo.ling@amlogic.com> | 2020-03-14 06:46:04 (GMT) |
---|---|---|
committer | Hui Zhang <hui.zhang@amlogic.com> | 2020-04-13 05:55:10 (GMT) |
commit | 3be38e55a54cf2aa0f0a469b5acff571c4d0c3ed (patch) | |
tree | bec0ab033c9001018db530849b316fe3e9d0bf06 | |
parent | 22b36caaac2eadb0889f27d489531421db25c3f1 (diff) | |
download | media_modules-3be38e55a54cf2aa0f0a469b5acff571c4d0c3ed.zip media_modules-3be38e55a54cf2aa0f0a469b5acff571c4d0c3ed.tar.gz media_modules-3be38e55a54cf2aa0f0a469b5acff571c4d0c3ed.tar.bz2 |
media_modules: add some variables for driver interface [1/2]
PD#SWPL-21057
Problem:
some variable values obtained from the new driver interface are abnormal
Solution:
add the missing variables for driver interace
Verify:
x301,u212
Change-Id: I8d99820e7afcba2acd2adb39af7aa83911293f26
Signed-off-by: apollo.ling <apollo.ling@amlogic.com>
-rw-r--r-- | drivers/frame_provider/decoder/avs2/vavs2.c | 10 | ||||
-rw-r--r-- | drivers/frame_provider/decoder/h264_multi/vmh264.c | 20 | ||||
-rw-r--r-- | drivers/frame_provider/decoder/h265/vh265.c | 33 | ||||
-rw-r--r-- | drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c | 8 | ||||
-rw-r--r-- | drivers/frame_provider/decoder/vp9/vvp9.c | 154 |
5 files changed, 136 insertions, 89 deletions
diff --git a/drivers/frame_provider/decoder/avs2/vavs2.c b/drivers/frame_provider/decoder/avs2/vavs2.c index e459cd7..9da22f9 100644 --- a/drivers/frame_provider/decoder/avs2/vavs2.c +++ b/drivers/frame_provider/decoder/avs2/vavs2.c @@ -4592,6 +4592,7 @@ static int avs2_prepare_display_buf(struct AVS2Decoder_s *dec) } if (vf) { + struct vdec_info tmp4x; int stream_offset = pic->stream_offset; set_vframe(dec, vf, pic, 0); decoder_do_frame_check(pvdec, vf); @@ -4601,10 +4602,11 @@ static int avs2_prepare_display_buf(struct AVS2Decoder_s *dec) dec_update_gvs(dec); /*count info*/ vdec_count_info(dec->gvs, 0, stream_offset); - dec->gvs->bit_rate = bit_depth_luma; - dec->gvs->frame_data = bit_depth_chroma; - dec->gvs->samp_cnt = get_double_write_mode(dec); - vdec_fill_vdec_frame(pvdec, &dec->vframe_qos, dec->gvs, vf, pic->hw_decode_time); + memcpy(&tmp4x, dec->gvs, sizeof(struct vdec_info)); + tmp4x.bit_depth_luma = bit_depth_luma; + tmp4x.bit_depth_chroma = bit_depth_chroma; + tmp4x.double_write_mode = get_double_write_mode(dec); + vdec_fill_vdec_frame(pvdec, &dec->vframe_qos, &tmp4x, vf, pic->hw_decode_time); pvdec->vdec_fps_detec(pvdec->id); if (without_display_mode == 0) { vf_notify_receiver(dec->provider_name, diff --git a/drivers/frame_provider/decoder/h264_multi/vmh264.c b/drivers/frame_provider/decoder/h264_multi/vmh264.c index 27daf96..91d8c1f 100644 --- a/drivers/frame_provider/decoder/h264_multi/vmh264.c +++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c @@ -878,6 +878,7 @@ struct vdec_h264_hw_s { #endif unsigned int res_ch_flag; u32 b_frame_error_count; + struct vdec_info gvs; }; static u32 again_threshold; @@ -2716,6 +2717,12 @@ int prepare_display_buf(struct vdec_s *vdec, struct FrameStore *frame) hw->h264_pts_count++; } + if (frame->data_flag & ERROR_FLAG) { + vdec_count_info(&hw->gvs, 1, 0); + if (!hw->send_error_frame_flag) + hw->gvs.drop_frame_count++; + } + if ((frame->data_flag & NODISP_FLAG) || (frame->data_flag & NULL_FLAG) || ((!hw->send_error_frame_flag) && @@ -6629,7 +6636,7 @@ static void vmh264_dump_state(struct vdec_s *vdec) ); dpb_print(DECODE_ID(hw), 0, - "is_framebase(%d), eos %d, state 0x%x, dec_result 0x%x dec_frm %d disp_frm %d run %d not_run_ready %d input_empty %d bufmgr_reset_cnt %d\n", + "is_framebase(%d), eos %d, state 0x%x, dec_result 0x%x dec_frm %d disp_frm %d run %d not_run_ready %d input_empty %d bufmgr_reset_cnt %d error_frame_count = %d, drop_frame_count = %d\n", input_frame_based(vdec), hw->eos, hw->stat, @@ -6639,7 +6646,9 @@ static void vmh264_dump_state(struct vdec_s *vdec) run_count[DECODE_ID(hw)], not_run_ready[DECODE_ID(hw)], input_empty[DECODE_ID(hw)], - hw->reset_bufmgr_count + hw->reset_bufmgr_count, + hw->gvs.error_frame_count, + hw->gvs.drop_frame_count ); #ifdef DETECT_WRONG_MULTI_SLICE @@ -6866,7 +6875,7 @@ static int dec_status(struct vdec_s *vdec, struct vdec_info *vstatus) } else vstatus->frame_rate = -1; - vstatus->error_count = 0; + vstatus->error_count = hw->gvs.error_frame_count; vstatus->status = hw->stat; if (hw->h264_ar == 0x3ff) ar_tmp = (0x100 * @@ -6880,6 +6889,9 @@ static int dec_status(struct vdec_s *vdec, struct vdec_info *vstatus) vstatus->ratio_control = ar << DISP_RATIO_ASPECT_RATIO_BIT; + vstatus->error_frame_count = hw->gvs.error_frame_count; + vstatus->drop_frame_count = hw->gvs.drop_frame_count; + vstatus->frame_count = decode_frame_count[DECODE_ID(hw)]; snprintf(vstatus->vdec_name, sizeof(vstatus->vdec_name), "%s-%02d", DRIVER_NAME, hw->id); @@ -9502,6 +9514,8 @@ static int ammvdec_h264_probe(struct platform_device *pdev) atomic_set(&hw->vh264_active, 1); vdec_set_vframe_comm(pdata, DRIVER_NAME); + display_frame_count[DECODE_ID(hw)] = 0; + decode_frame_count[DECODE_ID(hw)] = 0; return 0; } diff --git a/drivers/frame_provider/decoder/h265/vh265.c b/drivers/frame_provider/decoder/h265/vh265.c index f1a023f..53aeb10 100644 --- a/drivers/frame_provider/decoder/h265/vh265.c +++ b/drivers/frame_provider/decoder/h265/vh265.c @@ -5918,6 +5918,14 @@ static void flush_output(struct hevc_state_s *hevc, struct PIC_s *pic) hevc_print_cont(hevc, 0, "Debug mode or error, recycle it\n"); } + /* + * Here the pic/frame error_mark is 1, + * and it won't be displayed, so increase + * the drop count + */ + hevc->gvs->drop_frame_count++; + /* error frame count also need increase */ + hevc->gvs->error_frame_count++; } else { if (hevc->i_only & 0x1 && pic_display->slice_type != 2) { @@ -6215,6 +6223,14 @@ static inline void hevc_pre_pic(struct hevc_state_s *hevc, hevc_print_cont(hevc, 0, "Debug or err,recycle it\n"); } + /* + * Here the pic/frame error_mark is 1, + * and it won't be displayed, so increase + * the drop count + */ + hevc->gvs->drop_frame_count++; + /* error frame count also need increase */ + hevc->gvs->error_frame_count++; } else { if (hevc->i_only & 0x1 && pic_display-> @@ -7385,6 +7401,8 @@ static int hevc_slice_segment_header_process(struct hevc_state_s *hevc, /*count info*/ vdec_count_info(hevc->gvs, hevc->cur_pic->error_mark, hevc->cur_pic->stream_offset); + if (hevc->PB_skip_mode == 2) + hevc->gvs->drop_frame_count++; } if (is_skip_decoding(hevc, @@ -7415,6 +7433,8 @@ static int hevc_slice_segment_header_process(struct hevc_state_s *hevc, /*count info*/ vdec_count_info(hevc->gvs, hevc->cur_pic->error_mark, hevc->cur_pic->stream_offset); + if (hevc->PB_skip_mode == 2) + hevc->gvs->drop_frame_count++; return 2; } #ifdef MCRCC_ENABLE @@ -8655,6 +8675,7 @@ static inline void hevc_update_gvs(struct hevc_state_s *hevc) else hevc->gvs->frame_rate = -1; } + hevc->gvs->error_count = hevc->gvs->error_frame_count; hevc->gvs->status = hevc->stat | hevc->fatal_error; if (hevc->gvs->ratio_control != hevc->ratio_control) hevc->gvs->ratio_control = hevc->ratio_control; @@ -8668,6 +8689,7 @@ static int prepare_display_buf(struct hevc_state_s *hevc, struct PIC_s *pic) unsigned short slice_type = pic->slice_type; ulong nv_order = VIDTYPE_VIU_NV21; u32 frame_size = 0; + struct vdec_info tmp4x; struct aml_vcodec_ctx * v4l2_ctx = hevc->v4l2_ctx; /* swap uv */ @@ -9197,10 +9219,11 @@ static int prepare_display_buf(struct hevc_state_s *hevc, struct PIC_s *pic) /*count info*/ vdec_count_info(hevc->gvs, 0, stream_offset); hevc_update_gvs(hevc); - hevc->gvs->bit_rate = hevc->bit_depth_luma; - hevc->gvs->frame_data = hevc->bit_depth_chroma; - hevc->gvs->samp_cnt = get_double_write_mode(hevc); - vdec_fill_vdec_frame(vdec, &hevc->vframe_qos, hevc->gvs, vf, pic->hw_decode_time); + memcpy(&tmp4x, hevc->gvs, sizeof(struct vdec_info)); + tmp4x.bit_depth_luma = hevc->bit_depth_luma; + tmp4x.bit_depth_chroma = hevc->bit_depth_chroma; + tmp4x.double_write_mode = get_double_write_mode(hevc); + vdec_fill_vdec_frame(vdec, &hevc->vframe_qos, &tmp4x, vf, pic->hw_decode_time); vdec->vdec_fps_detec(vdec->id); hevc_print(hevc, H265_DEBUG_BUFMGR, "%s(type %d index 0x%x poc %d/%d) pts(%d,%d) dur %d\n", @@ -11029,7 +11052,7 @@ int vh265_dec_status(struct vdec_info *vstatus) vstatus->frame_rate = 96000 / hevc->frame_dur; else vstatus->frame_rate = -1; - vstatus->error_count = 0; + vstatus->error_count = hevc->gvs->error_frame_count; vstatus->status = hevc->stat | hevc->fatal_error; vstatus->bit_rate = hevc->gvs->bit_rate; vstatus->frame_dur = hevc->frame_dur; diff --git a/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c b/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c index 71a45d0..eaf2e4e 100644 --- a/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c +++ b/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c @@ -1510,7 +1510,7 @@ static inline void hw_update_gvs(struct vdec_mpeg12_hw_s *hw) hw->gvs.ratio_control = hw->ratio_control; hw->gvs.status = hw->stat; - hw->gvs.error_count = READ_VREG(AV_SCRATCH_C); + hw->gvs.error_count = hw->gvs.error_frame_count; hw->gvs.drop_frame_count = hw->drop_frame_count; } @@ -1628,6 +1628,12 @@ static int prepare_display_buf(struct vdec_mpeg12_hw_s *hw, ((PICINFO_TYPE_MASK & pic->buffer_info) != PICINFO_TYPE_I))) { hw->drop_frame_count++; + /* Though we drop it, it is still an error frame, count it. + * Becase we've counted the error frame in vdec_count_info + * function, avoid count it twice. + */ + if (!(info & PICINFO_ERROR)) + hw->gvs.error_frame_count++; hw->vfbuf_use[index]--; kfifo_put(&hw->newframe_q, (const struct vframe_s *)vf); diff --git a/drivers/frame_provider/decoder/vp9/vvp9.c b/drivers/frame_provider/decoder/vp9/vvp9.c index 21bf5ad..7a8df62 100644 --- a/drivers/frame_provider/decoder/vp9/vvp9.c +++ b/drivers/frame_provider/decoder/vp9/vvp9.c @@ -1197,6 +1197,8 @@ struct VP9Decoder_s { u32 dynamic_buf_num_margin; struct vframe_s vframe_dummy; unsigned int res_ch_flag; + /*struct VP9Decoder_s vp9_decoder;*/ + union param_u vp9_param; }; static int vp9_print(struct VP9Decoder_s *pbi, @@ -2873,9 +2875,6 @@ int vp9_bufmgr_postproc(struct VP9Decoder_s *pbi) return 0; } -/*struct VP9Decoder_s vp9_decoder;*/ -union param_u vp9_param; - /************************************************** * *VP9 buffer management end @@ -7329,6 +7328,8 @@ static int prepare_display_buf(struct VP9Decoder_s *pbi, && pic_config->y_crop_height == 196 && (debug & VP9_DEBUG_NO_TRIGGER_FRAME) == 0 && (get_cpu_major_id() < AM_MESON_CPU_MAJOR_ID_TXLX))) { + struct vdec_info tmp4x; + inc_vf_ref(pbi, pic_config->index); decoder_do_frame_check(pvdec, vf); kfifo_put(&pbi->display_q, (const struct vframe_s *)vf); @@ -7337,10 +7338,11 @@ static int prepare_display_buf(struct VP9Decoder_s *pbi, pbi_update_gvs(pbi); /*count info*/ vdec_count_info(pbi->gvs, 0, stream_offset); - pbi->gvs->bit_rate = bit_depth_luma; - pbi->gvs->frame_data = bit_depth_chroma; - pbi->gvs->samp_cnt = get_double_write_mode(pbi); - vdec_fill_vdec_frame(pvdec, &pbi->vframe_qos, pbi->gvs, + memcpy(&tmp4x, pbi->gvs, sizeof(struct vdec_info)); + tmp4x.bit_depth_luma = pbi->vp9_param.p.bit_depth; + tmp4x.bit_depth_chroma = pbi->vp9_param.p.bit_depth; + tmp4x.double_write_mode = get_double_write_mode(pbi); + vdec_fill_vdec_frame(pvdec, &pbi->vframe_qos, &tmp4x, vf, pic_config->hw_decode_time); pvdec->vdec_fps_detec(pvdec->id); if (without_display_mode == 0) { @@ -7427,66 +7429,66 @@ static void debug_buffer_mgr_more(struct VP9Decoder_s *pbi) return; pr_info("vp9_param: (%d)\n", pbi->slice_idx); for (i = 0; i < (RPM_END-RPM_BEGIN); i++) { - pr_info("%04x ", vp9_param.l.data[i]); + pr_info("%04x ", pbi->vp9_param.l.data[i]); if (((i + 1) & 0xf) == 0) pr_info("\n"); } pr_info("=============param==========\r\n"); - pr_info("profile %x\r\n", vp9_param.p.profile); + pr_info("profile %x\r\n", pbi->vp9_param.p.profile); pr_info("show_existing_frame %x\r\n", - vp9_param.p.show_existing_frame); + pbi->vp9_param.p.show_existing_frame); pr_info("frame_to_show_idx %x\r\n", - vp9_param.p.frame_to_show_idx); - pr_info("frame_type %x\r\n", vp9_param.p.frame_type); - pr_info("show_frame %x\r\n", vp9_param.p.show_frame); + pbi->vp9_param.p.frame_to_show_idx); + pr_info("frame_type %x\r\n", pbi->vp9_param.p.frame_type); + pr_info("show_frame %x\r\n", pbi->vp9_param.p.show_frame); pr_info("e.r.r.o.r_resilient_mode %x\r\n", - vp9_param.p.error_resilient_mode); - pr_info("intra_only %x\r\n", vp9_param.p.intra_only); + pbi->vp9_param.p.error_resilient_mode); + pr_info("intra_only %x\r\n", pbi->vp9_param.p.intra_only); pr_info("display_size_present %x\r\n", - vp9_param.p.display_size_present); + pbi->vp9_param.p.display_size_present); pr_info("reset_frame_context %x\r\n", - vp9_param.p.reset_frame_context); + pbi->vp9_param.p.reset_frame_context); pr_info("refresh_frame_flags %x\r\n", - vp9_param.p.refresh_frame_flags); - pr_info("bit_depth %x\r\n", vp9_param.p.bit_depth); - pr_info("width %x\r\n", vp9_param.p.width); - pr_info("height %x\r\n", vp9_param.p.height); - pr_info("display_width %x\r\n", vp9_param.p.display_width); - pr_info("display_height %x\r\n", vp9_param.p.display_height); - pr_info("ref_info %x\r\n", vp9_param.p.ref_info); - pr_info("same_frame_size %x\r\n", vp9_param.p.same_frame_size); + pbi->vp9_param.p.refresh_frame_flags); + pr_info("bit_depth %x\r\n", pbi->vp9_param.p.bit_depth); + pr_info("width %x\r\n", pbi->vp9_param.p.width); + pr_info("height %x\r\n", pbi->vp9_param.p.height); + pr_info("display_width %x\r\n", pbi->vp9_param.p.display_width); + pr_info("display_height %x\r\n", pbi->vp9_param.p.display_height); + pr_info("ref_info %x\r\n", pbi->vp9_param.p.ref_info); + pr_info("same_frame_size %x\r\n", pbi->vp9_param.p.same_frame_size); if (!(debug & VP9_DEBUG_DBG_LF_PRINT)) return; pr_info("mode_ref_delta_enabled: 0x%x\r\n", - vp9_param.p.mode_ref_delta_enabled); + pbi->vp9_param.p.mode_ref_delta_enabled); pr_info("sharpness_level: 0x%x\r\n", - vp9_param.p.sharpness_level); + pbi->vp9_param.p.sharpness_level); pr_info("ref_deltas: 0x%x, 0x%x, 0x%x, 0x%x\r\n", - vp9_param.p.ref_deltas[0], vp9_param.p.ref_deltas[1], - vp9_param.p.ref_deltas[2], vp9_param.p.ref_deltas[3]); - pr_info("mode_deltas: 0x%x, 0x%x\r\n", vp9_param.p.mode_deltas[0], - vp9_param.p.mode_deltas[1]); - pr_info("filter_level: 0x%x\r\n", vp9_param.p.filter_level); - pr_info("seg_enabled: 0x%x\r\n", vp9_param.p.seg_enabled); - pr_info("seg_abs_delta: 0x%x\r\n", vp9_param.p.seg_abs_delta); + pbi->vp9_param.p.ref_deltas[0], pbi->vp9_param.p.ref_deltas[1], + pbi->vp9_param.p.ref_deltas[2], pbi->vp9_param.p.ref_deltas[3]); + pr_info("mode_deltas: 0x%x, 0x%x\r\n", pbi->vp9_param.p.mode_deltas[0], + pbi->vp9_param.p.mode_deltas[1]); + pr_info("filter_level: 0x%x\r\n", pbi->vp9_param.p.filter_level); + pr_info("seg_enabled: 0x%x\r\n", pbi->vp9_param.p.seg_enabled); + pr_info("seg_abs_delta: 0x%x\r\n", pbi->vp9_param.p.seg_abs_delta); pr_info("seg_lf_feature_enabled: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\r\n", - (vp9_param.p.seg_lf_info[0]>>15 & 1), - (vp9_param.p.seg_lf_info[1]>>15 & 1), - (vp9_param.p.seg_lf_info[2]>>15 & 1), - (vp9_param.p.seg_lf_info[3]>>15 & 1), - (vp9_param.p.seg_lf_info[4]>>15 & 1), - (vp9_param.p.seg_lf_info[5]>>15 & 1), - (vp9_param.p.seg_lf_info[6]>>15 & 1), - (vp9_param.p.seg_lf_info[7]>>15 & 1)); + (pbi->vp9_param.p.seg_lf_info[0]>>15 & 1), + (pbi->vp9_param.p.seg_lf_info[1]>>15 & 1), + (pbi->vp9_param.p.seg_lf_info[2]>>15 & 1), + (pbi->vp9_param.p.seg_lf_info[3]>>15 & 1), + (pbi->vp9_param.p.seg_lf_info[4]>>15 & 1), + (pbi->vp9_param.p.seg_lf_info[5]>>15 & 1), + (pbi->vp9_param.p.seg_lf_info[6]>>15 & 1), + (pbi->vp9_param.p.seg_lf_info[7]>>15 & 1)); pr_info("seg_lf_feature_data: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\r\n", - (vp9_param.p.seg_lf_info[0] & 0x13f), - (vp9_param.p.seg_lf_info[1] & 0x13f), - (vp9_param.p.seg_lf_info[2] & 0x13f), - (vp9_param.p.seg_lf_info[3] & 0x13f), - (vp9_param.p.seg_lf_info[4] & 0x13f), - (vp9_param.p.seg_lf_info[5] & 0x13f), - (vp9_param.p.seg_lf_info[6] & 0x13f), - (vp9_param.p.seg_lf_info[7] & 0x13f)); + (pbi->vp9_param.p.seg_lf_info[0] & 0x13f), + (pbi->vp9_param.p.seg_lf_info[1] & 0x13f), + (pbi->vp9_param.p.seg_lf_info[2] & 0x13f), + (pbi->vp9_param.p.seg_lf_info[3] & 0x13f), + (pbi->vp9_param.p.seg_lf_info[4] & 0x13f), + (pbi->vp9_param.p.seg_lf_info[5] & 0x13f), + (pbi->vp9_param.p.seg_lf_info[6] & 0x13f), + (pbi->vp9_param.p.seg_lf_info[7] & 0x13f)); } @@ -7565,23 +7567,23 @@ int continue_decoding(struct VP9Decoder_s *pbi) if (pbi->is_used_v4l && ctx->param_sets_from_ucode) pbi->res_ch_flag = 0; - bit_depth_luma = vp9_param.p.bit_depth; - bit_depth_chroma = vp9_param.p.bit_depth; + bit_depth_luma = pbi->vp9_param.p.bit_depth; + bit_depth_chroma = pbi->vp9_param.p.bit_depth; - if ((vp9_param.p.bit_depth >= VPX_BITS_10) && + if ((pbi->vp9_param.p.bit_depth >= VPX_BITS_10) && (get_double_write_mode(pbi) == 0x10)) { pbi->fatal_error |= DECODER_FATAL_ERROR_SIZE_OVERFLOW; pr_err("fatal err, bit_depth %d, unsupport dw 0x10\n", - vp9_param.p.bit_depth); + pbi->vp9_param.p.bit_depth); return -1; } if (pbi->process_state != PROC_STATE_SENDAGAIN) { - ret = vp9_bufmgr_process(pbi, &vp9_param); + ret = vp9_bufmgr_process(pbi, &pbi->vp9_param); if (!pbi->m_ins_flag) pbi->slice_idx++; } else { - union param_u *params = &vp9_param; + union param_u *params = &pbi->vp9_param; if (pbi->mmu_enable && ((pbi->double_write_mode & 0x10) == 0)) { ret = vp9_alloc_mmu(pbi, cm->new_fb_idx, @@ -7639,11 +7641,11 @@ int continue_decoding(struct VP9Decoder_s *pbi) #endif } /*pr_info("Decode Frame Data %d\n", pbi->frame_count);*/ - config_pic_size(pbi, vp9_param.p.bit_depth); + config_pic_size(pbi, pbi->vp9_param.p.bit_depth); if ((pbi->common.frame_type != KEY_FRAME) && (!pbi->common.intra_only)) { - config_mc_buffer(pbi, vp9_param.p.bit_depth); + config_mc_buffer(pbi, pbi->vp9_param.p.bit_depth); #ifdef SUPPORT_FB_DECODING if (pbi->used_stage_buf_num == 0) #endif @@ -7660,34 +7662,34 @@ int continue_decoding(struct VP9Decoder_s *pbi) else config_mcrcc_axi_hw(pbi); #endif - config_sao_hw(pbi, &vp9_param); + config_sao_hw(pbi, &pbi->vp9_param); #ifdef VP9_LPF_LVL_UPDATE /* * Get loop filter related picture level parameters from Parser */ - pbi->lf->mode_ref_delta_enabled = vp9_param.p.mode_ref_delta_enabled; - pbi->lf->sharpness_level = vp9_param.p.sharpness_level; + pbi->lf->mode_ref_delta_enabled = pbi->vp9_param.p.mode_ref_delta_enabled; + pbi->lf->sharpness_level = pbi->vp9_param.p.sharpness_level; for (i = 0; i < 4; i++) - pbi->lf->ref_deltas[i] = vp9_param.p.ref_deltas[i]; + pbi->lf->ref_deltas[i] = pbi->vp9_param.p.ref_deltas[i]; for (i = 0; i < 2; i++) - pbi->lf->mode_deltas[i] = vp9_param.p.mode_deltas[i]; - pbi->default_filt_lvl = vp9_param.p.filter_level; - pbi->seg_4lf->enabled = vp9_param.p.seg_enabled; - pbi->seg_4lf->abs_delta = vp9_param.p.seg_abs_delta; + pbi->lf->mode_deltas[i] = pbi->vp9_param.p.mode_deltas[i]; + pbi->default_filt_lvl = pbi->vp9_param.p.filter_level; + pbi->seg_4lf->enabled = pbi->vp9_param.p.seg_enabled; + pbi->seg_4lf->abs_delta = pbi->vp9_param.p.seg_abs_delta; for (i = 0; i < MAX_SEGMENTS; i++) - pbi->seg_4lf->feature_mask[i] = (vp9_param.p.seg_lf_info[i] & + pbi->seg_4lf->feature_mask[i] = (pbi->vp9_param.p.seg_lf_info[i] & 0x8000) ? (1 << SEG_LVL_ALT_LF) : 0; for (i = 0; i < MAX_SEGMENTS; i++) pbi->seg_4lf->feature_data[i][SEG_LVL_ALT_LF] - = (vp9_param.p.seg_lf_info[i] - & 0x100) ? -(vp9_param.p.seg_lf_info[i] - & 0x3f) : (vp9_param.p.seg_lf_info[i] & 0x3f); + = (pbi->vp9_param.p.seg_lf_info[i] + & 0x100) ? -(pbi->vp9_param.p.seg_lf_info[i] + & 0x3f) : (pbi->vp9_param.p.seg_lf_info[i] & 0x3f); if (get_cpu_major_id() >= AM_MESON_CPU_MAJOR_ID_G12A) { /*Set pipeline mode*/ uint32_t lpf_data32 = READ_VREG(HEVC_DBLK_CFGB); /*dblk pipeline mode=1 for performance*/ - if (vp9_param.p.width >= 1280) + if (pbi->vp9_param.p.width >= 1280) lpf_data32 |= (0x1 << 4); else lpf_data32 &= ~(0x3 << 4); @@ -8405,7 +8407,7 @@ static irqreturn_t vvp9_isr_thread_fn(int irq, void *data) } if (debug & VP9_DEBUG_SEND_PARAM_WITH_REG) { - get_rpm_param(&vp9_param); + get_rpm_param(&pbi->vp9_param); } else { #ifdef SUPPORT_FB_DECODING if (pbi->used_stage_buf_num > 0) { @@ -8460,7 +8462,7 @@ static irqreturn_t vvp9_isr_thread_fn(int irq, void *data) for (i = 0; i < (RPM_END - RPM_BEGIN); i += 4) { int ii; for (ii = 0; ii < 4; ii++) - vp9_param.l.data[i + ii] = + pbi->vp9_param.l.data[i + ii] = pbi->rpm_ptr[i + 3 - ii]; } } @@ -8470,8 +8472,8 @@ static irqreturn_t vvp9_isr_thread_fn(int irq, void *data) struct aml_vcodec_ctx *ctx = (struct aml_vcodec_ctx *)(pbi->v4l2_ctx); - pbi->frame_width = vp9_param.p.width; - pbi->frame_height = vp9_param.p.height; + pbi->frame_width = pbi->vp9_param.p.width; + pbi->frame_height = pbi->vp9_param.p.height; if (!v4l_res_change(pbi)) { if (ctx->param_sets_from_ucode && !pbi->v4l_params_parsed) { @@ -10232,7 +10234,7 @@ static void run_back(struct vdec_s *vdec) for (i = 0; i < (RPM_END - RPM_BEGIN); i += 4) { int ii; for (ii = 0; ii < 4; ii++) - vp9_param.l.data[i + ii] = + pbi->vp9_param.l.data[i + ii] = pbi->s2_buf->rpm[i + 3 - ii]; } #ifndef FB_DECODING_TEST_SCHEDULE |