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

Commit 04121731 authored by Qiwei Liu's avatar Qiwei Liu Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: disable bitrate savings for VBR_CFR only



Only allow disable bitrate savings for VBR_CFR mode,
otherwise will force enable it.

Change-Id: I2ee5f6e1d0e5a8a00dfd909a275c6a07d367bbe3
Signed-off-by: default avatarQiwei Liu <qiweil@codeaurora.org>
parent 630cb930
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -1061,6 +1061,7 @@ static inline int start_streaming(struct msm_vidc_inst *inst)
	struct hfi_device *hdev;
	struct hal_buffer_size_minimum b;
	u32 rc_mode;
	int value = 0;

	dprintk(VIDC_DBG, "%s: %x : inst %pK\n", __func__,
		hash32_ptr(inst->session), inst);
@@ -1086,6 +1087,19 @@ static inline int start_streaming(struct msm_vidc_inst *inst)
		}
	}

	value = msm_comm_g_ctrl_for_id(inst,
		V4L2_CID_MPEG_VIDC_VENC_BITRATE_SAVINGS);
	if (!value && rc_mode != V4L2_MPEG_VIDEO_BITRATE_MODE_VBR) {
		struct hal_enable enable;

		dprintk(VIDC_INFO,
			"Force enable bitrate savings for non-VBR_CFR\n");
		enable.enable = 1;
		rc = call_hfi_op(hdev, session_set_property,
			inst->session, HAL_PARAM_VENC_BITRATE_SAVINGS,
			&enable);
	}

	/* Check if current session is under HW capability */
	rc = msm_vidc_check_session_supported(inst);
	if (rc) {