Skip to content

Commit 59dfb0c

Browse files
q66alexdeucher
authored andcommitted
drm/amd/display: work around fp code being emitted outside of DC_FP_START/END
The dcn20_validate_bandwidth function would have code touching the incorrect registers emitted outside of the boundaries of the DC_FP_START/END macros, at least on ppc64le. Work around the problem by wrapping the whole function instead. Signed-off-by: Daniel Kolesa <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] # 5.6.x
1 parent f33a6de commit 59dfb0c

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3068,25 +3068,32 @@ static bool dcn20_validate_bandwidth_internal(struct dc *dc, struct dc_state *co
30683068
return out;
30693069
}
30703070

3071-
3072-
bool dcn20_validate_bandwidth(struct dc *dc, struct dc_state *context,
3073-
bool fast_validate)
3071+
/*
3072+
* This must be noinline to ensure anything that deals with FP registers
3073+
* is contained within this call; previously our compiling with hard-float
3074+
* would result in fp instructions being emitted outside of the boundaries
3075+
* of the DC_FP_START/END macros, which makes sense as the compiler has no
3076+
* idea about what is wrapped and what is not
3077+
*
3078+
* This is largely just a workaround to avoid breakage introduced with 5.6,
3079+
* ideally all fp-using code should be moved into its own file, only that
3080+
* should be compiled with hard-float, and all code exported from there
3081+
* should be strictly wrapped with DC_FP_START/END
3082+
*/
3083+
static noinline bool dcn20_validate_bandwidth_fp(struct dc *dc,
3084+
struct dc_state *context, bool fast_validate)
30743085
{
30753086
bool voltage_supported = false;
30763087
bool full_pstate_supported = false;
30773088
bool dummy_pstate_supported = false;
30783089
double p_state_latency_us;
30793090

3080-
DC_FP_START();
30813091
p_state_latency_us = context->bw_ctx.dml.soc.dram_clock_change_latency_us;
30823092
context->bw_ctx.dml.soc.disable_dram_clock_change_vactive_support =
30833093
dc->debug.disable_dram_clock_change_vactive_support;
30843094

30853095
if (fast_validate) {
3086-
voltage_supported = dcn20_validate_bandwidth_internal(dc, context, true);
3087-
3088-
DC_FP_END();
3089-
return voltage_supported;
3096+
return dcn20_validate_bandwidth_internal(dc, context, true);
30903097
}
30913098

30923099
// Best case, we support full UCLK switch latency
@@ -3115,7 +3122,15 @@ bool dcn20_validate_bandwidth(struct dc *dc, struct dc_state *context,
31153122

31163123
restore_dml_state:
31173124
context->bw_ctx.dml.soc.dram_clock_change_latency_us = p_state_latency_us;
3125+
return voltage_supported;
3126+
}
31183127

3128+
bool dcn20_validate_bandwidth(struct dc *dc, struct dc_state *context,
3129+
bool fast_validate)
3130+
{
3131+
bool voltage_supported = false;
3132+
DC_FP_START();
3133+
voltage_supported = dcn20_validate_bandwidth_fp(dc, context, fast_validate);
31193134
DC_FP_END();
31203135
return voltage_supported;
31213136
}

0 commit comments

Comments
 (0)