msm: venc: set operating rate to 1 for HEIC

Set operating rate to 1 by force for HEIC, so as
to avoid overloads.

Change-Id: If3f980e096c7e30368b9c6a280e78bbe1625e87a
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
This commit is contained in:
Shi Zhongbo 2019-11-15 16:13:31 +08:00 • committed by Gerrit - the friendly Code Review server
commit a0e884a3b0

View file

@ -1671,6 +1671,12 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
break;
case V4L2_CID_MPEG_VIDC_VIDEO_OPERATING_RATE:
inst->clk_data.operating_rate = ctrl->val;
/* For HEIC image encode, set operating rate to 1 */
if (is_grid_session(inst)) {
s_vpr_h(sid, "%s: set operating rate to 1 for HEIC\n",
__func__);
inst->clk_data.operating_rate = 1 << 16;
}
inst->flags &= ~VIDC_TURBO;
if (ctrl->val == INT_MAX)
inst->flags |= VIDC_TURBO;
@ -1910,6 +1916,9 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
s_vpr_h(sid, "%s: set fps to 1 for HEIC\n",
__func__);
inst->clk_data.frame_rate = 1 << 16;
s_vpr_h(sid, "%s: set operating rate to 1 for HEIC\n",
__func__);
inst->clk_data.operating_rate = 1 << 16;
}
break;
case V4L2_CID_MPEG_VIDC_VIDEO_FULL_RANGE:
@ -2191,7 +2200,6 @@ int msm_venc_set_operating_rate(struct msm_vidc_inst *inst)
{
int rc = 0;
struct hfi_device *hdev;
struct v4l2_ctrl *ctrl;
struct hfi_operating_rate op_rate;
if (!inst || !inst->core) {
@ -2200,9 +2208,7 @@ int msm_venc_set_operating_rate(struct msm_vidc_inst *inst)
}
hdev = inst->core->device;
ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VIDEO_OPERATING_RATE);
op_rate.operating_rate = ctrl->val;
op_rate.operating_rate = inst->clk_data.operating_rate;
s_vpr_h(inst->sid, "%s: %d\n", __func__, op_rate.operating_rate >> 16);
rc = call_hfi_op(hdev, session_set_property, inst->session,