mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
Merge "msm: vidc: Add IRIS2 1pipe support"
This commit is contained in:
commit
97f11a69f3
5 changed files with 17 additions and 5 deletions
|
|
@ -1118,11 +1118,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;
|
||||
|
|
@ -1148,9 +1150,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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue