• Home
  • Raw
  • Download

Lines Matching full:hevc

11408 +/* HEVC reg mapping */
11440 +/* HEVC Constants */
11448 +/* HEVC Workspace layout */
11631 + /* Common part of the HEVC decoder */
11634 + /* Buffer for the HEVC Workspace */
11678 + struct codec_hevc *hevc;
11681 + hevc = sess->priv;
11682 + if (!hevc)
11685 + mutex_lock(&hevc->lock);
11686 + ret = hevc->frames_num;
11687 + mutex_unlock(&hevc->lock);
11696 + struct codec_hevc *hevc = sess->priv;
11697 + union rpm_param *params = &hevc->rpm_param;
11788 +static void codec_hevc_update_ldc_flag(struct codec_hevc *hevc)
11790 + struct hevc_frame *frame = hevc->cur_frame;
11795 + hevc->ldc_flag = 0;
11800 + hevc->ldc_flag = 1;
11801 + for (i = 0; (i < frame->ref_num[0]) && hevc->ldc_flag; i++) {
11803 + hevc->ldc_flag = 0;
11811 + for (i = 0; (i < frame->ref_num[1]) && hevc->ldc_flag; i++) {
11813 + hevc->ldc_flag = 0;
11820 +static void codec_hevc_update_referenced(struct codec_hevc *hevc)
11822 + union rpm_param *param = &hevc->rpm_param;
11825 + u32 curr_poc = hevc->curr_poc;
11827 + list_for_each_entry(frame, &hevc->ref_frames_list, list) {
11857 +codec_hevc_get_lowest_poc_frame(struct codec_hevc *hevc)
11862 + list_for_each_entry(tmp, &hevc->ref_frames_list, list) {
11876 + struct codec_hevc *hevc = sess->priv;
11878 + while ((tmp = codec_hevc_get_lowest_poc_frame(hevc))) {
11879 + if (hevc->curr_poc &&
11881 + tmp->num_reorder_pic >= hevc->frames_num))
11890 + hevc->frames_num--;
11897 + struct codec_hevc *hevc)
11903 + /* Allocate some memory for the HEVC decoder's state */
11904 + hevc->workspace_vaddr = dma_alloc_coherent(core->dev, SIZE_WORKSPACE,
11906 + if (!hevc->workspace_vaddr)
11909 + hevc->workspace_paddr = wkaddr;
11919 + if (codec_hevc_use_mmu(revision, sess->pixfmt_cap, hevc->is_10bit)) {
11927 + hevc->common.mmu_map_paddr);
11930 + hevc->common.mmu_map_paddr);
11953 + struct codec_hevc *hevc;
11958 + hevc = kzalloc(sizeof(*hevc), GFP_KERNEL);
11959 + if (!hevc)
11962 + INIT_LIST_HEAD(&hevc->ref_frames_list);
11963 + hevc->curr_poc = INVALID_POC;
11965 + ret = codec_hevc_setup_workspace(sess, hevc);
12021 + hevc->aux_vaddr = dma_alloc_coherent(core->dev, SIZE_AUX,
12022 + &hevc->aux_paddr, GFP_KERNEL);
12023 + if (!hevc->aux_vaddr) {
12024 + dev_err(core->dev, "Failed to request HEVC AUX\n");
12029 + amvdec_write_dos(core, HEVC_AUX_ADR, hevc->aux_paddr);
12032 + mutex_init(&hevc->lock);
12033 + sess->priv = hevc;
12038 + kfree(hevc);
12044 + struct codec_hevc *hevc = sess->priv;
12047 + while (!list_empty(&hevc->ref_frames_list)) {
12048 + tmp = codec_hevc_get_lowest_poc_frame(hevc);
12052 + hevc->frames_num--;
12058 + struct codec_hevc *hevc = sess->priv;
12061 + mutex_lock(&hevc->lock);
12064 + if (hevc->workspace_vaddr)
12066 + hevc->workspace_vaddr,
12067 + hevc->workspace_paddr);
12069 + if (hevc->aux_vaddr)
12071 + hevc->aux_vaddr, hevc->aux_paddr);
12073 + codec_hevc_free_fbc_buffers(sess, &hevc->common);
12074 + mutex_unlock(&hevc->lock);
12075 + mutex_destroy(&hevc->lock);
12081 +codec_hevc_get_frame_by_poc(struct codec_hevc *hevc, u32 poc)
12085 + list_for_each_entry(tmp, &hevc->ref_frames_list, list) {
12098 + struct codec_hevc *hevc = sess->priv;
12100 + union rpm_param *params = &hevc->rpm_param;
12114 + new_frame->poc = hevc->curr_poc;
12119 + list_add_tail(&new_frame->list, &hevc->ref_frames_list);
12120 + hevc->frames_num++;
12129 + struct codec_hevc *hevc = sess->priv;
12131 + union rpm_param *param = &hevc->rpm_param;
12133 + (hevc->height + hevc->lcu_size - 1) / hevc->lcu_size;
12134 + u32 sao_mem_unit = (hevc->lcu_size == 16 ? 9 :
12135 + hevc->lcu_size == 32 ? 14 : 24) << 4;
12144 + ilog2(hevc->lcu_size);
12148 + hevc->width | (hevc->height << 16));
12150 + (hevc->lcu_x_num - 1) | (hevc->lcu_y_num - 1) << 16);
12152 + if (codec_hevc_use_downsample(sess->pixfmt_cap, hevc->is_10bit) ||
12154 + hevc->is_10bit))
12156 + hevc->common.fbc_buffer_paddr[vb->index];
12161 + if (codec_hevc_use_fbc(sess->pixfmt_cap, hevc->is_10bit)) {
12179 + hevc->is_10bit)) {
12181 + if (codec_hevc_use_downsample(sess->pixfmt_cap, hevc->is_10bit))
12182 + header_adr = hevc->common.mmu_header_paddr[vb->index];
12203 + hevc->is_10bit))
12211 + if (hevc->width >= 1280)
12219 + hevc->width | (hevc->height << 16));
12228 + val |= (hevc->lcu_size == 64) ? 0 :
12229 + ((hevc->lcu_size == 32) ? 1 : 2);
12236 + if (!codec_hevc_use_fbc(sess->pixfmt_cap, hevc->is_10bit))
12243 + if (!codec_hevc_use_fbc(sess->pixfmt_cap, hevc->is_10bit)) {
12306 + hevc->workspace_paddr + SAO_ABV_OFFSET);
12309 + hevc->workspace_paddr + SAO_VB_OFFSET);
12312 +static dma_addr_t codec_hevc_get_frame_mv_paddr(struct codec_hevc *hevc,
12315 + return hevc->workspace_paddr + MPRED_MV_OFFSET +
12320 +codec_hevc_set_mpred_ctrl(struct amvdec_core *core, struct codec_hevc *hevc)
12322 + union rpm_param *param = &hevc->rpm_param;
12324 + u32 lcu_size_log2 = ilog2(hevc->lcu_size);
12344 + if (hevc->ldc_flag)
12365 + struct codec_hevc *hevc,
12369 + union rpm_param *param = &hevc->rpm_param;
12370 + u32 lcu_size_log2 = ilog2(hevc->lcu_size);
12379 + col_mv_rd_start_addr = codec_hevc_get_frame_mv_paddr(hevc, col_frame);
12380 + mpred_mv_wr_ptr = codec_hevc_get_frame_mv_paddr(hevc, frame) +
12381 + (hevc->slice_addr * mv_mem_unit);
12383 + (hevc->slice_addr * mv_mem_unit);
12385 + (hevc->lcu_total * mv_mem_unit);
12388 + codec_hevc_get_frame_mv_paddr(hevc, frame));
12394 + hevc->workspace_paddr + MPRED_ABV_OFFSET);
12411 + struct codec_hevc *hevc = sess->priv;
12418 + codec_hevc_set_mpred_ctrl(core, hevc);
12419 + codec_hevc_set_mpred_mv(core, hevc, frame, col_frame);
12422 + hevc->width | (hevc->height << 16));
12424 + val = ((hevc->lcu_x_num - 1) | (hevc->lcu_y_num - 1) << 16);
12432 + amvdec_write_dos(core, HEVC_MPRED_CUR_POC, hevc->curr_poc);
12433 + amvdec_write_dos(core, HEVC_MPRED_COL_POC, hevc->col_poc);
12447 + struct codec_hevc *hevc = sess->priv;
12452 + if (!codec_hevc_use_fbc(sess->pixfmt_cap, hevc->is_10bit)) {
12453 + l0_cnt = hevc->cur_frame->ref_num[0];
12454 + l1_cnt = hevc->cur_frame->ref_num[1];
12457 + if (hevc->cur_frame->cur_slice_type == I_SLICE) {
12462 + if (hevc->cur_frame->cur_slice_type == P_SLICE) {
12507 + struct codec_hevc *hevc = sess->priv;
12515 + ref_frame = codec_hevc_get_frame_by_poc(hevc, ref_poc_list[i]);
12523 + if (codec_hevc_use_fbc(sess->pixfmt_cap, hevc->is_10bit)) {
12558 +static void codec_hevc_update_col_frame(struct codec_hevc *hevc)
12560 + struct hevc_frame *cur_frame = hevc->cur_frame;
12561 + union rpm_param *param = &hevc->rpm_param;
12571 + hevc->col_poc = INVALID_POC;
12573 + hevc->col_poc = cur_frame->ref_poc_list[list_no]
12580 + if (hevc->col_poc != INVALID_POC)
12581 + hevc->col_frame = codec_hevc_get_frame_by_poc(hevc,
12582 + hevc->col_poc);
12584 + hevc->col_frame = hevc->cur_frame;
12587 + if (!hevc->col_frame)
12588 + hevc->col_frame = hevc->cur_frame;
12593 + struct codec_hevc *hevc = sess->priv;
12594 + union rpm_param *param = &hevc->rpm_param;
12606 + hevc->curr_poc = 0;
12608 + hevc->prev_tid0_poc = hevc->curr_poc;
12613 + prev_poc_lsb = hevc->prev_tid0_poc % max_poc_lsb;
12614 + prev_poc_msb = hevc->prev_tid0_poc - prev_poc_lsb;
12630 + hevc->curr_poc = (poc_msb + poc_lsb);
12632 + hevc->prev_tid0_poc = hevc->curr_poc;
12637 + struct codec_hevc *hevc = sess->priv;
12638 + union rpm_param *param = &hevc->rpm_param;
12641 + hevc->slice_segment_addr = param->p.slice_segment_address;
12643 + hevc->slice_addr = hevc->slice_segment_addr;
12645 + hevc->slice_segment_addr = 0;
12646 + hevc->slice_addr = 0;
12654 + struct codec_hevc *hevc = sess->priv;
12656 + union rpm_param *param = &hevc->rpm_param;
12661 + codec_hevc_update_referenced(hevc);
12664 + hevc->cur_frame = codec_hevc_prepare_new_frame(sess);
12665 + if (!hevc->cur_frame)
12668 + hevc->cur_frame->cur_slice_idx++;
12671 + codec_hevc_update_frame_refs(sess, hevc->cur_frame);
12672 + codec_hevc_update_col_frame(hevc);
12673 + codec_hevc_update_ldc_flag(hevc);
12675 + hevc->is_10bit))
12676 + codec_hevc_fill_mmu_map(sess, &hevc->common,
12677 + &hevc->cur_frame->vbuf->vb2_buf,
12678 + hevc->is_10bit);
12679 + codec_hevc_set_mc(sess, hevc->cur_frame);
12681 + codec_hevc_set_mpred(sess, hevc->cur_frame, hevc->col_frame);
12682 + codec_hevc_set_sao(sess, hevc->cur_frame);
12694 +static int codec_hevc_process_rpm(struct codec_hevc *hevc)
12696 + union rpm_param *param = &hevc->rpm_param;
12710 + hevc->width = param->p.pic_width_in_luma_samples;
12711 + hevc->height = param->p.pic_height_in_luma_samples;
12712 + dst_width = hevc->width;
12713 + dst_height = hevc->height;
12718 + hevc->lcu_x_num = (hevc->width + lcu_size - 1) / lcu_size;
12719 + hevc->lcu_y_num = (hevc->height + lcu_size - 1) / lcu_size;
12720 + hevc->lcu_total = hevc->lcu_x_num * hevc->lcu_y_num;
12741 + if (dst_width != hevc->dst_width ||
12742 + dst_height != hevc->dst_height ||
12743 + lcu_size != hevc->lcu_size ||
12744 + is_10bit != hevc->is_10bit)
12747 + hevc->dst_width = dst_width;
12748 + hevc->dst_height = dst_height;
12749 + hevc->lcu_size = lcu_size;
12750 + hevc->is_10bit = is_10bit;
12761 + struct codec_hevc *hevc = sess->priv;
12762 + u16 *rpm_vaddr = hevc->workspace_vaddr + RPM_OFFSET;
12767 + hevc->rpm_param.l.data[i + j] = rpm_vaddr[i + 3 - j];
12772 + struct codec_hevc *hevc = sess->priv;
12774 + if (codec_hevc_setup_buffers(sess, &hevc->common, hevc->is_10bit)) {
12779 + codec_hevc_setup_decode_head(sess, hevc->is_10bit);
12788 + struct codec_hevc *hevc = sess->priv;
12791 + if (!hevc)
12794 + mutex_lock(&hevc->lock);
12804 + if (codec_hevc_process_rpm(hevc)) {
12805 + amvdec_src_change(sess, hevc->dst_width, hevc->dst_height, 16,
12806 + hevc->is_10bit ? 10 : 8);
12815 + mutex_unlock(&hevc->lock);