Commit 2e74748c authored by Jani Nikula's avatar Jani Nikula
Browse files

drm/i915/dp: Rename some variables in xelpd_dsc_compute_link_config()



Use the _x16 suffix for all .4 fixed point variables. Drop compressed_
prefix, as it's implied from the precision suffix.

As dsc_min_bpp and dsc_max_bpp change domain from int to .4 in the
middle of the function, they remain the same for now.

Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/91dd6ef53683b624a978101cca7322ea3e5e2f7b.1738327620.git.jani.nikula@intel.com
parent dc9ea877
Loading
Loading
Loading
Loading
+8 −11
Original line number Diff line number Diff line
@@ -2126,31 +2126,28 @@ xelpd_dsc_compute_link_config(struct intel_dp *intel_dp,
{
	struct intel_display *display = to_intel_display(intel_dp);
	int output_bpp = intel_dp_output_bpp(pipe_config->output_format, pipe_bpp);
	u16 compressed_bppx16;
	u8 bppx16_step;
	int bpp_x16, bpp_step_x16;
	int ret;

	bppx16_step = intel_dp_dsc_bpp_step_x16(connector);
	bpp_step_x16 = intel_dp_dsc_bpp_step_x16(connector);

	/* Compressed BPP should be less than the Input DSC bpp */
	dsc_max_bpp = min(dsc_max_bpp << 4, (output_bpp << 4) - bppx16_step);
	dsc_max_bpp = min(dsc_max_bpp << 4, (output_bpp << 4) - bpp_step_x16);
	dsc_min_bpp = dsc_min_bpp << 4;

	for (compressed_bppx16 = dsc_max_bpp;
	     compressed_bppx16 >= dsc_min_bpp;
	     compressed_bppx16 -= bppx16_step) {
	for (bpp_x16 = dsc_max_bpp; bpp_x16 >= dsc_min_bpp; bpp_x16 -= bpp_step_x16) {
		if (intel_dp->force_dsc_fractional_bpp_en &&
		    !fxp_q4_to_frac(compressed_bppx16))
		    !fxp_q4_to_frac(bpp_x16))
			continue;
		ret = dsc_compute_link_config(intel_dp,
					      pipe_config,
					      limits,
					      compressed_bppx16,
					      bpp_x16,
					      timeslots);
		if (ret == 0) {
			pipe_config->dsc.compressed_bpp_x16 = compressed_bppx16;
			pipe_config->dsc.compressed_bpp_x16 = bpp_x16;
			if (intel_dp->force_dsc_fractional_bpp_en &&
			    fxp_q4_to_frac(compressed_bppx16))
			    fxp_q4_to_frac(bpp_x16))
				drm_dbg_kms(display->drm,
					    "Forcing DSC fractional bpp\n");