Lines Matching refs:hw_ctx

59     Vp9dRkvCtx *hw_ctx = (Vp9dRkvCtx*)p_hal->hw_ctx;  in hal_vp9d_alloc_res()  local
63 hw_ctx->g_buf[i].hw_regs = mpp_calloc_size(void, sizeof(VP9_REGS)); in hal_vp9d_alloc_res()
65 &hw_ctx->g_buf[i].probe_base, PROB_SIZE); in hal_vp9d_alloc_res()
71 &hw_ctx->g_buf[i].count_base, COUNT_SIZE); in hal_vp9d_alloc_res()
77 &hw_ctx->g_buf[i].segid_cur_base, MAX_SEGMAP_SIZE); in hal_vp9d_alloc_res()
83 &hw_ctx->g_buf[i].segid_last_base, MAX_SEGMAP_SIZE); in hal_vp9d_alloc_res()
90 hw_ctx->hw_regs = mpp_calloc_size(void, sizeof(VP9_REGS)); in hal_vp9d_alloc_res()
91 ret = mpp_buffer_get(p_hal->group, &hw_ctx->probe_base, PROB_SIZE); in hal_vp9d_alloc_res()
96 ret = mpp_buffer_get(p_hal->group, &hw_ctx->count_base, COUNT_SIZE); in hal_vp9d_alloc_res()
101 ret = mpp_buffer_get(p_hal->group, &hw_ctx->segid_cur_base, MAX_SEGMAP_SIZE); in hal_vp9d_alloc_res()
106 ret = mpp_buffer_get(p_hal->group, &hw_ctx->segid_last_base, MAX_SEGMAP_SIZE); in hal_vp9d_alloc_res()
120 Vp9dRkvCtx *hw_ctx = (Vp9dRkvCtx*)p_hal->hw_ctx; in hal_vp9d_release_res() local
124 if (hw_ctx->g_buf[i].probe_base) { in hal_vp9d_release_res()
125 ret = mpp_buffer_put(hw_ctx->g_buf[i].probe_base); in hal_vp9d_release_res()
131 if (hw_ctx->g_buf[i].count_base) { in hal_vp9d_release_res()
132 ret = mpp_buffer_put(hw_ctx->g_buf[i].count_base); in hal_vp9d_release_res()
138 if (hw_ctx->g_buf[i].segid_cur_base) { in hal_vp9d_release_res()
139 ret = mpp_buffer_put(hw_ctx->g_buf[i].segid_cur_base); in hal_vp9d_release_res()
145 if (hw_ctx->g_buf[i].segid_last_base) { in hal_vp9d_release_res()
146 ret = mpp_buffer_put(hw_ctx->g_buf[i].segid_last_base); in hal_vp9d_release_res()
152 if (hw_ctx->g_buf[i].hw_regs) { in hal_vp9d_release_res()
153 mpp_free(hw_ctx->g_buf[i].hw_regs); in hal_vp9d_release_res()
154 hw_ctx->g_buf[i].hw_regs = NULL; in hal_vp9d_release_res()
158 if (hw_ctx->probe_base) { in hal_vp9d_release_res()
159 ret = mpp_buffer_put(hw_ctx->probe_base); in hal_vp9d_release_res()
165 if (hw_ctx->count_base) { in hal_vp9d_release_res()
166 ret = mpp_buffer_put(hw_ctx->count_base); in hal_vp9d_release_res()
172 if (hw_ctx->segid_cur_base) { in hal_vp9d_release_res()
173 ret = mpp_buffer_put(hw_ctx->segid_cur_base); in hal_vp9d_release_res()
179 if (hw_ctx->segid_last_base) { in hal_vp9d_release_res()
180 ret = mpp_buffer_put(hw_ctx->segid_last_base); in hal_vp9d_release_res()
186 if (hw_ctx->hw_regs) { in hal_vp9d_release_res()
187 mpp_free(hw_ctx->hw_regs); in hal_vp9d_release_res()
188 hw_ctx->hw_regs = NULL; in hal_vp9d_release_res()
198 MEM_CHECK(ret, p_hal->hw_ctx = mpp_calloc_size(void, sizeof(Vp9dRkvCtx))); in hal_vp9d_rkv_init()
199 Vp9dRkvCtx *ctx = (Vp9dRkvCtx *)p_hal->hw_ctx; in hal_vp9d_rkv_init()
243 MPP_FREE(p_hal->hw_ctx); in hal_vp9d_rkv_deinit()
268 Vp9dRkvCtx *hw_ctx = (Vp9dRkvCtx*)p_hal->hw_ctx; in hal_vp9d_rkv_gen_regs() local
276 if (!hw_ctx->g_buf[i].use_flag) { in hal_vp9d_rkv_gen_regs()
278 hw_ctx->probe_base = hw_ctx->g_buf[i].probe_base; in hal_vp9d_rkv_gen_regs()
279 hw_ctx->count_base = hw_ctx->g_buf[i].count_base; in hal_vp9d_rkv_gen_regs()
280 hw_ctx->segid_cur_base = hw_ctx->g_buf[i].segid_cur_base; in hal_vp9d_rkv_gen_regs()
281 hw_ctx->segid_last_base = hw_ctx->g_buf[i].segid_last_base; in hal_vp9d_rkv_gen_regs()
282 hw_ctx->hw_regs = hw_ctx->g_buf[i].hw_regs; in hal_vp9d_rkv_gen_regs()
283 hw_ctx->g_buf[i].use_flag = 1; in hal_vp9d_rkv_gen_regs()
292 VP9_REGS *vp9_hw_regs = (VP9_REGS*)hw_ctx->hw_regs; in hal_vp9d_rkv_gen_regs()
294 hal_vp9d_output_probe(mpp_buffer_get_ptr(hw_ctx->probe_base), task->dec.syntax.data); in hal_vp9d_rkv_gen_regs()
295 mpp_buffer_sync_end(hw_ctx->count_base); in hal_vp9d_rkv_gen_regs()
297 memset(hw_ctx->hw_regs, 0, sizeof(VP9_REGS)); in hal_vp9d_rkv_gen_regs()
324 !pic_param->error_resilient_mode && hw_ctx->ls_info.last_show_frame) { in hal_vp9d_rkv_gen_regs()
325 hw_ctx->pre_mv_base_addr = hw_ctx->mv_base_addr; in hal_vp9d_rkv_gen_regs()
326 hw_ctx->pre_mv_base_offset = hw_ctx->mv_base_offset; in hal_vp9d_rkv_gen_regs()
334 vp9_hw_regs->swreg6_cabactbl_prob_base = mpp_buffer_get_fd(hw_ctx->probe_base); in hal_vp9d_rkv_gen_regs()
335 vp9_hw_regs->swreg14_vp9_count_base = mpp_buffer_get_fd(hw_ctx->count_base); in hal_vp9d_rkv_gen_regs()
337 if (hw_ctx->last_segid_flag) { in hal_vp9d_rkv_gen_regs()
338 vp9_hw_regs->swreg15_vp9_segidlast_base = mpp_buffer_get_fd(hw_ctx->segid_last_base); in hal_vp9d_rkv_gen_regs()
339 vp9_hw_regs->swreg16_vp9_segidcur_base = mpp_buffer_get_fd(hw_ctx->segid_cur_base); in hal_vp9d_rkv_gen_regs()
341 vp9_hw_regs->swreg15_vp9_segidlast_base = mpp_buffer_get_fd(hw_ctx->segid_cur_base); in hal_vp9d_rkv_gen_regs()
342 vp9_hw_regs->swreg16_vp9_segidcur_base = mpp_buffer_get_fd(hw_ctx->segid_last_base); in hal_vp9d_rkv_gen_regs()
346 hw_ctx->last_segid_flag = !hw_ctx->last_segid_flag; in hal_vp9d_rkv_gen_regs()
349 hw_ctx->mv_base_addr = vp9_hw_regs->swreg7_decout_base; in hal_vp9d_rkv_gen_regs()
350 hw_ctx->mv_base_offset = mpp_get_ioctl_version() ? sw_yuv_virstride << 4 : sw_yuv_virstride; in hal_vp9d_rkv_gen_regs()
351 if (hw_ctx->pre_mv_base_addr < 0) { in hal_vp9d_rkv_gen_regs()
352 hw_ctx->pre_mv_base_addr = hw_ctx->mv_base_addr; in hal_vp9d_rkv_gen_regs()
353 hw_ctx->pre_mv_base_offset = hw_ctx->mv_base_offset; in hal_vp9d_rkv_gen_regs()
355 vp9_hw_regs->swreg52_vp9_refcolmv_base = hw_ctx->pre_mv_base_addr; in hal_vp9d_rkv_gen_regs()
356 mpp_dev_set_reg_offset(p_hal->dev, 52, hw_ctx->pre_mv_base_offset); in hal_vp9d_rkv_gen_regs()
428 …wreg20_27_vp9_segid_grp[i].sw_vp9segid_frame_qp_delta_en = (hw_ctx->ls_info.feature_m… in hal_vp9d_rkv_gen_regs()
429 …swreg20_27_vp9_segid_grp[i].sw_vp9segid_frame_qp_delta = hw_ctx->ls_info.feature_d… in hal_vp9d_rkv_gen_regs()
430 …wreg20_27_vp9_segid_grp[i].sw_vp9segid_frame_loopfitler_value_en = (hw_ctx->ls_info.feature_m… in hal_vp9d_rkv_gen_regs()
431 …swreg20_27_vp9_segid_grp[i].sw_vp9segid_frame_loopfilter_value = hw_ctx->ls_info.feature_d… in hal_vp9d_rkv_gen_regs()
432 …wreg20_27_vp9_segid_grp[i].sw_vp9segid_referinfo_en = (hw_ctx->ls_info.feature_m… in hal_vp9d_rkv_gen_regs()
433 …swreg20_27_vp9_segid_grp[i].sw_vp9segid_referinfo = hw_ctx->ls_info.feature_d… in hal_vp9d_rkv_gen_regs()
434 …wreg20_27_vp9_segid_grp[i].sw_vp9segid_frame_skip_en = (hw_ctx->ls_info.feature_m… in hal_vp9d_rkv_gen_regs()
438 …27_vp9_segid_grp[0].sw_vp9segid_abs_delta = hw_ctx->ls_info.abs_delta… in hal_vp9d_rkv_gen_regs()
448 …reg32_vp9_ref_deltas_lastframe.sw_vp9_ref_deltas_lastframe |= (hw_ctx->ls_info.last_ref_… in hal_vp9d_rkv_gen_regs()
451 …reg33_vp9_info_lastframe.sw_vp9_mode_deltas_lastframe |= (hw_ctx->ls_info.last_mode… in hal_vp9d_rkv_gen_regs()
455 hw_ctx->ls_info.segmentation_enable_flag_last = 0; in hal_vp9d_rkv_gen_regs()
456 hw_ctx->ls_info.last_intra_only = 1; in hal_vp9d_rkv_gen_regs()
461 …33_vp9_info_lastframe.sw_segmentation_enable_lstframe = hw_ctx->ls_info.segmentat… in hal_vp9d_rkv_gen_regs()
462 …g33_vp9_info_lastframe.sw_vp9_last_show_frame = hw_ctx->ls_info.last_show… in hal_vp9d_rkv_gen_regs()
463 …g33_vp9_info_lastframe.sw_vp9_last_intra_only = hw_ctx->ls_info.last_intr… in hal_vp9d_rkv_gen_regs()
464 …eqcur = (pic_param->width == hw_ctx->ls_info.last_width) && (pic_param->height =… in hal_vp9d_rkv_gen_regs()
489 hw_ctx->ls_info.abs_delta_last = pic_param->stVP9Segments.abs_delta; in hal_vp9d_rkv_gen_regs()
491 hw_ctx->ls_info.last_ref_deltas[i] = pic_param->ref_deltas[i]; in hal_vp9d_rkv_gen_regs()
495 hw_ctx->ls_info.last_mode_deltas[i] = pic_param->mode_deltas[i]; in hal_vp9d_rkv_gen_regs()
499 hw_ctx->ls_info.feature_data[i][0] = pic_param->stVP9Segments.feature_data[i][0]; in hal_vp9d_rkv_gen_regs()
500 hw_ctx->ls_info.feature_data[i][1] = pic_param->stVP9Segments.feature_data[i][1]; in hal_vp9d_rkv_gen_regs()
501 hw_ctx->ls_info.feature_data[i][2] = pic_param->stVP9Segments.feature_data[i][2]; in hal_vp9d_rkv_gen_regs()
502 hw_ctx->ls_info.feature_data[i][3] = pic_param->stVP9Segments.feature_data[i][3]; in hal_vp9d_rkv_gen_regs()
503 hw_ctx->ls_info.feature_mask[i] = pic_param->stVP9Segments.feature_mask[i]; in hal_vp9d_rkv_gen_regs()
505 if (!hw_ctx->ls_info.segmentation_enable_flag_last) in hal_vp9d_rkv_gen_regs()
506 hw_ctx->ls_info.segmentation_enable_flag_last = pic_param->stVP9Segments.enabled; in hal_vp9d_rkv_gen_regs()
508 hw_ctx->ls_info.last_show_frame = pic_param->show_frame; in hal_vp9d_rkv_gen_regs()
509 hw_ctx->ls_info.last_width = pic_param->width; in hal_vp9d_rkv_gen_regs()
510 hw_ctx->ls_info.last_height = pic_param->height; in hal_vp9d_rkv_gen_regs()
511 hw_ctx->ls_info.last_intra_only = (!pic_param->frame_type || pic_param->intra_only); in hal_vp9d_rkv_gen_regs()
515 hw_ctx->ls_info.last_intra_only); in hal_vp9d_rkv_gen_regs()
529 Vp9dRkvCtx *hw_ctx = (Vp9dRkvCtx*)p_hal->hw_ctx; in hal_vp9d_rkv_start() local
530 VP9_REGS *hw_regs = (VP9_REGS *)hw_ctx->hw_regs; in hal_vp9d_rkv_start()
535 hw_regs = (VP9_REGS *)hw_ctx->g_buf[index].hw_regs; in hal_vp9d_rkv_start()
553 wr_cfg.reg = hw_ctx->hw_regs; in hal_vp9d_rkv_start()
563 rd_cfg.reg = hw_ctx->hw_regs; in hal_vp9d_rkv_start()
588 Vp9dRkvCtx *hw_ctx = (Vp9dRkvCtx*)p_hal->hw_ctx; in hal_vp9d_rkv_wait() local
589 VP9_REGS *hw_regs = (VP9_REGS *)hw_ctx->hw_regs; in hal_vp9d_rkv_wait()
592 hw_regs = (VP9_REGS *)hw_ctx->g_buf[task->dec.reg_index].hw_regs; in hal_vp9d_rkv_wait()
619 mpp_buffer_sync_ro_begin(hw_ctx->count_base); in hal_vp9d_rkv_wait()
620 hal_vp9d_update_counts(mpp_buffer_get_ptr(hw_ctx->count_base), task->dec.syntax.data); in hal_vp9d_rkv_wait()
625 hw_ctx->g_buf[task->dec.reg_index].use_flag = 0; in hal_vp9d_rkv_wait()
635 Vp9dRkvCtx *hw_ctx = (Vp9dRkvCtx*)p_hal->hw_ctx; in hal_vp9d_rkv_reset() local
639 memset(&hw_ctx->ls_info, 0, sizeof(hw_ctx->ls_info)); in hal_vp9d_rkv_reset()
640 hw_ctx->mv_base_addr = -1; in hal_vp9d_rkv_reset()
641 hw_ctx->pre_mv_base_addr = -1; in hal_vp9d_rkv_reset()
642 hw_ctx->last_segid_flag = 1; in hal_vp9d_rkv_reset()
652 Vp9dRkvCtx *hw_ctx = p_hal->hw_ctx; in hal_vp9d_rkv_flush() local
656 hw_ctx->mv_base_addr = -1; in hal_vp9d_rkv_flush()
657 hw_ctx->pre_mv_base_addr = -1; in hal_vp9d_rkv_flush()