Lines Matching refs:reg_ctx
1269 Vdpu383Av1dRegCtx *ctx = (Vdpu383Av1dRegCtx *)p_hal->reg_ctx; in vdpu383_setup_scale_origin_bufs()
1303 MEM_CHECK(ret, p_hal->reg_ctx = mpp_calloc_size(void, sizeof(Vdpu383Av1dRegCtx))); in hal_av1d_alloc_res()
1304 Vdpu383Av1dRegCtx *reg_ctx = (Vdpu383Av1dRegCtx *)p_hal->reg_ctx; in hal_av1d_alloc_res() local
1307 …BUF_CHECK(ret, mpp_buffer_get(p_hal->buf_group, ®_ctx->bufs, MPP_ALIGN(VDPU383_INFO_BUF_SIZE(ma… in hal_av1d_alloc_res()
1308 mpp_buffer_attach_dev(reg_ctx->bufs, p_hal->dev); in hal_av1d_alloc_res()
1309 reg_ctx->bufs_fd = mpp_buffer_get_fd(reg_ctx->bufs); in hal_av1d_alloc_res()
1310 reg_ctx->bufs_ptr = mpp_buffer_get_ptr(reg_ctx->bufs); in hal_av1d_alloc_res()
1314 reg_ctx->reg_buf[i].regs = mpp_calloc(Vdpu383Av1dRegSet, 1); in hal_av1d_alloc_res()
1315 memset(reg_ctx->reg_buf[i].regs, 0, sizeof(Vdpu383Av1dRegSet)); in hal_av1d_alloc_res()
1316 reg_ctx->uncmps_offset[i] = VDPU383_UNCMPS_HEADER_OFFSET(i); in hal_av1d_alloc_res()
1320 reg_ctx->regs = reg_ctx->reg_buf[0].regs; in hal_av1d_alloc_res()
1321 reg_ctx->offset_uncomps = reg_ctx->uncmps_offset[0]; in hal_av1d_alloc_res()
1324 …BUF_CHECK(ret, mpp_buffer_get(p_hal->buf_group, ®_ctx->cdf_rd_def_base, 200 * MPP_ALIGN(sizeof(… in hal_av1d_alloc_res()
1325 mpp_buffer_attach_dev(reg_ctx->cdf_rd_def_base, p_hal->dev); in hal_av1d_alloc_res()
1326 cdf_ptr = mpp_buffer_get_ptr(reg_ctx->cdf_rd_def_base); in hal_av1d_alloc_res()
1328 mpp_buffer_sync_end(reg_ctx->cdf_rd_def_base); in hal_av1d_alloc_res()
1344 Vdpu383Av1dRegCtx *reg_ctx = (Vdpu383Av1dRegCtx *)p_hal->reg_ctx; in hal_av1d_release_res() local
1346 RK_U32 max_cnt = p_hal->fast_mode ? MPP_ARRAY_ELEMS(reg_ctx->reg_buf) : 1; in hal_av1d_release_res()
1349 MPP_FREE(reg_ctx->reg_buf[i].regs); in hal_av1d_release_res()
1351 BUF_PUT(reg_ctx->cdf_rd_def_base); in hal_av1d_release_res()
1352 BUF_PUT(reg_ctx->bufs); in hal_av1d_release_res()
1354 BUF_PUT(reg_ctx->rcb_bufs[i]); in hal_av1d_release_res()
1356 vdpu_av1d_filtermem_release(reg_ctx); in hal_av1d_release_res()
1357 if (reg_ctx->cdf_segid_bufs) { in hal_av1d_release_res()
1358 hal_bufs_deinit(reg_ctx->cdf_segid_bufs); in hal_av1d_release_res()
1359 reg_ctx->cdf_segid_bufs = NULL; in hal_av1d_release_res()
1361 if (reg_ctx->colmv_bufs) { in hal_av1d_release_res()
1362 hal_bufs_deinit(reg_ctx->colmv_bufs); in hal_av1d_release_res()
1363 reg_ctx->colmv_bufs = NULL; in hal_av1d_release_res()
1365 if (reg_ctx->origin_bufs) { in hal_av1d_release_res()
1366 hal_bufs_deinit(reg_ctx->origin_bufs); in hal_av1d_release_res()
1367 reg_ctx->origin_bufs = NULL; in hal_av1d_release_res()
1370 MPP_FREE(p_hal->reg_ctx); in hal_av1d_release_res()
1826 static void rcb_buf_set_edge(Vdpu383Av1dRegCtx *reg_ctx, MppBuffer buf)
1832 VDPU383_SET_BUF_PROTECT_VAL(&buf_p[reg_ctx->rcb_buf_info[loop].offset],
1833 reg_ctx->rcb_buf_info[loop].size, 0xaa, 128);
1837 static void rcb_buf_dump_edge(Vdpu383Av1dRegCtx *reg_ctx, MppBuffer buf)
1847 printf("======> reg idx:%d\n", reg_ctx->rcb_buf_info[loop].reg);
1848 VDPU383_DUMP_BUF_PROTECT_VAL(&buf_p[reg_ctx->rcb_buf_info[loop].offset],
1849 reg_ctx->rcb_buf_info[loop].size, 128);
1917 Vdpu383Av1dRegCtx *reg_ctx = (Vdpu383Av1dRegCtx *)p_hal->reg_ctx; in vdpu383_av1d_rcb_setup() local
1922 …offset += update_size_offset(reg_ctx->rcb_buf_info, 140, offset, VDPU383_RCB_STRMD_ROW_LEN, … in vdpu383_av1d_rcb_setup()
1923 …offset += update_size_offset(reg_ctx->rcb_buf_info, 142, offset, VDPU383_RCB_STRMD_TILE_ROW_LEN, … in vdpu383_av1d_rcb_setup()
1924 …offset += update_size_offset(reg_ctx->rcb_buf_info, 144, offset, VDPU383_RCB_INTER_ROW_LEN, … in vdpu383_av1d_rcb_setup()
1925 …offset += update_size_offset(reg_ctx->rcb_buf_info, 146, offset, VDPU383_RCB_INTER_TILE_ROW_LEN, … in vdpu383_av1d_rcb_setup()
1926 …offset += update_size_offset(reg_ctx->rcb_buf_info, 148, offset, VDPU383_RCB_INTRA_ROW_LEN, … in vdpu383_av1d_rcb_setup()
1927 …offset += update_size_offset(reg_ctx->rcb_buf_info, 150, offset, VDPU383_RCB_INTRA_TILE_ROW_LEN, … in vdpu383_av1d_rcb_setup()
1928 …offset += update_size_offset(reg_ctx->rcb_buf_info, 152, offset, VDPU383_RCB_FILTERD_ROW_LEN, … in vdpu383_av1d_rcb_setup()
1929 …offset += update_size_offset(reg_ctx->rcb_buf_info, 154, offset, VDPU383_RCB_FILTERD_PROTECT_ROW_L… in vdpu383_av1d_rcb_setup()
1930 …offset += update_size_offset(reg_ctx->rcb_buf_info, 156, offset, VDPU383_RCB_FILTERD_TILE_ROW_LEN,… in vdpu383_av1d_rcb_setup()
1931 …offset += update_size_offset(reg_ctx->rcb_buf_info, 158, offset, VDPU383_RCB_FILTERD_TILE_COL_LEN,… in vdpu383_av1d_rcb_setup()
1932 …offset += update_size_offset(reg_ctx->rcb_buf_info, 160, offset, VDPU383_RCB_FILTERD_AV1_UP_TL_COL… in vdpu383_av1d_rcb_setup()
1933 reg_ctx->rcb_buf_size = offset; in vdpu383_av1d_rcb_setup()
1935 av1d_refine_rcb_size(reg_ctx->rcb_buf_info, dxva->width, dxva->height, dxva); in vdpu383_av1d_rcb_setup()
1938 MppBuffer rcb_buf = reg_ctx->rcb_bufs[i]; in vdpu383_av1d_rcb_setup()
1942 reg_ctx->rcb_bufs[i] = NULL; in vdpu383_av1d_rcb_setup()
1944 mpp_buffer_get(p_hal->buf_group, &rcb_buf, reg_ctx->rcb_buf_size); in vdpu383_av1d_rcb_setup()
1945 reg_ctx->rcb_bufs[i] = rcb_buf; in vdpu383_av1d_rcb_setup()
1956 Vdpu383Av1dRegCtx *reg_ctx = (Vdpu383Av1dRegCtx *)p_hal->reg_ctx; in vdpu383_av1d_rcb_reg_cfg() local
1957 Vdpu383Av1dRegSet *regs = reg_ctx->regs; in vdpu383_av1d_rcb_reg_cfg()
1973 … regs->common_addr.reg141_rcb_strmd_row_len = reg_ctx->rcb_buf_info[RCB_STRMD_ROW].size; in vdpu383_av1d_rcb_reg_cfg()
1974 …regs->common_addr.reg143_rcb_strmd_tile_row_len = reg_ctx->rcb_buf_info[RCB_STRMD_TILE_ROW].… in vdpu383_av1d_rcb_reg_cfg()
1975 … regs->common_addr.reg145_rcb_inter_row_len = reg_ctx->rcb_buf_info[RCB_INTER_ROW].size; in vdpu383_av1d_rcb_reg_cfg()
1976 …regs->common_addr.reg147_rcb_inter_tile_row_len = reg_ctx->rcb_buf_info[RCB_INTER_TILE_ROW].… in vdpu383_av1d_rcb_reg_cfg()
1977 … regs->common_addr.reg149_rcb_intra_row_len = reg_ctx->rcb_buf_info[RCB_INTRA_ROW].size; in vdpu383_av1d_rcb_reg_cfg()
1978 …regs->common_addr.reg151_rcb_intra_tile_row_len = reg_ctx->rcb_buf_info[RCB_INTRA_TILE_ROW].… in vdpu383_av1d_rcb_reg_cfg()
1979 …regs->common_addr.reg153_rcb_filterd_row_len = reg_ctx->rcb_buf_info[RCB_FILTERD_ROW].siz… in vdpu383_av1d_rcb_reg_cfg()
1980 …regs->common_addr.reg155_rcb_filterd_protect_row_len = reg_ctx->rcb_buf_info[RCB_FILTERD_PROTECT_… in vdpu383_av1d_rcb_reg_cfg()
1981 …regs->common_addr.reg157_rcb_filterd_tile_row_len = reg_ctx->rcb_buf_info[RCB_FILTERD_TILE_ROW… in vdpu383_av1d_rcb_reg_cfg()
1982 …regs->common_addr.reg159_rcb_filterd_tile_col_len = reg_ctx->rcb_buf_info[RCB_FILTERD_TILE_COL… in vdpu383_av1d_rcb_reg_cfg()
1983 …regs->common_addr.reg161_rcb_filterd_av1_upscale_tile_col_len = reg_ctx->rcb_buf_info[RCB_FILTERD… in vdpu383_av1d_rcb_reg_cfg()
1986 …mpp_dev_set_reg_offset(p_hal->dev, reg_ctx->rcb_buf_info[i].reg_idx, reg_ctx->rcb_buf_info[i].offs… in vdpu383_av1d_rcb_reg_cfg()
1992 Vdpu383Av1dRegCtx *reg_ctx = (Vdpu383Av1dRegCtx *)p_hal->reg_ctx; in vdpu383_av1d_colmv_setup() local
1997 if (reg_ctx->colmv_bufs == NULL || reg_ctx->colmv_size < mv_size) { in vdpu383_av1d_colmv_setup()
1998 if (reg_ctx->colmv_bufs) { in vdpu383_av1d_colmv_setup()
1999 hal_bufs_deinit(reg_ctx->colmv_bufs); in vdpu383_av1d_colmv_setup()
2000 reg_ctx->colmv_bufs = NULL; in vdpu383_av1d_colmv_setup()
2003 hal_bufs_init(®_ctx->colmv_bufs); in vdpu383_av1d_colmv_setup()
2004 if (reg_ctx->colmv_bufs == NULL) { in vdpu383_av1d_colmv_setup()
2008 reg_ctx->colmv_size = mv_size; in vdpu383_av1d_colmv_setup()
2009 reg_ctx->colmv_count = mpp_buf_slot_get_count(p_hal->slots); in vdpu383_av1d_colmv_setup()
2010 hal_bufs_setup(reg_ctx->colmv_bufs, reg_ctx->colmv_count, 1, &mv_size); in vdpu383_av1d_colmv_setup()
2020 Vdpu383Av1dRegCtx *reg_ctx = (Vdpu383Av1dRegCtx *)p_hal->reg_ctx; in vdpu383_av1d_cdf_setup() local
2028 if (reg_ctx->cdf_segid_bufs == NULL || reg_ctx->cdf_segid_size < size) { in vdpu383_av1d_cdf_setup()
2029 if (reg_ctx->cdf_segid_bufs) { in vdpu383_av1d_cdf_setup()
2030 hal_bufs_deinit(reg_ctx->cdf_segid_bufs); in vdpu383_av1d_cdf_setup()
2031 reg_ctx->cdf_segid_bufs = NULL; in vdpu383_av1d_cdf_setup()
2034 hal_bufs_init(®_ctx->cdf_segid_bufs); in vdpu383_av1d_cdf_setup()
2035 if (reg_ctx->cdf_segid_bufs == NULL) { in vdpu383_av1d_cdf_setup()
2040 reg_ctx->cdf_segid_size = size; in vdpu383_av1d_cdf_setup()
2041 reg_ctx->cdf_segid_count = mpp_buf_slot_get_count(p_hal->slots); in vdpu383_av1d_cdf_setup()
2042 hal_bufs_setup(reg_ctx->cdf_segid_bufs, reg_ctx->cdf_segid_count, 1, &size); in vdpu383_av1d_cdf_setup()
2073 Vdpu383Av1dRegCtx *reg_ctx = (Vdpu383Av1dRegCtx *)p_hal->reg_ctx; in vdpu383_av1d_set_cdf() local
2074 Vdpu383Av1dRegSet *regs = reg_ctx->regs; in vdpu383_av1d_set_cdf()
2091 reg_ctx->ref_info_tbl[i].cdf_valid = 0; in vdpu383_av1d_set_cdf()
2099 regs->av1d_addrs.reg184_av1_noncoef_rd_base = mpp_buffer_get_fd(reg_ctx->cdf_rd_def_base); in vdpu383_av1d_set_cdf()
2100 regs->av1d_addrs.reg178_av1_coef_rd_base = mpp_buffer_get_fd(reg_ctx->cdf_rd_def_base); in vdpu383_av1d_set_cdf()
2103 … dump_data_to_file(dump_cur_fname_path, (void *)mpp_buffer_get_ptr(reg_ctx->cdf_rd_def_base), in vdpu383_av1d_set_cdf()
2105 … dump_data_to_file(dump_cur_fname_path, (RK_U8 *)mpp_buffer_get_ptr(reg_ctx->cdf_rd_def_base) in vdpu383_av1d_set_cdf()
2113 coeff_cdf_idx = reg_ctx->ref_info_tbl[mapped_idx].coeff_idx; in vdpu383_av1d_set_cdf()
2115 reg_ctx->ref_info_tbl[mapped_idx].cdf_valid && in vdpu383_av1d_set_cdf()
2118 cdf_buf = hal_bufs_get_buf(reg_ctx->cdf_segid_bufs, dxva->frame_refs[mapped_idx].Index); in vdpu383_av1d_set_cdf()
2121 buf_tmp = reg_ctx->cdf_rd_def_base; in vdpu383_av1d_set_cdf()
2136 cdf_buf = hal_bufs_get_buf(reg_ctx->cdf_segid_bufs, dxva->CurrPic.Index7Bits); in vdpu383_av1d_set_cdf()
2152 reg_ctx->ref_info_tbl[i].coeff_idx in vdpu383_av1d_set_cdf()
2153 = reg_ctx->ref_info_tbl[dxva->frame_to_show_map_idx].coeff_idx; in vdpu383_av1d_set_cdf()
2155 reg_ctx->ref_info_tbl[i].coeff_idx = coeff_cdf_idx; in vdpu383_av1d_set_cdf()
2157 reg_ctx->ref_info_tbl[i].cdf_valid = 1; in vdpu383_av1d_set_cdf()
2158 reg_ctx->ref_info_tbl[i].coeff_idx = 0; in vdpu383_av1d_set_cdf()
2168 dump_data_to_file(dump_cur_fname_path, (void *)mpp_buffer_get_ptr(reg_ctx->cdf_rd_def_base), in vdpu383_av1d_set_cdf()
2179 Vdpu383Av1dRegCtx *ctx = (Vdpu383Av1dRegCtx *)p_hal->reg_ctx; in vdpu383_av1d_gen_regs()
2490 Vdpu383Av1dRegCtx *reg_ctx = (Vdpu383Av1dRegCtx *)p_hal->reg_ctx; in vdpu383_av1d_start() local
2492 reg_ctx->reg_buf[task->dec.reg_index].regs : in vdpu383_av1d_start()
2493 reg_ctx->regs; in vdpu383_av1d_start()
2545 vdpu383_set_rcbinfo(dev, (Vdpu383RcbInfo*)reg_ctx->rcb_buf_info); in vdpu383_av1d_start()
2565 Vdpu383Av1dRegCtx *reg_ctx = (Vdpu383Av1dRegCtx *)p_hal->reg_ctx; in vdpu383_av1d_wait() local
2567 reg_ctx->reg_buf[task->dec.reg_index].regs : in vdpu383_av1d_wait()
2568 reg_ctx->regs; in vdpu383_av1d_wait()
2574 mv_buf = hal_bufs_get_buf(reg_ctx->colmv_bufs, dxva->CurrPic.Index7Bits); in vdpu383_av1d_wait()
2613 cdf_buf = hal_bufs_get_buf(reg_ctx->cdf_segid_bufs, dxva->CurrPic.Index7Bits); in vdpu383_av1d_wait()
2636 reg_ctx->reg_buf[task->dec.reg_index].valid = 0; in vdpu383_av1d_wait()