Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9574afd authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: venc: set operating rate to 1 for HEIC"

parents 5a9f8395 539875b3
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -1679,6 +1679,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;
@@ -1918,6 +1924,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:
@@ -2200,7 +2209,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) {
@@ -2211,9 +2219,7 @@ int msm_venc_set_operating_rate(struct msm_vidc_inst *inst)
		return 0;

	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,