forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/gpu/drm/amd/display/dc/calcs/Makefile
....@@ -1,5 +1,6 @@
11 #
22 # Copyright 2017 Advanced Micro Devices, Inc.
3
+# Copyright 2019 Raptor Engineering, LLC
34 #
45 # Permission is hereby granted, free of charge, to any person obtaining a
56 # copy of this software and associated documentation files (the "Software"),
....@@ -24,25 +25,38 @@
2425 # It calculates Bandwidth and Watermarks values for HW programming
2526 #
2627
27
-ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
28
- cc_stack_align := -mpreferred-stack-boundary=4
29
-else ifneq ($(call cc-option, -mstack-alignment=16),)
30
- cc_stack_align := -mstack-alignment=16
28
+ifdef CONFIG_X86
29
+calcs_ccflags := -mhard-float -msse
3130 endif
3231
33
-calcs_ccflags := -mhard-float -msse $(cc_stack_align)
32
+ifdef CONFIG_PPC64
33
+calcs_ccflags := -mhard-float -maltivec
34
+endif
3435
35
-ifdef CONFIG_CC_IS_CLANG
36
+ifdef CONFIG_CC_IS_GCC
37
+ifeq ($(call cc-ifversion, -lt, 0701, y), y)
38
+IS_OLD_GCC = 1
39
+endif
40
+endif
41
+
42
+ifdef CONFIG_X86
43
+ifdef IS_OLD_GCC
44
+# Stack alignment mismatch, proceed with caution.
45
+# GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
46
+# (8B stack alignment).
47
+calcs_ccflags += -mpreferred-stack-boundary=4
48
+else
3649 calcs_ccflags += -msse2
3750 endif
51
+endif
3852
39
-CFLAGS_dcn_calcs.o := $(calcs_ccflags)
40
-CFLAGS_dcn_calc_auto.o := $(calcs_ccflags)
41
-CFLAGS_dcn_calc_math.o := $(calcs_ccflags) -Wno-tautological-compare
53
+CFLAGS_$(AMDDALPATH)/dc/calcs/dcn_calcs.o := $(calcs_ccflags)
54
+CFLAGS_$(AMDDALPATH)/dc/calcs/dcn_calc_auto.o := $(calcs_ccflags)
55
+CFLAGS_$(AMDDALPATH)/dc/calcs/dcn_calc_math.o := $(calcs_ccflags) -Wno-tautological-compare
4256
4357 BW_CALCS = dce_calcs.o bw_fixed.o custom_float.o
4458
45
-ifdef CONFIG_DRM_AMD_DC_DCN1_0
59
+ifdef CONFIG_DRM_AMD_DC_DCN
4660 BW_CALCS += dcn_calcs.o dcn_calc_math.o dcn_calc_auto.o
4761 endif
4862