at commit c03c1a14

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 ifneq ($(filter y,$(CONFIG_KASAN) $(CONFIG_KCSAN) $(CONFIG_UBSAN)),)
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 := 3072
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 subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dml2_0/dml21/inc/bounding_boxes/
56 subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dml2_0/dml21/src/dml2_utm_soc_bb/
57 subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dml2_0/dml21/src/dml2_cga/
58
59 # Add FPU flags to all dml2 files by default, remove NO_FPU flags.
60 # FPU flags step 1: Find all .c files in dal/dc/dml2_0 and it's subfolders
61
62 THIS_MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
63 DML2_ABS_PATH := $(patsubst %/,%,$(dir $(THIS_MAKEFILE_PATH)))
64
65 DML2_C_FILES := $(shell find $(DML2_ABS_PATH) -name '*.c')
66
67 # FPU flags step 2: Convert to .o and make paths relative to $(AMDDALPATH)/dc/dml2_0/
68 DML2_RELATIVE_O_FILES := $(patsubst $(DML2_ABS_PATH)/%,dc/dml2_0/%,$(patsubst %.c,%.o,$(DML2_C_FILES)))
69
70 # FPU flags step 3: Apply FPU flags to all .o files from dal/dc/dml2_0 and it's subfolders
71 $(foreach obj,$(DML2_RELATIVE_O_FILES),$(eval CFLAGS_$(AMDDALPATH)/$(obj) := $(dml2_ccflags)))
72 $(foreach obj,$(DML2_RELATIVE_O_FILES),$(eval CFLAGS_REMOVE_$(AMDDALPATH)/$(obj) := $(dml2_rcflags)))
73
74 # FPU flags step 4: Replace CFLAGS per file for files with additional flags beyond dml2_ccflags and dml2_rcflags
75 CFLAGS_$(AMDDALPATH)/dc/dml2_0/display_mode_core.o := $(dml2_ccflags) $(frame_warn_flag)
76 CFLAGS_$(AMDDALPATH)/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4_calcs.o := $(dml2_ccflags) $(frame_warn_flag)
77 CFLAGS_$(AMDDALPATH)/dc/dml2_0/dml21/src/dml2_core/dml2_core_utils.o := $(dml2_ccflags) $(frame_warn_flag)
78 CFLAGS_$(AMDDALPATH)/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_funcs_mode_programming.o := $(dml2_ccflags) $(frame_warn_flag)
79 CFLAGS_$(AMDDALPATH)/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_funcs_mode_support.o := $(dml2_ccflags) $(frame_warn_flag)
80 CFLAGS_$(AMDDALPATH)/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_mode_programming.o := $(dml2_ccflags) $(frame_warn_flag)
81 CFLAGS_$(AMDDALPATH)/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_mode_support.o := $(dml2_ccflags) $(frame_warn_flag)
82 CFLAGS_$(AMDDALPATH)/dc/dml2_0/dml2_wrapper.o := $(dml2_rcflags)
83 CFLAGS_$(AMDDALPATH)/dc/dml2_0/dml21/dml21_wrapper.o := $(dml2_rcflags)
84 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2_0/display_mode_core.o := $(dml2_rcflags)
85 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4_calcs.o := $(dml2_rcflags)
86 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2_0/dml21/src/dml2_core/dml2_core_utils.o := $(dml2_rcflags)
87 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_funcs_mode_programming.o := $(dml2_rcflags)
88 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_funcs_mode_support.o := $(dml2_rcflags)
89 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_mode_programming.o := $(dml2_rcflags)
90 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_mode_support.o := $(dml2_rcflags)
91 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2_0/dml2_wrapper.o := $(dml2_ccflags)
92 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2_0/dml21/dml21_wrapper.o := $(dml2_ccflags)
93
94 DML2 = display_mode_core.o display_mode_util.o dml2_wrapper_fpu.o dml2_wrapper.o \
95 dml2_utils.o dml2_policy.o dml2_translation_helper.o dml2_dc_resource_mgmt.o dml2_mall_phantom.o \
96 dml_display_rq_dlg_calc.o
97 DML2 += dml_frl_cap_chk.o
98
99 AMD_DAL_DML2 = $(addprefix $(AMDDALPATH)/dc/dml2_0/,$(DML2))
100
101 AMD_DISPLAY_FILES += $(AMD_DAL_DML2)
102
103
104 DML21 := src/dml2_top/dml2_top_interfaces.o
105 DML21 += src/dml2_top/dml2_top_soc15.o
106 DML21 += src/dml2_core/dml2_core_dcn4.o
107 DML21 += src/dml2_core/dml2_core_utils.o
108 DML21 += src/dml2_core/dml2_core_factory.o
109 DML21 += src/dml2_core/dml2_core_dcn4_calcs.o
110 DML21 += src/dml2_dpmm/dml2_dpmm_dcn4.o
111 DML21 += src/dml2_dpmm/dml2_dpmm_factory.o
112 DML21 += src/dml2_mcg/dml2_mcg_dcn4.o
113 DML21 += src/dml2_mcg/dml2_mcg_dcn42.o
114 DML21 += src/dml2_mcg/dml2_mcg_factory.o
115 DML21 += src/dml2_pmo/dml2_pmo_dcn3.o
116 DML21 += src/dml2_pmo/dml2_pmo_factory.o
117 DML21 += src/dml2_pmo/dml2_pmo_dcn4_fams2.o
118 DML21 += src/dml2_pmo/dml2_pmo_dcn42.o
119 DML21 += src/dml2_standalone_libraries/lib_float_math.o
120 DML21 += src/dml2_standalone_libraries/lib_frl_cap_check.o
121 DML21 += src/dml2_top/dml2_top_utm.o
122 DML21 += src/dml2_core/dml2_core_dcn5_calcs_dchub.o
123 DML21 += src/dml2_core/dml2_core_dcn5_calcs_display_pipe.o
124 DML21 += src/dml2_core/dml2_core_dcn5_calcs_dsc_latency.o
125 DML21 += src/dml2_core/dml2_core_dcn5_funcs_initialize.o
126 DML21 += src/dml2_core/dml2_core_dcn5_funcs_mode_programming.o
127 DML21 += src/dml2_core/dml2_core_dcn5_funcs_mode_support.o
128 DML21 += src/dml2_dpmm/dml2_dpmm_dcn5.o
129 DML21 += src/dml2_utm_soc_bb/dml2_utm_soc_bb_dcn5.o
130 DML21 += src/dml2_utm_soc_bb/dml2_utm_soc_bb_factory.o
131 DML21 += src/dml2_cga/dml2_cga_dcn6.o
132 DML21 += src/dml2_cga/dml2_cga_factory.o
133 DML21 += src/dml2_core/dml2_core_dcn6_calcs_dchub.o
134 DML21 += src/dml2_core/dml2_core_dcn6_funcs_initialize.o
135 DML21 += src/dml2_core/dml2_core_dcn6_funcs_mode_programming.o
136 DML21 += src/dml2_core/dml2_core_dcn6_funcs_mode_support.o
137 DML21 += src/dml2_pmo/dml2_pmo_dcn5.o
138 DML21 += src/dml2_pmo/dml2_pmo_dcn5_stage_optimizers.o
139 DML21 += src/dml2_pmo/dml2_pmo_dcn6.o
140 DML21 += src/dml2_pmo/dml2_pmo_dcn6_stage_optimizers.o
141 DML21 += src/dml2_standalone_libraries/alternate_pstate_shared_lib.o
142 DML21 += src/dml2_utm_soc_bb/dml2_utm_soc_bb_dcn6.o
143 DML21 += dml21_translation_helper.o
144 DML21 += dml21_wrapper.o
145 DML21 += dml21_wrapper_fpu.o
146 DML21 += dml21_utils.o
147
148 AMD_DAL_DML21 = $(addprefix $(AMDDALPATH)/dc/dml2_0/dml21/,$(DML21))
149
150 AMD_DISPLAY_FILES += $(AMD_DAL_DML21)