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

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/display: Permit DC_FP_START/END only in non-FP compilation units

[WHAT]
Test the existing CPP macro _LINUX_FPU_COMPILATION_UNIT, which is set
when building source files that are permitted to use floating point,
in the implementation of DC_FP_START/END so that those are only usable
in non-FP code. This is a requirement of the generic kernel mode FPU
API, as some architectures (i.e., arm64) cannot safely enable FP codegen
in arbitrary code.

Cc: Austin Zheng <austin.zheng@amd.com>
Cc: Jun Lei <jun.lei@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Leo Li <sunpeng.li@amd.com>
Cc: Rodrigo Siqueira <siqueira@igalia.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org

Suggested-by: Christian König <christian.koenig@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Ard Biesheuvel and committed by
Alex Deucher
a574f53e 03fc4076

+8 -2
+8
drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.h
··· 31 31 void dc_fpu_begin(const char *function_name, const int line); 32 32 void dc_fpu_end(const char *function_name, const int line); 33 33 34 + #ifndef _LINUX_FPU_COMPILATION_UNIT 35 + #define DC_FP_START() dc_fpu_begin(__func__, __LINE__) 36 + #define DC_FP_END() dc_fpu_end(__func__, __LINE__) 37 + #else 38 + #define DC_FP_START() BUILD_BUG() 39 + #define DC_FP_END() BUILD_BUG() 40 + #endif 41 + 34 42 #endif /* __DC_FPU_H__ */
-2
drivers/gpu/drm/amd/display/dc/os_types.h
··· 55 55 56 56 #if defined(CONFIG_DRM_AMD_DC_FP) 57 57 #include "amdgpu_dm/dc_fpu.h" 58 - #define DC_FP_START() dc_fpu_begin(__func__, __LINE__) 59 - #define DC_FP_END() dc_fpu_end(__func__, __LINE__) 60 58 #endif /* CONFIG_DRM_AMD_DC_FP */ 61 59 62 60 /*