msm: vidc: Add IRIS2 1pipe support

Add vpu_ver as IRIS2_1 for lagoon and its
corresponding checks such as no CVP, ROI type,
buffer size calculators based on vpu version.

Change-Id: Ie26c015413c551ca430bb70822a4a65d61d56e11
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
This commit is contained in:
Priyanka Gujjula 2020-02-03 12:13:55 +05:30
commit 7d5566a34a
5 changed files with 17 additions and 5 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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;
}

View file

@ -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);

View file

@ -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,
};