Commit 091e3131 authored by Nicholas Kazlauskas's avatar Nicholas Kazlauskas Committed by Alex Deucher
Browse files

drm/amd/display: Cleanup DML DSC input bpc validation



[Why & How]
Pipe input DSC bpc has a type mismatch with maximum DSC
input bpc - align the maximum with the pipe input type,
unsigned integer.

When checking the type we shoudl also check for an
implicit value of 0 and align with what the spreadsheet
does - default to max.

Rename output_bpc to dsc_input_bpc to reflect what the
field is actually used for.

Signed-off-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: default avatarDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: default avatarQingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0774e08a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2216,7 +2216,7 @@ int dcn20_populate_dml_pipes_from_context(
			pipes[pipe_cnt].dout.output_bpp = res_ctx->pipe_ctx[i].stream->timing.dsc_cfg.bits_per_pixel / 16.0;

		/* todo: default max for now, until there is logic reflecting this in dc*/
		pipes[pipe_cnt].dout.output_bpc = 12;
		pipes[pipe_cnt].dout.dsc_input_bpc = 12;
		/*fill up the audio sample rate (unit in kHz)*/
		get_audio_check(&res_ctx->pipe_ctx[i].stream->audio_info, &aud_check);
		pipes[pipe_cnt].dout.max_audio_sample_rate = aud_check.max_audiosample_rate / 1000;
+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ void dml_log_pipe_params(
		dml_print("DML PARAMS: PIPE [%d] DISPLAY OUTPUT PARAMS:\n", i);
		dml_print("DML PARAMS:     output_type                = %d\n", dout->output_type);
		dml_print("DML PARAMS:     output_format              = %d\n", dout->output_format);
		dml_print("DML PARAMS:     output_bpc                 = %d\n", dout->output_bpc);
		dml_print("DML PARAMS:     dsc_input_bpc              = %d\n", dout->dsc_input_bpc);
		dml_print("DML PARAMS:     output_bpp                 = %3.4f\n", dout->output_bpp);
		dml_print("DML PARAMS:     dp_lanes                   = %d\n", dout->dp_lanes);
		dml_print("DML PARAMS:     dsc_enable                 = %d\n", dout->dsc_enable);
+2 −2
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ struct _vcs_dpi_ip_params_st {
	double writeback_max_vscl_ratio;
	double writeback_min_hscl_ratio;
	double writeback_min_vscl_ratio;
	double maximum_dsc_bits_per_component;
	unsigned int maximum_dsc_bits_per_component;
	unsigned int writeback_max_hscl_taps;
	unsigned int writeback_max_vscl_taps;
	unsigned int writeback_line_buffer_luma_buffer_size;
@@ -292,10 +292,10 @@ struct writeback_st {
struct _vcs_dpi_display_output_params_st {
	int dp_lanes;
	double output_bpp;
	unsigned int dsc_input_bpc;
	int dsc_enable;
	int wb_enable;
	int num_active_wb;
	int output_bpc;
	int output_type;
	int is_virtual;
	int output_format;
+7 −1
Original line number Diff line number Diff line
@@ -471,7 +471,13 @@ static void fetch_pipe_params(struct display_mode_lib *mode_lib)
		mode_lib->vba.DSCEnable[mode_lib->vba.NumberOfActivePlanes] = dout->dsc_enable;
		mode_lib->vba.NumberOfDSCSlices[mode_lib->vba.NumberOfActivePlanes] =
				dout->dsc_slices;
		mode_lib->vba.DSCInputBitPerComponent[mode_lib->vba.NumberOfActivePlanes] = dout->output_bpc;
		if (!dout->dsc_input_bpc) {
			mode_lib->vba.DSCInputBitPerComponent[mode_lib->vba.NumberOfActivePlanes] =
				ip->maximum_dsc_bits_per_component;
		} else {
			mode_lib->vba.DSCInputBitPerComponent[mode_lib->vba.NumberOfActivePlanes] =
				dout->dsc_input_bpc;
		}
		mode_lib->vba.WritebackEnable[mode_lib->vba.NumberOfActivePlanes] = dout->wb_enable;
		mode_lib->vba.ActiveWritebacksPerPlane[mode_lib->vba.NumberOfActivePlanes] =
				dout->num_active_wb;