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

Commit 5cb73d66 authored by Fuad Hossain's avatar Fuad Hossain
Browse files

disp: msm: dp: fix dsc parameters for 10bpp compression



Add configuration data to handle 10bpp 3:1
compression ratio based on hardware recommended
settings.

CRs-Fixed: 2325207
Change-Id: I7086dc235e0063a79c661fa8cee77d4e47e9c826
Signed-off-by: default avatarFuad Hossain <fhossain@codeaurora.org>
parent ba12b2cd
Loading
Loading
Loading
Loading
+21 −12
Original line number Diff line number Diff line
@@ -974,6 +974,7 @@ enum dp_dsc_ratio_type {
	DSC_8BPC_8BPP,
	DSC_10BPC_8BPP,
	DSC_12BPC_8BPP,
	DSC_10BPC_10BPP,
	DSC_RATIO_TYPE_MAX
};

@@ -988,6 +989,7 @@ static char dp_dsc_rc_range_min_qp_1_1[][15] = {
	{0, 0, 1, 1, 3, 3, 3, 3, 3, 3, 5, 5, 5, 7, 13},
	{0, 4, 5, 5, 7, 7, 7, 7, 7, 7, 9, 9, 9, 11, 17},
	{0, 4, 9, 9, 11, 11, 11, 11, 11, 11, 13, 13, 13, 15, 21},
	{0, 4, 5, 6, 7, 7, 7, 7, 7, 7, 9, 9, 9, 11, 15},
	};

/*
@@ -998,6 +1000,7 @@ static char dp_dsc_rc_range_min_qp_1_1_scr1[][15] = {
	{0, 0, 1, 1, 3, 3, 3, 3, 3, 3, 5, 5, 5, 9, 12},
	{0, 4, 5, 5, 7, 7, 7, 7, 7, 7, 9, 9, 9, 13, 16},
	{0, 4, 9, 9, 11, 11, 11, 11, 11, 11, 13, 13, 13, 17, 20},
	{0, 4, 5, 6, 7, 7, 7, 7, 7, 7, 9, 9, 9, 11, 15},
	};

/*
@@ -1008,6 +1011,7 @@ static char dp_dsc_rc_range_max_qp_1_1[][15] = {
	{4, 4, 5, 6, 7, 7, 7, 8, 9, 10, 11, 12, 13, 13, 15},
	{8, 8, 9, 10, 11, 11, 11, 12, 13, 14, 15, 16, 17, 17, 19},
	{12, 12, 13, 14, 15, 15, 15, 16, 17, 18, 19, 20, 21, 21, 23},
	{7, 8, 9, 10, 11, 11, 11, 12, 13, 13, 14, 14, 15, 15, 16},
	};

/*
@@ -1018,6 +1022,7 @@ static char dp_dsc_rc_range_max_qp_1_1_scr1[][15] = {
	{4, 4, 5, 6, 7, 7, 7, 8, 9, 10, 10, 11, 11, 12, 13},
	{8, 8, 9, 10, 11, 11, 11, 12, 13, 14, 14, 15, 15, 16, 17},
	{12, 12, 13, 14, 15, 15, 15, 16, 17, 18, 18, 19, 19, 20, 21},
	{7, 8, 9, 10, 11, 11, 11, 12, 13, 13, 14, 14, 15, 15, 16},
	};

/*
@@ -1383,10 +1388,12 @@ static void dp_panel_dsc_populate_static_params(
	bpp = dsc->bpp;
	bpc = dsc->bpc;

	if (bpc == 12)
	if (bpc == 12 && bpp == 8)
		ratio_index = DSC_12BPC_8BPP;
	else if (bpc == 10)
	else if (bpc == 10 && bpp == 8)
		ratio_index = DSC_10BPC_8BPP;
	else if (bpc == 10 && bpp == 10)
		ratio_index = DSC_10BPC_10BPP;
	else
		ratio_index = DSC_8BPC_8BPP;

@@ -1401,15 +1408,16 @@ static void dp_panel_dsc_populate_static_params(
	}
	dsc->range_bpg_offset = dp_dsc_rc_range_bpg_offset;

	if (bpp <= 10)
	if (bpp == 8) {
		dsc->initial_offset = 6144;
	else
		dsc->initial_offset = 2048;	/* bpp = 12 */

	if (bpc == 12)
		mux_words_size = 64;
	else
		mux_words_size = 48;		/* bpc == 8/10 */
		dsc->initial_xmit_delay = 512;
	} else if (bpp == 10) {
		dsc->initial_offset = 5632;
		dsc->initial_xmit_delay = 410;
	} else {
		dsc->initial_offset = 2048;
		dsc->initial_xmit_delay = 341;
	}

	dsc->line_buf_depth = bpc + 1;

@@ -1419,18 +1427,21 @@ static void dp_panel_dsc_populate_static_params(
		dsc->max_qp_flatness = 12;
		dsc->quant_incr_limit0 = 11;
		dsc->quant_incr_limit1 = 11;
		mux_words_size = 48;
	} else if (bpc == 10) { /* 10bpc */
		dsc->input_10_bits = 1;
		dsc->min_qp_flatness = 7;
		dsc->max_qp_flatness = 16;
		dsc->quant_incr_limit0 = 15;
		dsc->quant_incr_limit1 = 15;
		mux_words_size = 48;
	} else { /* 12 bpc */
		dsc->input_10_bits = 0;
		dsc->min_qp_flatness = 11;
		dsc->max_qp_flatness = 20;
		dsc->quant_incr_limit0 = 19;
		dsc->quant_incr_limit1 = 19;
		mux_words_size = 64;
	}

	mod_offset = dsc->slice_width % 3;
@@ -1450,8 +1461,6 @@ static void dp_panel_dsc_populate_static_params(

	dsc->det_thresh_flatness = 2 << (bpc - 8);

	dsc->initial_xmit_delay = dsc->rc_model_size / (2 * bpp);

	groups_per_line = DIV_ROUND_UP(dsc->slice_width, 3);

	dsc->chunk_size = dsc->slice_width * bpp / 8;