diff --git a/msm/vidc/msm_venc.c b/msm/vidc/msm_venc.c index 9440c9717fc1..c0c3c1d795fc 100644 --- a/msm/vidc/msm_venc.c +++ b/msm/vidc/msm_venc.c @@ -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,