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

Commit b6eb48ff authored by Ingrid Gallardo's avatar Ingrid Gallardo
Browse files

msm: mdss: remove deprecated compression ratio support



Starting with the change: "msm: mdss: use compression
ratio factors passed by user space"; compression ratio
factors are now assigned and passed by user space, so
kernel side does not need to assign the compression ratio
factors anymore. This change removes the deprecated
kernel code that was assigning the compression ratio.

Change-Id: I93e7afefa99198d947746df4a6962d0bb3508375
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
parent 67ec0584
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");

+0 −3
Original line number Diff line number Diff line
@@ -359,8 +359,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 {
@@ -1149,7 +1147,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);
+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},
	},
};

+0 −35
Original line number Diff line number Diff line
@@ -234,41 +234,6 @@ hist_isr_done:
	return IRQ_HANDLED;
}

bool mdss_mdp_initialize_ubwc_factors(struct mdss_data_type *mdata)
{
	struct mdss_fudge_factor *rt_factors;
	struct mdss_fudge_factor *nrt_factors;
	struct mdss_mdp_format_params_ubwc *ubwc_fmt;
	int comp_ratio_row = mdata->ubwc_comp_ratio_factors_row;
	int i;


	/* validate the compression ratio factors array size */
	if (ARRAY_SIZE(mdss_mdp_format_ubwc_map) != UBWC_TOTAL_FORMATS) {
		pr_err("mismatch found with the ubwc factors definition!\n");
		return true;
	}

	for (i = 0; i < ARRAY_SIZE(mdss_mdp_format_ubwc_map); i++) {
		ubwc_fmt = &mdss_mdp_format_ubwc_map[i];
		nrt_factors = &ubwc_nrt_factors[comp_ratio_row][i];
		rt_factors = &ubwc_rt_factors[comp_ratio_row][i];

		ubwc_fmt->comp_ratio_rt.numer = rt_factors->numer;
		ubwc_fmt->comp_ratio_rt.denom = rt_factors->denom;
		ubwc_fmt->comp_ratio_nrt.numer = nrt_factors->numer;
		ubwc_fmt->comp_ratio_nrt.denom = nrt_factors->denom;

		pr_debug("fmt:%d, rt:[%d,%d], nrt:[%d,%d]\n", i,
			ubwc_fmt->comp_ratio_rt.numer,
			ubwc_fmt->comp_ratio_rt.denom,
			ubwc_fmt->comp_ratio_nrt.numer,
			ubwc_fmt->comp_ratio_nrt.denom);
	}

	return false;
}

struct mdss_mdp_format_params *mdss_mdp_get_format_params(u32 format)
{
	struct mdss_mdp_format_params *fmt = NULL;