Skip to content

Commit

Permalink
drm/amd/display: Remove FPU guards from the DML folder
Browse files Browse the repository at this point in the history
[ Upstream commit bbfbf09 ]

As part of the programming expectation for using DML functions, DC
requires that any DML function invoked outside DML uses:

 DC_FP_START();
 ... dml function ...
 DC_FP_END();

Additionally, all the DML functions that can be invoked outside the DML
folder call the function dc_assert_fp_enabled(), which is responsible
for triggering a warning in the case that the DML function was not
guarded by the DC_FP_START/END. For this reason, call DC_FP_START/END
inside DML is wrong, and this commit removes all of those references.

Tested-by: Mark Broadworth <mark.broadworth@amd.com>
Reviewed-by: Nevenko Stupar <Nevenko.Stupar@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: 822b84e ("drm/amd/display: Add missing WA and MCLK validation")
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
rodrigosiqueira authored and gregkh committed May 17, 2023
1 parent 3738a23 commit 0b47019
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
2 changes: 0 additions & 2 deletions drivers/gpu/drm/amd/display/dc/dml/dcn30/dcn30_fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,7 @@ void dcn30_fpu_calculate_wm_and_dlg(
pipe_idx++;
}

DC_FP_START();
dcn20_calculate_dlg_params(dc, context, pipes, pipe_cnt, vlevel);
DC_FP_END();

if (!pstate_en)
/* Restore full p-state latency */
Expand Down
17 changes: 1 addition & 16 deletions drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1200,9 +1200,7 @@ static void dcn32_full_validate_bw_helper(struct dc *dc,
}
} else {
// Most populate phantom DLG params before programming hardware / timing for phantom pipe
DC_FP_START();
dcn32_helper_populate_phantom_dlg_params(dc, context, pipes, *pipe_cnt);
DC_FP_END();

/* Call validate_apply_pipe_split flags after calling DML getters for
* phantom dlg params, or some of the VBA params indicating pipe split
Expand Down Expand Up @@ -1503,11 +1501,8 @@ bool dcn32_internal_validate_bw(struct dc *dc,

dml_log_pipe_params(&context->bw_ctx.dml, pipes, pipe_cnt);

if (!fast_validate) {
DC_FP_START();
if (!fast_validate)
dcn32_full_validate_bw_helper(dc, context, pipes, &vlevel, split, merge, &pipe_cnt);
DC_FP_END();
}

if (fast_validate ||
(dc->debug.dml_disallow_alternate_prefetch_modes &&
Expand Down Expand Up @@ -2172,29 +2167,23 @@ static int build_synthetic_soc_states(struct clk_bw_params *bw_params,
entry.fabricclk_mhz = 0;
entry.dram_speed_mts = 0;

DC_FP_START();
insert_entry_into_table_sorted(table, num_entries, &entry);
DC_FP_END();
}

// Insert the max DCFCLK
entry.dcfclk_mhz = max_dcfclk_mhz;
entry.fabricclk_mhz = 0;
entry.dram_speed_mts = 0;

DC_FP_START();
insert_entry_into_table_sorted(table, num_entries, &entry);
DC_FP_END();

// Insert the UCLK DPMS
for (i = 0; i < num_uclk_dpms; i++) {
entry.dcfclk_mhz = 0;
entry.fabricclk_mhz = 0;
entry.dram_speed_mts = bw_params->clk_table.entries[i].memclk_mhz * 16;

DC_FP_START();
insert_entry_into_table_sorted(table, num_entries, &entry);
DC_FP_END();
}

// If FCLK is coarse grained, insert individual DPMs.
Expand All @@ -2204,9 +2193,7 @@ static int build_synthetic_soc_states(struct clk_bw_params *bw_params,
entry.fabricclk_mhz = bw_params->clk_table.entries[i].fclk_mhz;
entry.dram_speed_mts = 0;

DC_FP_START();
insert_entry_into_table_sorted(table, num_entries, &entry);
DC_FP_END();
}
}
// If FCLK fine grained, only insert max
Expand All @@ -2215,9 +2202,7 @@ static int build_synthetic_soc_states(struct clk_bw_params *bw_params,
entry.fabricclk_mhz = max_fclk_mhz;
entry.dram_speed_mts = 0;

DC_FP_START();
insert_entry_into_table_sorted(table, num_entries, &entry);
DC_FP_END();
}

// At this point, the table contains all "points of interest" based on
Expand Down

0 comments on commit 0b47019

Please sign in to comment.