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

Commit 0153454b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdss: add fudge factor to ib for single interface displays"

parents 95119a99 887b0f59
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -193,6 +193,7 @@ enum mdss_mdp_wb_ctl_type {

enum mdss_mdp_bw_vote_mode {
	MDSS_MDP_BW_MODE_SINGLE_LAYER,
	MDSS_MDP_BW_MODE_SINGLE_IF,
	MDSS_MDP_BW_MODE_MAX
};

@@ -203,6 +204,27 @@ enum mdp_wb_blk_caps {
	MDSS_MDP_WB_UBWC = BIT(3),
};

/**
 * enum perf_calc_vote_mode - enum to decide if mdss_mdp_get_bw_vote_mode
 *		function needs an extra efficiency factor.
 *
 * @PERF_CALC_VOTE_MODE_PER_PIPE: used to check if efficiency factor is needed
 *		based on the pipe properties.
 * @PERF_CALC_VOTE_MODE_CTL: used to check if efficiency factor is needed based
 *		on the controller properties.
 * @PERF_CALC_VOTE_MODE_MAX: used to check if efficiency factor is need to vote
 *		max MDP bandwidth.
 *
 * Depending upon the properties of each specific object (determined
 * by this enum), driver decides if the mode to vote needs an
 * extra factor.
 */
enum perf_calc_vote_mode {
	PERF_CALC_VOTE_MODE_PER_PIPE,
	PERF_CALC_VOTE_MODE_CTL,
	PERF_CALC_VOTE_MODE_MAX,
};

struct mdss_mdp_perf_params {
	u64 bw_overlap;
	u64 bw_writeback;
+32 −15
Original line number Diff line number Diff line
@@ -475,22 +475,33 @@ u32 mdss_mdp_perf_calc_smp_size(struct mdss_mdp_pipe *pipe,
	return smp_bytes;
}

static void mdss_mdp_get_bw_vote_mode(struct mdss_mdp_mixer *mixer,
	u32 mdp_rev, struct mdss_mdp_perf_params *perf, u32 flags)
static void mdss_mdp_get_bw_vote_mode(void *data,
	u32 mdp_rev, struct mdss_mdp_perf_params *perf,
	enum perf_calc_vote_mode calc_mode, u32 flags)
{
	bitmap_zero(perf->bw_vote_mode, MDSS_MDP_BW_MODE_MAX);

	if (!mixer)
	if (!data)
		goto exit;

	switch (mdp_rev) {
	case MDSS_MDP_HW_REV_105:
	case MDSS_MDP_HW_REV_109:
		if (calc_mode == PERF_CALC_VOTE_MODE_PER_PIPE) {
			struct mdss_mdp_mixer *mixer =
				(struct mdss_mdp_mixer *)data;

			if ((flags & PERF_CALC_PIPE_SINGLE_LAYER) &&
				!mixer->rotator_mode &&
			(mixer->type == MDSS_MDP_MIXER_TYPE_INTF)) {
				(mixer->type == MDSS_MDP_MIXER_TYPE_INTF))
					set_bit(MDSS_MDP_BW_MODE_SINGLE_LAYER,
						perf->bw_vote_mode);
		} else if (calc_mode == PERF_CALC_VOTE_MODE_CTL) {
			struct mdss_mdp_ctl *ctl = (struct mdss_mdp_ctl *)data;

			if (ctl->is_video_mode &&
				(ctl->mfd->split_mode == MDP_SPLIT_MODE_NONE))
					set_bit(MDSS_MDP_BW_MODE_SINGLE_IF,
						perf->bw_vote_mode);
		}
		break;
	default:
@@ -816,7 +827,8 @@ int mdss_mdp_perf_calc_pipe(struct mdss_mdp_pipe *pipe,
	prefill_params.is_bwc = mdss_mdp_is_ubwc_format(pipe->src_fmt);
	prefill_params.is_nv12 = mdss_mdp_is_nv12_format(pipe->src_fmt);

	mdss_mdp_get_bw_vote_mode(mixer, mdata->mdp_rev, perf, flags);
	mdss_mdp_get_bw_vote_mode(mixer, mdata->mdp_rev, perf,
		PERF_CALC_VOTE_MODE_PER_PIPE, flags);

	if (flags & PERF_CALC_PIPE_SINGLE_LAYER)
		perf->prefill_bytes =
@@ -1681,6 +1693,9 @@ static u64 mdss_mdp_ctl_calc_client_vote(struct mdss_data_type *mdata,
	int i;
	struct mdss_mdp_ctl *ctl;
	struct mdss_mdp_mixer *mixer;
	struct mdss_mdp_perf_params perf_temp;

	bitmap_zero(perf_temp.bw_vote_mode, MDSS_MDP_BW_MODE_MAX);

	for (i = 0; i < mdata->nctl; i++) {
		ctl = mdata->ctl_off + i;
@@ -1702,9 +1717,11 @@ static u64 mdss_mdp_ctl_calc_client_vote(struct mdss_data_type *mdata,
				mdss_mdp_ctl_perf_update_traffic_shaper_bw
					(ctl, mdp_clk);

			if (ctl->cur_perf.bw_vote_mode)
				bitmap_or(perf->bw_vote_mode,
					perf->bw_vote_mode,
			mdss_mdp_get_bw_vote_mode(ctl, mdata->mdp_rev,
				&perf_temp, PERF_CALC_VOTE_MODE_CTL, 0);

			bitmap_or(perf_temp.bw_vote_mode,
				perf_temp.bw_vote_mode,
				ctl->cur_perf.bw_vote_mode,
				MDSS_MDP_BW_MODE_MAX);

+2 −0
Original line number Diff line number Diff line
@@ -580,6 +580,8 @@ static bool mdss_mdp_traffic_shaper_helper(struct mdss_mdp_ctl *ctl,
		u32 traffic_shaper;
		pipe = mixer->stage_pipe[i];

		memset(&perf, 0, sizeof(perf));

		if (pipe == NULL)
			continue;

+2 −0
Original line number Diff line number Diff line
@@ -400,6 +400,8 @@ int mdp_pipe_tune_perf(struct mdss_mdp_pipe *pipe,
	struct mdss_mdp_perf_params perf;
	int rc;

	memset(&perf, 0, sizeof(perf));

	flags |= PERF_CALC_PIPE_APPLY_CLK_FUDGE |
		PERF_CALC_PIPE_CALC_SMP_SIZE;