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

Commit 6090ef6b authored by Shi Zhongbo's avatar Shi Zhongbo Committed by Gerrit - the friendly Code Review server
Browse files

msm: venc: distinguish client frame rate handling from auto detection of frame rate



By default, encoder needs to enable VUI timing info.
Frame rate change triggers new header and timing info.
Hence, we need to distinguish client trigger fps change
vs auto detection of fps change.
Introduced new HFI for setting auto detection of fps.
In auto fps case, VUI timing is not re-generated.

Change-Id: I6b579d1e6ef0c49a849b7b7e0383f593a949bab3
Signed-off-by: default avatarShi Zhongbo <zhongbos@codeaurora.org>
parent c6433185
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -1672,7 +1672,7 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		if (inst->state < MSM_VIDC_LOAD_RESOURCES)
			msm_vidc_calculate_buffer_counts(inst);
		if (inst->state == MSM_VIDC_START_DONE) {
			rc = msm_venc_set_frame_rate(inst);
			rc = msm_venc_set_frame_rate(inst, true);
			if (rc)
				s_vpr_e(sid, "%s: set frame rate failed\n",
					__func__);
@@ -2095,7 +2095,7 @@ int msm_venc_set_frame_size(struct msm_vidc_inst *inst)
	return rc;
}

int msm_venc_set_frame_rate(struct msm_vidc_inst *inst)
int msm_venc_set_frame_rate(struct msm_vidc_inst *inst, bool external_requested)
{
	int rc = 0;
	struct hfi_device *hdev;
@@ -2128,9 +2128,16 @@ int msm_venc_set_frame_rate(struct msm_vidc_inst *inst)

	s_vpr_h(inst->sid, "%s: %#x\n", __func__, frame_rate.frame_rate);

	if (external_requested) {
		rc = call_hfi_op(hdev, session_set_property,
			inst->session, HFI_PROPERTY_CONFIG_FRAME_RATE,
			&frame_rate, sizeof(frame_rate));
	} else {
		s_vpr_l(inst->sid, "Auto frame rate set");
		rc = call_hfi_op(hdev, session_set_property,
		inst->session, HFI_PROPERTY_CONFIG_VENC_AUTO_FRAME_RATE,
		&frame_rate, sizeof(frame_rate));
	}
	if (rc)
		s_vpr_e(inst->sid, "%s: set property failed\n", __func__);

@@ -2202,7 +2209,7 @@ int msm_venc_store_timestamp(struct msm_vidc_inst *inst, u64 timestamp_us)
			inst->clk_data.frame_rate = entry->framerate;
		s_vpr_l(inst->sid, "%s: updated fps to %u\n",
			__func__, (inst->clk_data.frame_rate >> 16));
		msm_venc_set_frame_rate(inst);
		msm_venc_set_frame_rate(inst, false);
	}

unlock:
@@ -4910,7 +4917,7 @@ int msm_venc_set_properties(struct msm_vidc_inst *inst)
	rc = msm_venc_set_frame_size(inst);
	if (rc)
		goto exit;
	rc = msm_venc_set_frame_rate(inst);
	rc = msm_venc_set_frame_rate(inst, true);
	if (rc)
		goto exit;
	rc = msm_venc_set_secure_mode(inst);
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst,
		struct v4l2_ctrl *ctrl);
int msm_venc_set_properties(struct msm_vidc_inst *inst);
int msm_venc_set_extradata(struct msm_vidc_inst *inst);
int msm_venc_set_frame_rate(struct msm_vidc_inst *inst);
int msm_venc_set_frame_rate(struct msm_vidc_inst *inst, bool external_requested);
int msm_venc_store_timestamp(struct msm_vidc_inst *inst, u64 timestamp_us);
int msm_venc_set_bitrate(struct msm_vidc_inst *inst);
int msm_venc_set_layer_bitrate(struct msm_vidc_inst *inst);
+2 −0
Original line number Diff line number Diff line
@@ -379,6 +379,8 @@ struct hfi_buffer_info {
	(HFI_PROPERTY_CONFIG_VENC_COMMON_START + 0x015)
#define HFI_PROPERTY_CONFIG_CVP_SKIP_RATIO			\
	(HFI_PROPERTY_CONFIG_VENC_COMMON_START + 0x016)
#define HFI_PROPERTY_CONFIG_VENC_AUTO_FRAME_RATE	\
		(HFI_PROPERTY_CONFIG_VENC_COMMON_START + 0x017)

#define HFI_PROPERTY_PARAM_VPE_COMMON_START				\
	(HFI_DOMAIN_BASE_VPE + HFI_ARCH_COMMON_OFFSET + 0x7000)