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

Commit b4d2b390 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: remove deprecated compression ratio support"

parents e5362794 b6eb48ff
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -312,7 +312,6 @@ struct mdss_data_type {
	struct mdss_fudge_factor ib_factor_overlap;
	struct mdss_fudge_factor clk_factor;
	struct mdss_fudge_factor per_pipe_ib_factor;
	u32 ubwc_comp_ratio_factors_row;
	bool apply_post_scale_bytes;
	bool hflip_buffer_reused;

+0 −8
Original line number Diff line number Diff line
@@ -1056,7 +1056,6 @@ static void mdss_mdp_hw_rev_caps_init(struct mdss_data_type *mdata)

	mdata->per_pipe_ib_factor.numer = 0;
	mdata->per_pipe_ib_factor.denom = 0;
	mdata->ubwc_comp_ratio_factors_row = 1;
	mdata->apply_post_scale_bytes = true;
	mdata->hflip_buffer_reused = true;
	/* prevent disable of prefill calculations */
@@ -1064,7 +1063,6 @@ static void mdss_mdp_hw_rev_caps_init(struct mdss_data_type *mdata)

	switch (mdata->mdp_rev) {
	case MDSS_MDP_HW_REV_107:
		mdata->ubwc_comp_ratio_factors_row = 0;
		mdss_set_quirk(mdata, MDSS_QUIRK_ROTCDP);
	case MDSS_MDP_HW_REV_107_1:
	case MDSS_MDP_HW_REV_107_2:
@@ -1651,12 +1649,6 @@ static int mdss_mdp_probe(struct platform_device *pdev)
	else
		mdata->handoff_pending = true;

	/* Initialize UBWC factors (needed for BW votes) */
	if (test_bit(MDSS_QOS_OVERHEAD_FACTOR, mdata->mdss_qos_map)) {
		if (mdss_mdp_initialize_ubwc_factors(mdata))
			pr_err("error cannot initialize ubwc compression ratio factors\n");
	}

	pr_info("mdss version = 0x%x, bootloader display is %s\n",
		mdata->mdp_rev, display_on ? "on" : "off");

+5 −5
Original line number Diff line number Diff line
@@ -363,8 +363,6 @@ struct mdss_mdp_format_params {

struct mdss_mdp_format_params_ubwc {
	struct mdss_mdp_format_params mdp_format;
	struct mdss_fudge_factor comp_ratio_rt;
	struct mdss_fudge_factor comp_ratio_nrt;
};

struct mdss_mdp_plane_sizes {
@@ -525,6 +523,9 @@ struct mdss_mdp_pipe {
	struct mdss_mdp_format_params *src_fmt;
	struct mdss_mdp_plane_sizes src_planes;

	/* compression ratio from the source format */
	struct mult_factor comp_ratio;

	u8 mixer_stage;
	u8 is_fg;
	u8 alpha;
@@ -1037,8 +1038,8 @@ void mdss_mdp_ctl_notifier_unregister(struct mdss_mdp_ctl *ctl,
	struct notifier_block *notifier);
u32 mdss_mdp_ctl_perf_get_transaction_status(struct mdss_mdp_ctl *ctl);
u32 mdss_apply_overhead_factors(u32 quota, bool is_nrt,
	bool is_rot_read, struct mdss_mdp_format_params *fmt);

	bool is_rot_read, struct mdss_mdp_format_params *fmt,
	struct mult_factor *comp_ratio);

int mdss_mdp_scan_pipes(void);

@@ -1158,7 +1159,6 @@ int mdss_mdp_get_rau_strides(u32 w, u32 h, struct mdss_mdp_format_params *fmt,
			       struct mdss_mdp_plane_sizes *ps);
void mdss_mdp_data_calc_offset(struct mdss_mdp_data *data, u16 x, u16 y,
	struct mdss_mdp_plane_sizes *ps, struct mdss_mdp_format_params *fmt);
bool mdss_mdp_initialize_ubwc_factors(struct mdss_data_type *mdata);
struct mdss_mdp_format_params *mdss_mdp_get_format_params(u32 format);
void mdss_mdp_get_v_h_subsample_rate(u8 chroma_samp,
	u8 *v_sample, u8 *h_sample);
+24 −21
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ static inline u64 apply_fudge_factor(u64 val,
}

static inline u64 apply_inverse_fudge_factor(u64 val,
	struct mdss_fudge_factor *factor)
	struct mult_factor *factor)
{
	return fudge_factor(val, factor->denom, factor->numer);
}
@@ -543,22 +543,19 @@ static u32 get_pipe_mdp_clk_rate(struct mdss_mdp_pipe *pipe,
	return rate;
}

static inline bool validate_comp_ratio(struct mult_factor *factor)
{
	return factor->numer && factor->denom;
}

static u32 apply_comp_ratio_factor(u32 quota,
	struct mdss_mdp_format_params *fmt,
	bool is_nrt)
	struct mult_factor *factor)
{
	struct mdss_fudge_factor *factor;
	struct mdss_mdp_format_params_ubwc *ubwc_fmt;

	if (mdss_mdp_is_ubwc_format(fmt)) {
		ubwc_fmt = container_of(fmt, struct mdss_mdp_format_params_ubwc,
			mdp_format);

		if (is_nrt)
			factor = &ubwc_fmt->comp_ratio_nrt;
		else
			factor = &ubwc_fmt->comp_ratio_rt;

	/* apply compression ratio, only for compressed formats */
	if (mdss_mdp_is_ubwc_format(fmt) &&
			validate_comp_ratio(factor)) {
		quota = apply_inverse_fudge_factor(quota , factor);
	}

@@ -567,7 +564,8 @@ static u32 apply_comp_ratio_factor(u32 quota,

static u32 apply_overhead_factors(u32 quota,
	bool is_nrt, bool is_rot_read,
	struct mdss_mdp_format_params *fmt)
	struct mdss_mdp_format_params *fmt,
	struct mult_factor *comp_ratio)
{
	u32 overhead_quota;

@@ -587,7 +585,8 @@ static u32 apply_overhead_factors(u32 quota,
	} else {
		/* add ~3% (0.03125) of overhead */
		overhead_quota = quota / 32;
		overhead_quota += apply_comp_ratio_factor(quota, fmt, is_nrt);
		overhead_quota += apply_comp_ratio_factor(quota, fmt,
			comp_ratio);
	}

	return overhead_quota;
@@ -608,7 +607,8 @@ static u32 mdss_mdp_get_rotator_fps(struct mdss_mdp_pipe *pipe)
}

u32 mdss_apply_overhead_factors(u32 quota, bool is_nrt,
	bool is_rot_read, struct mdss_mdp_format_params *fmt)
	bool is_rot_read, struct mdss_mdp_format_params *fmt,
	struct mult_factor *comp_ratio)
{
	struct mdss_data_type *mdata = mdss_mdp_get_mdata();

@@ -618,7 +618,7 @@ u32 mdss_apply_overhead_factors(u32 quota, bool is_nrt,
	if (test_bit(MDSS_QOS_OVERHEAD_FACTOR,
			mdata->mdss_qos_map)) {
		quota = apply_overhead_factors(quota,
			is_nrt, is_rot_read, fmt);
			is_nrt, is_rot_read, fmt, comp_ratio);
	}
	return quota;
}
@@ -732,7 +732,8 @@ int mdss_mdp_perf_calc_pipe(struct mdss_mdp_pipe *pipe,
				mdata->mdss_qos_map)) {
			/* rotator read */
			quota = apply_overhead_factors(quota,
				true, true, pipe->src_fmt);
				true, true, pipe->src_fmt,
				&pipe->comp_ratio);
			/*
			 * rotator write: here we are using src_fmt since
			 * current implementation only supports calculate
@@ -743,7 +744,8 @@ int mdss_mdp_perf_calc_pipe(struct mdss_mdp_pipe *pipe,
			 * calculation as per current support.
			 */
			quota += apply_overhead_factors(quota,
				true, false, pipe->src_fmt);
				true, false, pipe->src_fmt,
				&pipe->comp_ratio);
		} else {
			quota *= 2; /* bus read + write */
		}
