Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu/display: fix FP handling in DCN30

Adjust the FP handling to avoid nested calls.

The nested calls cause the warning below
WARNING: CPU: 3 PID: 384 at arch/x86/kernel/fpu/core.c:129 kernel_fpu_begin

Fixes: 582e2ce5b4ece3 ("drm/amdgpu/display: FP fixes for DCN3.x (v4)")
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

+6 -37
+6 -37
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c
··· 1470 1470 return pipe_cnt; 1471 1471 } 1472 1472 1473 - /* 1474 - * This must be noinline to ensure anything that deals with FP registers 1475 - * is contained within this call; previously our compiling with hard-float 1476 - * would result in fp instructions being emitted outside of the boundaries 1477 - * of the DC_FP_START/END macros, which makes sense as the compiler has no 1478 - * idea about what is wrapped and what is not 1479 - * 1480 - * This is largely just a workaround to avoid breakage introduced with 5.6, 1481 - * ideally all fp-using code should be moved into its own file, only that 1482 - * should be compiled with hard-float, and all code exported from there 1483 - * should be strictly wrapped with DC_FP_START/END 1484 - */ 1485 - static noinline void dcn30_populate_dml_writeback_from_context_fp( 1486 - struct dc *dc, struct resource_context *res_ctx, display_e2e_pipe_params_st *pipes) 1473 + void dcn30_populate_dml_writeback_from_context( 1474 + struct dc *dc, struct resource_context *res_ctx, display_e2e_pipe_params_st *pipes) 1487 1475 { 1488 1476 int pipe_cnt, i, j; 1489 1477 double max_calc_writeback_dispclk; ··· 1557 1569 pipe_cnt++; 1558 1570 } 1559 1571 1560 - } 1561 - 1562 - void dcn30_populate_dml_writeback_from_context( 1563 - struct dc *dc, struct resource_context *res_ctx, display_e2e_pipe_params_st *pipes) 1564 - { 1565 - DC_FP_START(); 1566 - dcn30_populate_dml_writeback_from_context_fp(dc, res_ctx, pipes); 1567 - DC_FP_END(); 1568 1572 } 1569 1573 1570 1574 unsigned int dcn30_calc_max_scaled_time( ··· 1957 1977 return pipe; 1958 1978 } 1959 1979 1960 - static bool dcn30_internal_validate_bw( 1980 + static noinline bool dcn30_internal_validate_bw( 1961 1981 struct dc *dc, 1962 1982 struct dc_state *context, 1963 1983 display_e2e_pipe_params_st *pipes, ··· 1979 1999 1980 2000 pipe_cnt = dc->res_pool->funcs->populate_dml_pipes(dc, context, pipes, fast_validate); 1981 2001 2002 + DC_FP_START(); 1982 2003 if (!pipe_cnt) { 1983 2004 out = true; 1984 2005 goto validate_out; ··· 2203 2222 out = false; 2204 2223 2205 2224 validate_out: 2225 + DC_FP_END(); 2206 2226 return out; 2207 2227 } 2208 2228 ··· 2386 2404 DC_FP_END(); 2387 2405 } 2388 2406 2389 - static noinline bool dcn30_validate_bandwidth_fp(struct dc *dc, 2407 + bool dcn30_validate_bandwidth(struct dc *dc, 2390 2408 struct dc_state *context, 2391 2409 bool fast_validate) 2392 2410 { ··· 2433 2451 kfree(pipes); 2434 2452 2435 2453 BW_VAL_TRACE_FINISH(); 2436 - 2437 - return out; 2438 - } 2439 - 2440 - bool dcn30_validate_bandwidth(struct dc *dc, 2441 - struct dc_state *context, 2442 - bool fast_validate) 2443 - { 2444 - bool out; 2445 - 2446 - DC_FP_START(); 2447 - out = dcn30_validate_bandwidth_fp(dc, context, fast_validate); 2448 - DC_FP_END(); 2449 2454 2450 2455 return out; 2451 2456 }