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

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

Merge "msm: vidc: Add support for encoder complexity"

parents f0556555 ca17de82
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -261,6 +261,8 @@ enum v4l2_mpeg_vidc_video_bitrate_savings_type {
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 135)
#define V4L2_CID_MPEG_VIDC_VIDEO_DISABLE_TIMESTAMP_REORDER \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 136)
#define V4L2_CID_MPEG_VIDC_VENC_COMPLEXITY \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 137)

#define V4L2_CID_MPEG_VIDC_VIDEO_UNKNOWN \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 0xFFF)
+15 −0
Original line number Diff line number Diff line
@@ -596,6 +596,16 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = {
		.step = 1,
		.menu_skip_mask = 0,
	},
	{
		.id = V4L2_CID_MPEG_VIDC_VENC_COMPLEXITY,
		.name = "Encoder complexity",
		.type = V4L2_CTRL_TYPE_INTEGER,
		.minimum = 0,
		.maximum = 100,
		.default_value = 100,
		.step = 1,
		.qmenu = NULL,
	},
	{
		.id = V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_TYPE,
		.name = "Set Hier coding type",
@@ -1976,6 +1986,11 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
	case V4L2_CID_MPEG_VIDC_VENC_BITRATE_BOOST:
		inst->boost_enabled = true;
		break;
	case V4L2_CID_MPEG_VIDC_VENC_COMPLEXITY:
		if (is_realtime_session(inst)) {
			s_vpr_h(sid, "Client is setting complexity for RT session\n");
		}
		break;
	case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE:
		inst->entropy_mode = msm_comm_v4l2_to_hfi(
			V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE,
+4 −0
Original line number Diff line number Diff line
@@ -1434,6 +1434,7 @@ static inline int msm_vidc_power_save_mode_enable(struct msm_vidc_inst *inst,
	void *pdata = NULL;
	struct hfi_device *hdev = NULL;
	u32 hfi_perf_mode;
	struct v4l2_ctrl *ctrl;

	hdev = inst->core->device;
	if (inst->session_type != MSM_VIDC_ENCODER) {
@@ -1443,6 +1444,9 @@ static inline int msm_vidc_power_save_mode_enable(struct msm_vidc_inst *inst,
		return 0;
	}

	ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VENC_COMPLEXITY);
	if (!is_realtime_session(inst) && !ctrl->val)
		enable = true;
	prop_id = HFI_PROPERTY_CONFIG_VENC_PERF_MODE;
	hfi_perf_mode = enable ? HFI_VENC_PERFMODE_POWER_SAVE :
		HFI_VENC_PERFMODE_MAX_QUALITY;