@@ -757,7 +759,8 @@ int mdss_mdp_perf_calc_pipe(struct mdss_mdp_pipe *pipe,
				mdata->mdss_qos_map))
			quota = apply_overhead_factors(quota,
				mdss_mdp_is_nrt_ctl_path(mixer->ctl),
				false, pipe->src_fmt);
				false, pipe->src_fmt,
				&pipe->comp_ratio);
	}

	perf->bw_overlap = quota;
@@ -883,7 +886,7 @@ static void mdss_mdp_perf_calc_mixer(struct mdss_mdp_mixer *mixer,
					mdata->mdss_qos_map))
				perf->bw_writeback = apply_overhead_factors(
					perf->bw_writeback,
					true, false, fmt);
					true, false, fmt, &pipe->comp_ratio);
		/* for command mode, run as fast as the link allows us */
		} else if (pinfo->type == MIPI_CMD_PANEL) {
			u32 dsi_pclk_rate = pinfo->mipi.dsi_pclk_rate;
+2 −50
Original line number Diff line number Diff line
@@ -168,80 +168,32 @@ enum {
		},						\
	}

/*
 * UBWC compression ratio factors tables:
 * These tables hold the compression ratios that need to be used for
 * BW vote for the different UBWC formats within different chipsets.
 * If a new ubwc format is added to the mdss_mdp_format_ubwc_map
 * table, then a new column needs to be added to the ubwc_rt_factors
 * and ubwc_nrt_factors as well as update the definition of
 * UBWC_TOTAL_FORMATS to account for the size of the table.
 * If the chipset needs these factors for BW calculation, driver will verify
 * that the size of the factors tables are multiple of the ubwc_map
 * table and throw an error if a mismatch is found.
 */
