.. | .. |
---|
1 | 1 | # |
---|
2 | 2 | # Copyright 2017 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"), |
---|
.. | .. |
---|
24 | 25 | # It calculates Bandwidth and Watermarks values for HW programming |
---|
25 | 26 | # |
---|
26 | 27 | |
---|
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 |
---|
31 | 30 | endif |
---|
32 | 31 | |
---|
33 | | -calcs_ccflags := -mhard-float -msse $(cc_stack_align) |
---|
| 32 | +ifdef CONFIG_PPC64 |
---|
| 33 | +calcs_ccflags := -mhard-float -maltivec |
---|
| 34 | +endif |
---|
34 | 35 | |
---|
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 |
---|
36 | 49 | calcs_ccflags += -msse2 |
---|
37 | 50 | endif |
---|
| 51 | +endif |
---|
38 | 52 | |
---|
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 |
---|
42 | 56 | |
---|
43 | 57 | BW_CALCS = dce_calcs.o bw_fixed.o custom_float.o |
---|
44 | 58 | |
---|
45 | | -ifdef CONFIG_DRM_AMD_DC_DCN1_0 |
---|
| 59 | +ifdef CONFIG_DRM_AMD_DC_DCN |
---|
46 | 60 | BW_CALCS += dcn_calcs.o dcn_calc_math.o dcn_calc_auto.o |
---|
47 | 61 | endif |
---|
48 | 62 | |
---|