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

drm/amd/display: Fix CSC remap matrix not being applied on dcn30



[Why]
DCN3 has two gamut remap matrices. When using CSC adjustment the CM
remap is set to bypass and MPCC remap is used. However to bypass CM
some state in the context is modified and not restored correctly
resulting in subsequent calls to disable MPCC remap as well.

[How]
Fix logic for save/restore of remap enable flag when programming MPCC
remap matrix.

Signed-off-by: default avatarAric Cyr <aric.cyr@amd.com>
Signed-off-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c74f9322
Loading
Loading
Loading
Loading
+14 −13
Original line number Diff line number Diff line
@@ -1482,18 +1482,19 @@ static void dcn20_update_dchubp_dpp(

			memset(&adjust, 0, sizeof(adjust));
			adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;

			/* save the enablement of gamut remap for dpp */
			enable_remap_dpp = pipe_ctx->stream->gamut_remap_matrix.enable_remap;

			/* force bypass gamut remap for dpp/cm */
			pipe_ctx->stream->gamut_remap_matrix.enable_remap = false;
			dc->hwss.program_gamut_remap(pipe_ctx);
			/*restore gamut remap flag for the top plane and use this remap into mpc*/
			if (pipe_ctx->top_pipe == NULL)

			/* restore gamut remap flag and use this remap into mpc */
			pipe_ctx->stream->gamut_remap_matrix.enable_remap = enable_remap_dpp;
			else
				pipe_ctx->stream->gamut_remap_matrix.enable_remap = false;

			if (pipe_ctx->stream->gamut_remap_matrix.enable_remap == true) {
			/* build remap matrix for top plane if enabled */
			if (enable_remap_dpp && pipe_ctx->top_pipe == NULL) {
					adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW;
					for (i = 0; i < CSC_TEMPERATURE_MATRIX_SIZE; i++)
						adjust.temperature_matrix[i] =