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

drm/amd/display: Remove dml_common_def file

During the rework for removing the FPU issues, I found the following
warning:

[..] dml_common_defs.o: warning: objtool: dml_round()+0x9: FPU
instruction outside of kernel_fpu_{begin,end}()

This file has a single function that does not need to be in a specific
file. This commit drop dml_common_defs file, and move dml_round function
to dml_inline_defs.

CC: Christian König <christian.koenig@amd.com>
CC: Alexander Deucher <Alexander.Deucher@amd.com>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Tony Cheng <tony.cheng@amd.com>
CC: Harry Wentland <hwentlan@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Rodrigo Siqueira and committed by
Alex Deucher
c38606ab 570bc18c

+18 -94
-2
drivers/gpu/drm/amd/display/dc/dml/Makefile
··· 63 63 endif 64 64 CFLAGS_$(AMDDALPATH)/dc/dml/dml1_display_rq_dlg_calc.o := $(dml_ccflags) 65 65 CFLAGS_$(AMDDALPATH)/dc/dml/display_rq_dlg_helpers.o := $(dml_ccflags) 66 - CFLAGS_$(AMDDALPATH)/dc/dml/dml_common_defs.o := $(dml_ccflags) 67 66 68 67 DML = display_mode_lib.o display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \ 69 - dml_common_defs.o 70 68 71 69 ifdef CONFIG_DRM_AMD_DC_DCN 72 70 DML += display_mode_vba.o dcn20/display_rq_dlg_calc_20.o dcn20/display_mode_vba_20.o
-1
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.h
··· 26 26 #ifndef __DML20_DISPLAY_RQ_DLG_CALC_H__ 27 27 #define __DML20_DISPLAY_RQ_DLG_CALC_H__ 28 28 29 - #include "../dml_common_defs.h" 30 29 #include "../display_rq_dlg_helpers.h" 31 30 32 31 struct display_mode_lib;
-1
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20v2.h
··· 26 26 #ifndef __DML20V2_DISPLAY_RQ_DLG_CALC_H__ 27 27 #define __DML20V2_DISPLAY_RQ_DLG_CALC_H__ 28 28 29 - #include "../dml_common_defs.h" 30 29 #include "../display_rq_dlg_helpers.h" 31 30 32 31 struct display_mode_lib;
+1 -1
drivers/gpu/drm/amd/display/dc/dml/dcn21/display_rq_dlg_calc_21.h
··· 26 26 #ifndef __DML21_DISPLAY_RQ_DLG_CALC_H__ 27 27 #define __DML21_DISPLAY_RQ_DLG_CALC_H__ 28 28 29 - #include "../dml_common_defs.h" 29 + #include "dm_services.h" 30 30 #include "../display_rq_dlg_helpers.h" 31 31 32 32 struct display_mode_lib;
+4 -2
drivers/gpu/drm/amd/display/dc/dml/display_mode_lib.h
··· 25 25 #ifndef __DISPLAY_MODE_LIB_H__ 26 26 #define __DISPLAY_MODE_LIB_H__ 27 27 28 - 29 - #include "dml_common_defs.h" 28 + #include "dm_services.h" 29 + #include "dc_features.h" 30 + #include "display_mode_structs.h" 31 + #include "display_mode_enums.h" 30 32 #include "display_mode_vba.h" 31 33 32 34 enum dml_project {
-2
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h
··· 27 27 #ifndef __DML2_DISPLAY_MODE_VBA_H__ 28 28 #define __DML2_DISPLAY_MODE_VBA_H__ 29 29 30 - #include "dml_common_defs.h" 31 - 32 30 struct display_mode_lib; 33 31 34 32 void ModeSupportAndSystemConfiguration(struct display_mode_lib *mode_lib);
-1
drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_helpers.h
··· 26 26 #ifndef __DISPLAY_RQ_DLG_HELPERS_H__ 27 27 #define __DISPLAY_RQ_DLG_HELPERS_H__ 28 28 29 - #include "dml_common_defs.h" 30 29 #include "display_mode_lib.h" 31 30 32 31 /* Function: Printer functions
-2
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.h
··· 26 26 #ifndef __DISPLAY_RQ_DLG_CALC_H__ 27 27 #define __DISPLAY_RQ_DLG_CALC_H__ 28 28 29 - #include "dml_common_defs.h" 30 - 31 29 struct display_mode_lib; 32 30 33 31 #include "display_rq_dlg_helpers.h"
-43
drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.c
··· 1 - /* 2 - * Copyright 2017 Advanced Micro Devices, Inc. 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice shall be included in 12 - * all copies or substantial portions of the Software. 13 - * 14 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 - * OTHER DEALINGS IN THE SOFTWARE. 21 - * 22 - * Authors: AMD 23 - * 24 - */ 25 - 26 - #include "dml_common_defs.h" 27 - #include "dcn_calc_math.h" 28 - 29 - #include "dml_inline_defs.h" 30 - 31 - double dml_round(double a) 32 - { 33 - double round_pt = 0.5; 34 - double ceil = dml_ceil(a, 1); 35 - double floor = dml_floor(a, 1); 36 - 37 - if (a - floor >= round_pt) 38 - return ceil; 39 - else 40 - return floor; 41 - } 42 - 43 -
-37
drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.h
··· 1 - /* 2 - * Copyright 2017 Advanced Micro Devices, Inc. 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice shall be included in 12 - * all copies or substantial portions of the Software. 13 - * 14 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 - * OTHER DEALINGS IN THE SOFTWARE. 21 - * 22 - * Authors: AMD 23 - * 24 - */ 25 - 26 - #ifndef __DC_COMMON_DEFS_H__ 27 - #define __DC_COMMON_DEFS_H__ 28 - 29 - #include "dm_services.h" 30 - #include "dc_features.h" 31 - #include "display_mode_structs.h" 32 - #include "display_mode_enums.h" 33 - 34 - 35 - double dml_round(double a); 36 - 37 - #endif /* __DC_COMMON_DEFS_H__ */
+13 -2
drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h
··· 26 26 #ifndef __DML_INLINE_DEFS_H__ 27 27 #define __DML_INLINE_DEFS_H__ 28 28 29 - #include "dml_common_defs.h" 30 29 #include "dcn_calc_math.h" 31 30 #include "dml_logger.h" 32 31 ··· 74 75 return (double) dcn_bw_floor2(a, granularity); 75 76 } 76 77 78 + static inline double dml_round(double a) 79 + { 80 + double round_pt = 0.5; 81 + double ceil = dml_ceil(a, 1); 82 + double floor = dml_floor(a, 1); 83 + 84 + if (a - floor >= round_pt) 85 + return ceil; 86 + else 87 + return floor; 88 + } 89 + 77 90 static inline int dml_log2(double x) 78 91 { 79 92 return dml_round((double)dcn_bw_log(x, 2)); ··· 123 112 124 113 static inline unsigned int dml_round_to_multiple(unsigned int num, 125 114 unsigned int multiple, 126 - bool up) 115 + unsigned char up) 127 116 { 128 117 unsigned int remainder; 129 118