diff --git a/msm/vidc/msm_vdec.c b/msm/vidc/msm_vdec.c index b0f5ee407747..e677ebb99f40 100644 --- a/msm/vidc/msm_vdec.c +++ b/msm/vidc/msm_vdec.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. */ #include "msm_vdec.h" @@ -914,10 +914,11 @@ int msm_vdec_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) case V4L2_CID_MPEG_VIDC_VIDEO_PRIORITY: break; case V4L2_CID_MPEG_VIDC_VIDEO_OPERATING_RATE: - inst->clk_data.operating_rate = ctrl->val; inst->flags &= ~VIDC_TURBO; if (ctrl->val == INT_MAX) inst->flags |= VIDC_TURBO; + else + inst->clk_data.operating_rate = ctrl->val; break; case V4L2_CID_MPEG_VIDC_VIDEO_LOWLATENCY_MODE: inst->clk_data.low_latency_mode = !!ctrl->val; diff --git a/msm/vidc/msm_venc.c b/msm/vidc/msm_venc.c index 1f25e4c65116..536fd92ee82e 100644 --- a/msm/vidc/msm_venc.c +++ b/msm/vidc/msm_venc.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. */ #include "msm_venc.h" #include "msm_vidc_internal.h" @@ -1670,16 +1670,17 @@ 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; + inst->flags &= ~VIDC_TURBO; + if (ctrl->val == INT_MAX) + inst->flags |= VIDC_TURBO; + else + 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; if (inst->state < MSM_VIDC_LOAD_RESOURCES) msm_vidc_calculate_buffer_counts(inst); if (inst->state == MSM_VIDC_START_DONE) {