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

Commit 5dea60aa authored by Deva Ramasubramanian's avatar Deva Ramasubramanian Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Update loads for DCVS



The DCVS algorithm has now been tuned to account for more codecs and
more resolutions.  Set the threshold loads for each of these cases so
that DCVS takes affect.

Change-Id: If1e57c48cf09d9edbe1475623c8f4043dbbf1dd9
Signed-off-by: default avatarDeva Ramasubramanian <dramasub@codeaurora.org>
parent 6d62498a
Loading
Loading
Loading
Loading
+19 −5
Original line number Diff line number Diff line
@@ -162,6 +162,8 @@ void msm_dcvs_init_load(struct msm_vidc_inst *inst)
	struct msm_vidc_core *core;
	struct hal_buffer_requirements *output_buf_req;
	struct dcvs_stats *dcvs;
	const unsigned int load_uhd = NUM_MBS_PER_SEC(2160, 3840, 30),
		load_1080p = NUM_MBS_PER_SEC(1088, 1920, 60);

	dprintk(VIDC_DBG, "Init DCVS Load\n");

@@ -175,9 +177,19 @@ void msm_dcvs_init_load(struct msm_vidc_inst *inst)

	dcvs->load = msm_comm_get_inst_load(inst, LOAD_CALC_NO_QUIRKS);

	if (dcvs->load >= DCVS_NOMINAL_LOAD) {
		dcvs->load_low = DCVS_NOMINAL_LOAD;
		dcvs->load_high = core->resources.max_load;
	if (inst->session_type == MSM_VIDC_DECODER) {
		if (dcvs->load > load_uhd) {
			dcvs->load_low = DCVS_DEC_NOMINAL_LOAD;
			dcvs->load_high = DCVS_DEC_TURBO_LOAD;
		} else if (dcvs->load > load_1080p) {
			dcvs->load_low = DCVS_DEC_SVS_LOAD;
			dcvs->load_high = DCVS_DEC_NOMINAL_LOAD;
		}
	} else { /* encoder */
		if (dcvs->load >= load_uhd) {
			dcvs->load_low = DCVS_ENC_NOMINAL_LOAD;
			dcvs->load_high = DCVS_ENC_TURBO_LOAD;
		}
	}

	if (inst->session_type == MSM_VIDC_ENCODER)
@@ -460,8 +472,10 @@ bool msm_dcvs_enc_check(struct msm_vidc_inst *inst)
	}

	is_codec_supported  =
		(inst->fmts[CAPTURE_PORT]->fourcc == V4L2_PIX_FMT_H264) ||
		(inst->fmts[CAPTURE_PORT]->fourcc == V4L2_PIX_FMT_H264_NO_SC);
		inst->fmts[CAPTURE_PORT]->fourcc == V4L2_PIX_FMT_H264 ||
		inst->fmts[CAPTURE_PORT]->fourcc == V4L2_PIX_FMT_H264_NO_SC ||
		inst->fmts[CAPTURE_PORT]->fourcc == V4L2_PIX_FMT_HEVC;


	num_mbs_per_frame = msm_dcvs_get_mbs_per_frame(inst);
	if (msm_vidc_enc_dcvs_mode && is_codec_supported &&
+9 −2
Original line number Diff line number Diff line
@@ -27,8 +27,15 @@
#define DCVS_NOMINAL_THRESHOLD 8
/* Default threshold to increase the core frequency */
#define DCVS_TURBO_THRESHOLD 4
/* Instance max load above which DCVS kicks in */
#define DCVS_NOMINAL_LOAD NUM_MBS_PER_SEC(1088, 1920, 60)

/* Instance max load above which DCVS kicks in for decoder */
#define DCVS_DEC_SVS_LOAD NUM_MBS_PER_SEC(1088, 1920, 60)
#define DCVS_DEC_NOMINAL_LOAD NUM_MBS_PER_SEC(2160, 3840, 30)
#define DCVS_DEC_TURBO_LOAD NUM_MBS_PER_SEC(2160, 3840, 60)
/* ........................................... for encoder */
#define DCVS_ENC_NOMINAL_LOAD NUM_MBS_PER_SEC(1088, 1920, 60)
#define DCVS_ENC_TURBO_LOAD NUM_MBS_PER_SEC(2160, 3840, 30)

/* Considering one safeguard buffer */
#define DCVS_BUFFER_SAFEGUARD 1
/* Supported DCVS MBs per frame */