Commit a574f53e authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Alex Deucher
Browse files

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: default avatarChristian König <christian.koenig@amd.com>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Hung <alex.hung@amd.com>
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
Signed-off-by: default avatarAlex Hung <alex.hung@amd.com>
Tested-by: default avatarDan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 03fc4076
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -31,4 +31,12 @@ void dc_assert_fp_enabled(void);
void dc_fpu_begin(const char *function_name, const int line);
void dc_fpu_end(const char *function_name, const int line);

#ifndef _LINUX_FPU_COMPILATION_UNIT
#define DC_FP_START()	dc_fpu_begin(__func__, __LINE__)
#define DC_FP_END()	dc_fpu_end(__func__, __LINE__)
#else
#define DC_FP_START()	BUILD_BUG()
#define DC_FP_END()	BUILD_BUG()
#endif

#endif /* __DC_FPU_H__ */
+0 −2
Original line number Diff line number Diff line
@@ -55,8 +55,6 @@

#if defined(CONFIG_DRM_AMD_DC_FP)
#include "amdgpu_dm/dc_fpu.h"
#define DC_FP_START() dc_fpu_begin(__func__, __LINE__)
#define DC_FP_END() dc_fpu_end(__func__, __LINE__)
#endif /* CONFIG_DRM_AMD_DC_FP */

/*