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

Commit bb9b4fe2 authored by Veera Sundaram Sankaran's avatar Veera Sundaram Sankaran Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm: fix DSC slice last_group_size config



Currently the DSC slice last_group_size configures
wrong values when the dsc slice is not a perfect
multiple of 3. Fix it to configure the correct value
for any dsc slice.

Change-Id: Ie2e83cfd801aa63f643b371f69b45bf78781ff74
Signed-off-by: default avatarVeera Sundaram Sankaran <veeras@codeaurora.org>
parent 38ec7e0c
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -2115,7 +2115,7 @@ int dsi_dsc_populate_static_param(struct msm_display_dsc_info *dsc)
	int target_bpp_x16;
	int data;
	int final_value, final_scale;
	int ratio_index;
	int ratio_index, mod_offset;

	dsc->rc_model_size = 8192;

@@ -2187,7 +2187,20 @@ int dsi_dsc_populate_static_param(struct msm_display_dsc_info *dsc)
		dsc->quant_incr_limit1 = 19;
	}

	dsc->slice_last_group_size = 3 - (dsc->slice_width % 3);
	mod_offset = dsc->slice_width % 3;
	switch (mod_offset) {
	case 0:
		dsc->slice_last_group_size = 2;
		break;
	case 1:
		dsc->slice_last_group_size = 0;
		break;
	case 2:
		dsc->slice_last_group_size = 1;
		break;
	default:
		break;
	}

	dsc->det_thresh_flatness = 7 + 2*(bpc - 8);

+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -65,7 +65,7 @@ static void sde_hw_dsc_config(struct sde_hw_dsc *hw_dsc,
		initial_lines += 1;

	data |= (initial_lines << 20);
	data |= ((dsc->slice_last_group_size - 1) << 18);
	data |= (dsc->slice_last_group_size << 18);
	/* bpp is 6.4 format, 4 LSBs bits are for fractional part */
	lsb = dsc->bpp % 4;
	bpp = dsc->bpp / 4;