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

amdgpu: Prepare DCN floating point macros for generic arch support

Introduce DC_FP_START()/DC_FP_END() macros to help enable floating
point kernel mode support across various architectures.

v2: move copyright update to commit which adds the changes

Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Timothy Pearson and committed by
Alex Deucher
6ca3928d 66af4a9d

+22 -16
+12 -12
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
··· 622 622 { 623 623 bool updated = false; 624 624 625 - kernel_fpu_begin(); 625 + DC_FP_START(); 626 626 if ((int)(dc->dcn_soc->sr_exit_time * 1000) != dc->debug.sr_exit_time_ns 627 627 && dc->debug.sr_exit_time_ns) { 628 628 updated = true; ··· 658 658 dc->dcn_soc->dram_clock_change_latency = 659 659 dc->debug.dram_clock_change_latency_ns / 1000.0; 660 660 } 661 - kernel_fpu_end(); 661 + DC_FP_END(); 662 662 663 663 return updated; 664 664 } ··· 738 738 dcn_bw_sync_calcs_and_dml(dc); 739 739 740 740 memset(v, 0, sizeof(*v)); 741 - kernel_fpu_begin(); 741 + DC_FP_START(); 742 742 743 743 v->sr_exit_time = dc->dcn_soc->sr_exit_time; 744 744 v->sr_enter_plus_exit_time = dc->dcn_soc->sr_enter_plus_exit_time; ··· 1271 1271 bw_limit = dc->dcn_soc->percent_disp_bw_limit * v->fabric_and_dram_bandwidth_vmax0p9; 1272 1272 bw_limit_pass = (v->total_data_read_bandwidth / 1000.0) < bw_limit; 1273 1273 1274 - kernel_fpu_end(); 1274 + DC_FP_END(); 1275 1275 1276 1276 PERFORMANCE_TRACE_END(); 1277 1277 BW_VAL_TRACE_FINISH(); ··· 1439 1439 res = dm_pp_get_clock_levels_by_type_with_voltage( 1440 1440 ctx, DM_PP_CLOCK_TYPE_FCLK, &fclks); 1441 1441 1442 - kernel_fpu_begin(); 1442 + DC_FP_START(); 1443 1443 1444 1444 if (res) 1445 1445 res = verify_clock_values(&fclks); ··· 1459 1459 } else 1460 1460 BREAK_TO_DEBUGGER(); 1461 1461 1462 - kernel_fpu_end(); 1462 + DC_FP_END(); 1463 1463 1464 1464 res = dm_pp_get_clock_levels_by_type_with_voltage( 1465 1465 ctx, DM_PP_CLOCK_TYPE_DCFCLK, &dcfclks); 1466 1466 1467 - kernel_fpu_begin(); 1467 + DC_FP_START(); 1468 1468 1469 1469 if (res) 1470 1470 res = verify_clock_values(&dcfclks); ··· 1477 1477 } else 1478 1478 BREAK_TO_DEBUGGER(); 1479 1479 1480 - kernel_fpu_end(); 1480 + DC_FP_END(); 1481 1481 } 1482 1482 1483 1483 void dcn_bw_notify_pplib_of_wm_ranges(struct dc *dc) ··· 1492 1492 if (!pp || !pp->set_wm_ranges) 1493 1493 return; 1494 1494 1495 - kernel_fpu_begin(); 1495 + DC_FP_START(); 1496 1496 min_fclk_khz = dc->dcn_soc->fabric_and_dram_bandwidth_vmin0p65 * 1000000 / 32; 1497 1497 min_dcfclk_khz = dc->dcn_soc->dcfclkv_min0p65 * 1000; 1498 1498 socclk_khz = dc->dcn_soc->socclk * 1000; 1499 - kernel_fpu_end(); 1499 + DC_FP_END(); 1500 1500 1501 1501 /* Now notify PPLib/SMU about which Watermarks sets they should select 1502 1502 * depending on DPM state they are in. And update BW MGR GFX Engine and ··· 1547 1547 1548 1548 void dcn_bw_sync_calcs_and_dml(struct dc *dc) 1549 1549 { 1550 - kernel_fpu_begin(); 1550 + DC_FP_START(); 1551 1551 DC_LOG_BANDWIDTH_CALCS("sr_exit_time: %f ns\n" 1552 1552 "sr_enter_plus_exit_time: %f ns\n" 1553 1553 "urgent_latency: %f ns\n" ··· 1736 1736 dc->dml.ip.bug_forcing_LC_req_same_size_fixed = 1737 1737 dc->dcn_ip->bug_forcing_luma_and_chroma_request_to_same_size_fixed == dcn_bw_yes; 1738 1738 dc->dml.ip.dcfclk_cstate_latency = dc->dcn_ip->dcfclk_cstate_latency; 1739 - kernel_fpu_end(); 1739 + DC_FP_END(); 1740 1740 }
+3 -2
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
··· 1 1 /* 2 2 * Copyright 2016 Advanced Micro Devices, Inc. 3 + * Copyright 2019 Raptor Engineering, LLC 3 4 * 4 5 * Permission is hereby granted, free of charge, to any person obtaining a 5 6 * copy of this software and associated documentation files (the "Software"), ··· 3212 3211 3213 3212 void dcn20_patch_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_st *bb) 3214 3213 { 3215 - kernel_fpu_begin(); 3214 + DC_FP_START(); 3216 3215 if ((int)(bb->sr_exit_time_us * 1000) != dc->bb_overrides.sr_exit_time_ns 3217 3216 && dc->bb_overrides.sr_exit_time_ns) { 3218 3217 bb->sr_exit_time_us = dc->bb_overrides.sr_exit_time_ns / 1000.0; ··· 3236 3235 bb->dram_clock_change_latency_us = 3237 3236 dc->bb_overrides.dram_clock_change_latency_ns / 1000.0; 3238 3237 } 3239 - kernel_fpu_end(); 3238 + DC_FP_END(); 3240 3239 } 3241 3240 3242 3241 static struct _vcs_dpi_soc_bounding_box_st *get_asic_rev_soc_bb(
+4 -2
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
··· 1 1 /* 2 2 * Copyright 2018 Advanced Micro Devices, Inc. 3 + * Copyright 2019 Raptor Engineering, LLC 3 4 * 4 5 * Permission is hereby granted, free of charge, to any person obtaining a 5 6 * copy of this software and associated documentation files (the "Software"), ··· 994 993 { 995 994 int i; 996 995 997 - kernel_fpu_begin(); 996 + DC_FP_START(); 997 + 998 998 if (dc->bb_overrides.sr_exit_time_ns) { 999 999 for (i = 0; i < WM_SET_COUNT; i++) { 1000 1000 dc->clk_mgr->bw_params->wm_table.entries[i].sr_exit_time_us = ··· 1021 1019 } 1022 1020 } 1023 1021 1024 - kernel_fpu_end(); 1022 + DC_FP_END(); 1025 1023 } 1026 1024 1027 1025 void dcn21_calculate_wm(
+3
drivers/gpu/drm/amd/display/dc/os_types.h
··· 1 1 /* 2 2 * Copyright 2012-16 Advanced Micro Devices, Inc. 3 + * Copyright 2019 Raptor Engineering, LLC 3 4 * 4 5 * Permission is hereby granted, free of charge, to any person obtaining a 5 6 * copy of this software and associated documentation files (the "Software"), ··· 52 51 53 52 #if defined(CONFIG_DRM_AMD_DC_DCN) 54 53 #include <asm/fpu/api.h> 54 + #define DC_FP_START() kernel_fpu_begin() 55 + #define DC_FP_END() kernel_fpu_end() 55 56 #endif 56 57 57 58 /*