diff --git a/msm/vidc/msm_venc.c b/msm/vidc/msm_venc.c index 0e7f0f8f4767..b3288630e723 100644 --- a/msm/vidc/msm_venc.c +++ b/msm/vidc/msm_venc.c @@ -1109,11 +1109,13 @@ int msm_venc_inst_init(struct msm_vidc_inst *inst) int rc = 0; struct msm_vidc_format_desc *fmt_desc = NULL; struct v4l2_format *f = NULL; + uint32_t vpu; if (!inst) { d_vpr_e("Invalid input = %pK\n", inst); return -EINVAL; } + vpu = inst->core->platform_data->vpu_ver; f = &inst->fmts[OUTPUT_PORT].v4l2_fmt; f->type = OUTPUT_MPLANE; f->fmt.pix_mp.height = DEFAULT_HEIGHT; @@ -1139,9 +1141,8 @@ int msm_venc_inst_init(struct msm_vidc_inst *inst) f->fmt.pix_mp.height = DEFAULT_HEIGHT; f->fmt.pix_mp.width = DEFAULT_WIDTH; f->fmt.pix_mp.pixelformat = V4L2_PIX_FMT_NV12_UBWC; - if(inst->core->platform_data->vpu_ver == VPU_VERSION_IRIS1) - f->fmt.pix_mp.num_planes = 1; - else + f->fmt.pix_mp.num_planes = 1; + if (vpu == VPU_VERSION_IRIS2) f->fmt.pix_mp.num_planes = 2; f->fmt.pix_mp.plane_fmt[0].sizeimage = msm_vidc_calculate_enc_input_frame_size(inst); diff --git a/msm/vidc/msm_vidc.c b/msm/vidc/msm_vidc.c index 48237519f11a..cc534d2bd6ae 100644 --- a/msm/vidc/msm_vidc.c +++ b/msm/vidc/msm_vidc.c @@ -1394,7 +1394,8 @@ static int try_get_ctrl_for_instance(struct msm_vidc_inst *inst, return -EINVAL; vpu_ver = inst->core->platform_data->vpu_ver; ctrl->val = (vpu_ver == VPU_VERSION_IRIS1 || - vpu_ver == VPU_VERSION_IRIS2) ? + vpu_ver == VPU_VERSION_IRIS2 || + vpu_ver == VPU_VERSION_IRIS2_1) ? V4L2_CID_MPEG_VIDC_VIDEO_ROI_TYPE_2BYTE : V4L2_CID_MPEG_VIDC_VIDEO_ROI_TYPE_2BIT; break; diff --git a/msm/vidc/msm_vidc_buffer_calculations.c b/msm/vidc/msm_vidc_buffer_calculations.c index 33f6ba234ad2..776d4e05c48d 100644 --- a/msm/vidc/msm_vidc_buffer_calculations.c +++ b/msm/vidc/msm_vidc_buffer_calculations.c @@ -598,15 +598,17 @@ int msm_vidc_calculate_internal_buffer_sizes(struct msm_vidc_inst *inst) void msm_vidc_init_buffer_size_calculators(struct msm_vidc_inst *inst) { struct msm_vidc_core *core; + uint32_t vpu; if (!inst) return; inst->buffer_size_calculators = NULL; core = inst->core; + vpu = core->platform_data->vpu_ver; /* Change this to IRIS2 when ready */ - if (core->platform_data->vpu_ver == VPU_VERSION_IRIS2) + if (vpu == VPU_VERSION_IRIS2 || vpu == VPU_VERSION_IRIS2_1) inst->buffer_size_calculators = msm_vidc_calculate_internal_buffer_sizes; } diff --git a/msm/vidc/msm_vidc_clocks.c b/msm/vidc/msm_vidc_clocks.c index 7ba24e8157ad..5fc2d3b38cf4 100644 --- a/msm/vidc/msm_vidc_clocks.c +++ b/msm/vidc/msm_vidc_clocks.c @@ -1064,6 +1064,7 @@ int msm_vidc_decide_work_route_iris2(struct msm_vidc_inst *inst) struct hfi_video_work_route pdata; bool is_legacy_cbr; u32 codec; + uint32_t vpu; if (!inst || !inst->core || !inst->core->device) { d_vpr_e("%s: Invalid args: Inst = %pK\n", @@ -1071,10 +1072,15 @@ int msm_vidc_decide_work_route_iris2(struct msm_vidc_inst *inst) return -EINVAL; } + vpu = inst->core->platform_data->vpu_ver; hdev = inst->core->device; is_legacy_cbr = inst->clk_data.is_legacy_cbr; pdata.video_work_route = 4; + if (vpu == VPU_VERSION_IRIS2_1) { + pdata.video_work_route = 1; + goto decision_done; + } codec = get_v4l2_codec(inst); if (inst->session_type == MSM_VIDC_DECODER) { if (codec == V4L2_PIX_FMT_MPEG2 || @@ -1098,6 +1104,7 @@ int msm_vidc_decide_work_route_iris2(struct msm_vidc_inst *inst) return -EINVAL; } +decision_done: s_vpr_h(inst->sid, "Configurng work route = %u", pdata.video_work_route); diff --git a/msm/vidc/msm_vidc_internal.h b/msm/vidc/msm_vidc_internal.h index e7355be5c2c1..4e7e62f277a5 100644 --- a/msm/vidc/msm_vidc_internal.h +++ b/msm/vidc/msm_vidc_internal.h @@ -263,6 +263,7 @@ enum vpu_version { VPU_VERSION_AR50 = 1, VPU_VERSION_IRIS1, VPU_VERSION_IRIS2, + VPU_VERSION_IRIS2_1, VPU_VERSION_AR50_LITE, };