#define UBWC_TOTAL_FORMATS 4

static struct mdss_fudge_factor ubwc_rt_factors[][UBWC_TOTAL_FORMATS] = {
	/* 8996 v1*/
	{{1, 1} ,       /* RGB_565_UBWC   */
	 {126, 100} ,   /* RGBA_8888_UBWC */
	 {126, 100} ,   /* RGBX_8888_UBWC */
	 {123, 100} } , /* YUV_H2V2_UBWC  */
	/* 8996 v2/v3 */
	{{1, 1} ,       /* RGB_565_UBWC   */
	 {126, 100} ,   /* RGBA_8888_UBWC */
	 {126, 100} ,   /* RGBX_8888_UBWC */
	 {123, 100} },  /* YUV_H2V2_UBWC  */
};

static struct mdss_fudge_factor ubwc_nrt_factors[][UBWC_TOTAL_FORMATS] = {
	/* 8996 v1*/
	{{1, 1} ,       /* RGB_565_UBWC   */
	 {146, 100} ,   /* RGBA_8888_UBWC */
	 {146, 100} ,   /* RGBX_8888_UBWC */
	 {1, 1} } ,     /* YUV_H2V2_UBWC  */
	/* 8996 v2/v3 */
	{{1, 1} ,       /* RGB_565_UBWC   */
	 {146, 100} ,   /* RGBA_8888_UBWC */
	 {146, 100} ,   /* RGBX_8888_UBWC */
	 {128, 100} } , /* YUV_H2V2_UBWC  */
};

/*
 * UBWC formats table:
 * This table holds the UBWC formats supported.
 * If a new format is added, the corresponding compression ratio must be
 * added in ubwc_rt_factors and ubwc_nrt_factors tables.
 * If a compression ratio needs to be used for this or any other format,
 * the data will be passed by user-space.
 */
static struct mdss_mdp_format_params_ubwc mdss_mdp_format_ubwc_map[] = {
	{
		.mdp_format = FMT_RGB_565(MDP_RGB_565_UBWC,
			MDSS_MDP_FETCH_UBWC, VALID_ROT_WB_FORMAT,
			C1_B_Cb, C0_G_Y, C2_R_Cr),
		.comp_ratio_rt = {1, 1},
		.comp_ratio_nrt = {1, 1},
	},
	{
		.mdp_format = FMT_RGB_8888(MDP_RGBA_8888_UBWC,
			MDSS_MDP_FETCH_UBWC, VALID_ROT_WB_FORMAT, 1,
			C2_R_Cr, C0_G_Y, C1_B_Cb, C3_ALPHA),
		.comp_ratio_rt = {1, 1},
		.comp_ratio_nrt = {1, 1},
	},
	{
		.mdp_format = FMT_RGB_8888(MDP_RGBX_8888_UBWC,
			MDSS_MDP_FETCH_UBWC, VALID_ROT_WB_FORMAT, 0,
			C2_R_Cr, C0_G_Y, C1_B_Cb, C3_ALPHA),
		.comp_ratio_rt = {1, 1},
		.comp_ratio_nrt = {1, 1},
	},
	{
		.mdp_format = FMT_YUV_PSEUDO(MDP_Y_CBCR_H2V2_UBWC,
			MDSS_MDP_FETCH_UBWC, MDSS_MDP_CHROMA_420,
			VALID_ROT_WB_FORMAT, C1_B_Cb, C2_R_Cr),
		.comp_ratio_rt = {1, 1},
		.comp_ratio_nrt = {1, 1},
	},
};

Loading