Debian Codegraph @

drivers/gpu/drm/amd/display/dc/dml2_0/Makefile

raw symbols SCIP
1 # SPDX-License-Identifier: MIT */
2 #
3 # Copyright 2023 Advanced Micro Devices, Inc.
4 #
5 # Permission is hereby granted, free of charge, to any person obtaining a
6 # copy of this software and associated documentation files (the "Software"),
7 # to deal in the Software without restriction, including without limitation
8 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 # and/or sell copies of the Software, and to permit persons to whom the
10 # Software is furnished to do so, subject to the following conditions:
11 #
12 # The above copyright notice and this permission notice shall be included in
13 # all copies or substantial portions of the Software.
14 #
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 # THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 # OTHER DEALINGS IN THE SOFTWARE.
22 #
23 # Authors: AMD
24 #
25 # Makefile for dml2.
26
27 dml2_ccflags := $(CC_FLAGS_FPU)
28 dml2_rcflags := $(CC_FLAGS_NO_FPU)
29
30 ifneq ($(CONFIG_FRAME_WARN),0)
31 ifeq ($(filter y,$(CONFIG_KASAN)$(CONFIG_KCSAN)),y)
32 ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_COMPILE_TEST),yy)
33 frame_warn_limit := 4096
34 else
35 frame_warn_limit := 3072
36 endif
37 else
38 frame_warn_limit := 2056
39 endif
40
41 ifeq ($(call test-lt, $(CONFIG_FRAME_WARN), $(frame_warn_limit)),y)
42 frame_warn_flag := -Wframe-larger-than=$(frame_warn_limit)
43 endif
44 endif
45
46 subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dml2_0
47 subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dml2_0/dml21/src/dml2_core
48 subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dml2_0/dml21/src/dml2_mcg/
49 subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dml2_0/dml21/src/dml2_dpmm/
50 subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dml2_0/dml21/src/dml2_pmo/
51 subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dml2_0/dml21/src/dml2_standalone_libraries/
52 subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dml2_0/dml21/src/inc
53 subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dml2_0/dml21/inc
54 subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dml2_0/dml21/
55
56 # Add FPU flags to all dml2 files by default, remove NO_FPU flags.
57 # FPU flags step 1: Find all .c files in dal/dc/dml2_0 and it's subfolders
58 DML2_ABS_PATH := $(FULL_AMD_DISPLAY_PATH)/dc/dml2_0
59 DML2_C_FILES := $(shell find $(DML2_ABS_PATH) -name '*.c' -type f)
60
61 # FPU flags step 2: Convert to .o and make paths relative to $(AMDDALPATH)/dc/dml2_0/
62 DML2_RELATIVE_O_FILES := $(patsubst $(DML2_ABS_PATH)/%,dc/dml2_0/%,$(patsubst %.c,%.o,$(DML2_C_FILES)))
63
64 # FPU flags step 3: Apply FPU flags to all .o files from dal/dc/dml2_0 and it's subfolders
65 $(foreach obj,$(DML2_RELATIVE_O_FILES),$(eval CFLAGS_$(AMDDALPATH)/$(obj) := $(dml2_ccflags)))
66 $(foreach obj,$(DML2_RELATIVE_O_FILES),$(eval CFLAGS_REMOVE_$(AMDDALPATH)/$(obj) := $(dml2_rcflags)))
67
68 # FPU flags step 4: Replace CFLAGS per file for files with additional flags beyond dml2_ccflags and dml2_rcflags
69 CFLAGS_$(AMDDALPATH)/dc/dml2_0/display_mode_core.o := $(dml2_ccflags) $(frame_warn_flag)
70 CFLAGS_$(AMDDALPATH)/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4_calcs.o := $(dml2_ccflags) $(frame_warn_flag)
71 CFLAGS_$(AMDDALPATH)/dc/dml2_0/dml21/src/dml2_core/dml2_core_utils.o := $(dml2_ccflags) $(frame_warn_flag)
72 CFLAGS_$(AMDDALPATH)/dc/dml2_0/dml2_wrapper.o := $(dml2_rcflags)
73 CFLAGS_$(AMDDALPATH)/dc/dml2_0/dml21/dml21_wrapper.o := $(dml2_rcflags)
74 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2_0/display_mode_core.o := $(dml2_rcflags)
75 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4_calcs.o := $(dml2_rcflags)
76 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2_0/dml21/src/dml2_core/dml2_core_utils.o := $(dml2_rcflags)
77 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2_0/dml2_wrapper.o := $(dml2_ccflags)
78 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2_0/dml21/dml21_wrapper.o := $(dml2_ccflags)
79
80 DML2 = display_mode_core.o display_mode_util.o dml2_wrapper_fpu.o dml2_wrapper.o \
81 dml2_utils.o dml2_policy.o dml2_translation_helper.o dml2_dc_resource_mgmt.o dml2_mall_phantom.o \
82 dml_display_rq_dlg_calc.o
83
84 AMD_DAL_DML2 = $(addprefix $(AMDDALPATH)/dc/dml2_0/,$(DML2))
85
86 AMD_DISPLAY_FILES += $(AMD_DAL_DML2)
87
88
89 DML21 := src/dml2_top/dml2_top_interfaces.o
90 DML21 += src/dml2_top/dml2_top_soc15.o
91 DML21 += src/dml2_core/dml2_core_dcn4.o
92 DML21 += src/dml2_core/dml2_core_utils.o
93 DML21 += src/dml2_core/dml2_core_factory.o
94 DML21 += src/dml2_core/dml2_core_dcn4_calcs.o
95 DML21 += src/dml2_dpmm/dml2_dpmm_dcn4.o
96 DML21 += src/dml2_dpmm/dml2_dpmm_factory.o
97 DML21 += src/dml2_mcg/dml2_mcg_dcn4.o
98 DML21 += src/dml2_mcg/dml2_mcg_dcn42.o
99 DML21 += src/dml2_mcg/dml2_mcg_factory.o
100 DML21 += src/dml2_pmo/dml2_pmo_dcn3.o
101 DML21 += src/dml2_pmo/dml2_pmo_factory.o
102 DML21 += src/dml2_pmo/dml2_pmo_dcn4_fams2.o
103 DML21 += src/dml2_pmo/dml2_pmo_dcn42.o
104 DML21 += src/dml2_standalone_libraries/lib_float_math.o
105 DML21 += dml21_translation_helper.o
106 DML21 += dml21_wrapper.o
107 DML21 += dml21_wrapper_fpu.o
108 DML21 += dml21_utils.o
109
110 AMD_DAL_DML21 = $(addprefix $(AMDDALPATH)/dc/dml2_0/dml21/,$(DML21))
111
112 AMD_DISPLAY_FILES += $(AMD_DAL_DML21)