Commit beb6b2f9 authored by Dillon Varone's avatar Dillon Varone Committed by Alex Deucher
Browse files

drm/amd/display: Remove MPC gamut remap logic for DCN30

[Why?]
Should only reroute gamut remap to mpc unless 3D LUT is not used and all
planes are using the same src->dest.

[How?]
Remove DCN30 specific logic for rerouting gamut remap to mpc.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1513


Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarDillon Varone <dillon.varone@amd.com>
Reviewed-by: default avatarKrunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: default avatarAric Cyr <Aric.Cyr@amd.com>
Acked-by: default avatarSolomon Chiu <solomon.chiu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
parent 34fa493a
Loading
Loading
Loading
Loading
+2 −32
Original line number Diff line number Diff line
@@ -1507,36 +1507,6 @@ static void dcn20_update_dchubp_dpp(
	if (pipe_ctx->update_flags.bits.enable || pipe_ctx->update_flags.bits.opp_changed
			|| pipe_ctx->stream->update_flags.bits.gamut_remap
			|| pipe_ctx->stream->update_flags.bits.out_csc) {
		struct mpc *mpc = pipe_ctx->stream_res.opp->ctx->dc->res_pool->mpc;

		if (mpc->funcs->set_gamut_remap) {
			int i;
			int mpcc_id = hubp->inst;
			struct mpc_grph_gamut_adjustment adjust;
			bool enable_remap_dpp = false;

			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 and use this remap into mpc */
			pipe_ctx->stream->gamut_remap_matrix.enable_remap = enable_remap_dpp;

			/* 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] =
								pipe_ctx->stream->gamut_remap_matrix.matrix[i];
			}
			mpc->funcs->set_gamut_remap(mpc, mpcc_id, &adjust);
		} else
		/* dpp/cm gamut remap*/
		dc->hwss.program_gamut_remap(pipe_ctx);