1061bfa06SHarry Wentland# 2e2874a3cSAlex Deucher# Copyright 2017 Advanced Micro Devices, Inc. 316a9dea1STimothy Pearson# Copyright 2019 Raptor Engineering, LLC 4e2874a3cSAlex Deucher# 5e2874a3cSAlex Deucher# Permission is hereby granted, free of charge, to any person obtaining a 6e2874a3cSAlex Deucher# copy of this software and associated documentation files (the "Software"), 7e2874a3cSAlex Deucher# to deal in the Software without restriction, including without limitation 8e2874a3cSAlex Deucher# the rights to use, copy, modify, merge, publish, distribute, sublicense, 9e2874a3cSAlex Deucher# and/or sell copies of the Software, and to permit persons to whom the 10e2874a3cSAlex Deucher# Software is furnished to do so, subject to the following conditions: 11e2874a3cSAlex Deucher# 12e2874a3cSAlex Deucher# The above copyright notice and this permission notice shall be included in 13e2874a3cSAlex Deucher# all copies or substantial portions of the Software. 14e2874a3cSAlex Deucher# 15e2874a3cSAlex Deucher# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16e2874a3cSAlex Deucher# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17e2874a3cSAlex Deucher# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18e2874a3cSAlex Deucher# THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 19e2874a3cSAlex Deucher# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20e2874a3cSAlex Deucher# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 21e2874a3cSAlex Deucher# OTHER DEALINGS IN THE SOFTWARE. 22e2874a3cSAlex Deucher# 23e2874a3cSAlex Deucher# 24061bfa06SHarry Wentland# Makefile for the 'utils' sub-component of DAL. 25061bfa06SHarry Wentland# It provides the general basic services required by other DAL 26061bfa06SHarry Wentland# subcomponents. 27061bfa06SHarry Wentland 2816a9dea1STimothy Pearsonifdef CONFIG_X86 297db038d9SNathan Chancellordml_ccflags-$(CONFIG_CC_IS_GCC) := -mhard-float 307db038d9SNathan Chancellordml_ccflags := $(dml_ccflags-y) -msse 3116a9dea1STimothy Pearsonendif 3216a9dea1STimothy Pearson 3316a9dea1STimothy Pearsonifdef CONFIG_PPC64 3416a9dea1STimothy Pearsondml_ccflags := -mhard-float -maltivec 3516a9dea1STimothy Pearsonendif 364769278eSMatthias Kaehlcke 3779b72db6SAo Zhongifdef CONFIG_ARM64 3879b72db6SAo Zhongdml_rcflags := -mgeneral-regs-only 3979b72db6SAo Zhongendif 4079b72db6SAo Zhong 419a06655eSHuacai Chenifdef CONFIG_LOONGARCH 429a06655eSHuacai Chendml_ccflags := -mfpu=64 439a06655eSHuacai Chendml_rcflags := -msoft-float 449a06655eSHuacai Chenendif 459a06655eSHuacai Chen 46c868868fSNick Desaulniersifdef CONFIG_CC_IS_GCC 4788b61e3bSNick Desaulniersifneq ($(call gcc-min-version, 70100),y) 4800db2971SNick DesaulniersIS_OLD_GCC = 1 4900db2971SNick Desaulniersendif 5000db2971SNick Desaulniersendif 5100db2971SNick Desaulniers 5216a9dea1STimothy Pearsonifdef CONFIG_X86 5300db2971SNick Desaulniersifdef IS_OLD_GCC 5400db2971SNick Desaulniers# Stack alignment mismatch, proceed with caution. 5500db2971SNick Desaulniers# GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3 5600db2971SNick Desaulniers# (8B stack alignment). 57c868868fSNick Desaulniersdml_ccflags += -mpreferred-stack-boundary=4 58e8a170ffSNick Desaulnierselse 590f0727d9SNick Desaulniersdml_ccflags += -msse2 600f0727d9SNick Desaulniersendif 6116a9dea1STimothy Pearsonendif 620f0727d9SNick Desaulniers 6325f178bbSReka Normanifneq ($(CONFIG_FRAME_WARN),0) 641695423cSAlex Deucherifeq ($(filter y,$(CONFIG_KASAN)$(CONFIG_KCSAN)),y) 651695423cSAlex Deucherframe_warn_flag := -Wframe-larger-than=3072 661695423cSAlex Deucherelse 6725f178bbSReka Normanframe_warn_flag := -Wframe-larger-than=2048 6825f178bbSReka Normanendif 691695423cSAlex Deucherendif 7025f178bbSReka Norman 7154b8ae66SMasahiro YamadaCFLAGS_$(AMDDALPATH)/dc/dml/display_mode_lib.o := $(dml_ccflags) 7254b8ae66SMasahiro YamadaCFLAGS_$(AMDDALPATH)/dc/dml/display_mode_vba.o := $(dml_ccflags) 736e6faf7aSMelissa WenCFLAGS_$(AMDDALPATH)/dc/dml/dcn10/dcn10_fpu.o := $(dml_ccflags) 74ee373411SQingqing ZhuoCFLAGS_$(AMDDALPATH)/dc/dml/dcn20/dcn20_fpu.o := $(dml_ccflags) 75*7fc395f0SNathan ChancellorCFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20.o := $(dml_ccflags) $(frame_warn_flag) 7654b8ae66SMasahiro YamadaCFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20.o := $(dml_ccflags) 77*7fc395f0SNathan ChancellorCFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20v2.o := $(dml_ccflags) $(frame_warn_flag) 78d7b0827fSLinus TorvaldsCFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20v2.o := $(dml_ccflags) 79*7fc395f0SNathan ChancellorCFLAGS_$(AMDDALPATH)/dc/dml/dcn21/display_mode_vba_21.o := $(dml_ccflags) $(frame_warn_flag) 80d7b0827fSLinus TorvaldsCFLAGS_$(AMDDALPATH)/dc/dml/dcn21/display_rq_dlg_calc_21.o := $(dml_ccflags) 8125f178bbSReka NormanCFLAGS_$(AMDDALPATH)/dc/dml/dcn30/display_mode_vba_30.o := $(dml_ccflags) $(frame_warn_flag) 82582e2ce5SAlex DeucherCFLAGS_$(AMDDALPATH)/dc/dml/dcn30/display_rq_dlg_calc_30.o := $(dml_ccflags) 8325f178bbSReka NormanCFLAGS_$(AMDDALPATH)/dc/dml/dcn31/display_mode_vba_31.o := $(dml_ccflags) $(frame_warn_flag) 8474458c08SNicholas KazlauskasCFLAGS_$(AMDDALPATH)/dc/dml/dcn31/display_rq_dlg_calc_31.o := $(dml_ccflags) 85af2f2a25SRodrigo SiqueiraCFLAGS_$(AMDDALPATH)/dc/dml/dcn314/display_mode_vba_314.o := $(dml_ccflags) $(frame_warn_flag) 86af2f2a25SRodrigo SiqueiraCFLAGS_$(AMDDALPATH)/dc/dml/dcn314/display_rq_dlg_calc_314.o := $(dml_ccflags) 874c3861f5SRodrigo SiqueiraCFLAGS_$(AMDDALPATH)/dc/dml/dcn314/dcn314_fpu.o := $(dml_ccflags) 88e4b0eac3SJasdeep DhillonCFLAGS_$(AMDDALPATH)/dc/dml/dcn30/dcn30_fpu.o := $(dml_ccflags) 89041a1109SRodrigo SiqueiraCFLAGS_$(AMDDALPATH)/dc/dml/dcn32/dcn32_fpu.o := $(dml_ccflags) 90dda4fb85SAurabindo PillaiCFLAGS_$(AMDDALPATH)/dc/dml/dcn32/display_mode_vba_32.o := $(dml_ccflags) $(frame_warn_flag) 91dda4fb85SAurabindo PillaiCFLAGS_$(AMDDALPATH)/dc/dml/dcn32/display_rq_dlg_calc_32.o := $(dml_ccflags) 9245950d88SGuenter RoeckCFLAGS_$(AMDDALPATH)/dc/dml/dcn32/display_mode_vba_util_32.o := $(dml_ccflags) $(frame_warn_flag) 93197485c6SRodrigo SiqueiraCFLAGS_$(AMDDALPATH)/dc/dml/dcn321/dcn321_fpu.o := $(dml_ccflags) 9426f4712aSMelissa WenCFLAGS_$(AMDDALPATH)/dc/dml/dcn31/dcn31_fpu.o := $(dml_ccflags) 9531484207SQingqing ZhuoCFLAGS_$(AMDDALPATH)/dc/dml/dcn301/dcn301_fpu.o := $(dml_ccflags) 96f369e4ebSJasdeep DhillonCFLAGS_$(AMDDALPATH)/dc/dml/dcn302/dcn302_fpu.o := $(dml_ccflags) 9753923e62SJasdeep DhillonCFLAGS_$(AMDDALPATH)/dc/dml/dcn303/dcn303_fpu.o := $(dml_ccflags) 98d738db68SQingqing ZhuoCFLAGS_$(AMDDALPATH)/dc/dml/dsc/rc_calc_fpu.o := $(dml_ccflags) 99552b7cb0SIsabella BassoCFLAGS_$(AMDDALPATH)/dc/dml/calcs/dcn_calcs.o := $(dml_ccflags) 100552b7cb0SIsabella BassoCFLAGS_$(AMDDALPATH)/dc/dml/calcs/dcn_calc_auto.o := $(dml_ccflags) 101552b7cb0SIsabella BassoCFLAGS_$(AMDDALPATH)/dc/dml/calcs/dcn_calc_math.o := $(dml_ccflags) -Wno-tautological-compare 102c38d444eSDaniel KolesaCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/display_mode_vba.o := $(dml_rcflags) 103c38d444eSDaniel KolesaCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20.o := $(dml_rcflags) 104c38d444eSDaniel KolesaCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20.o := $(dml_rcflags) 105c38d444eSDaniel KolesaCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20v2.o := $(dml_rcflags) 106c38d444eSDaniel KolesaCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20v2.o := $(dml_rcflags) 107c38d444eSDaniel KolesaCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn21/display_mode_vba_21.o := $(dml_rcflags) 108c38d444eSDaniel KolesaCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn21/display_rq_dlg_calc_21.o := $(dml_rcflags) 109582e2ce5SAlex DeucherCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn30/display_mode_vba_30.o := $(dml_rcflags) 110582e2ce5SAlex DeucherCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn30/display_rq_dlg_calc_30.o := $(dml_rcflags) 11174458c08SNicholas KazlauskasCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn31/display_mode_vba_31.o := $(dml_rcflags) 11274458c08SNicholas KazlauskasCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn31/display_rq_dlg_calc_31.o := $(dml_rcflags) 113dda4fb85SAurabindo PillaiCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn32/display_mode_vba_32.o := $(dml_rcflags) 114dda4fb85SAurabindo PillaiCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn32/display_rq_dlg_calc_32.o := $(dml_rcflags) 115dda4fb85SAurabindo PillaiCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn32/display_mode_vba_util_32.o := $(dml_rcflags) 11631484207SQingqing ZhuoCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn301/dcn301_fpu.o := $(dml_rcflags) 117582e2ce5SAlex DeucherCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/display_mode_lib.o := $(dml_rcflags) 118d738db68SQingqing ZhuoCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dsc/rc_calc_fpu.o := $(dml_rcflags) 11979b72db6SAo ZhongCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn10/dcn10_fpu.o := $(dml_rcflags) 12079b72db6SAo ZhongCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn20/dcn20_fpu.o := $(dml_rcflags) 12179b72db6SAo ZhongCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn314/display_mode_vba_314.o := $(dml_rcflags) 12279b72db6SAo ZhongCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn314/display_rq_dlg_calc_314.o := $(dml_rcflags) 12379b72db6SAo ZhongCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn314/dcn314_fpu.o := $(dml_rcflags) 12479b72db6SAo ZhongCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn30/dcn30_fpu.o := $(dml_rcflags) 12579b72db6SAo ZhongCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn32/dcn32_fpu.o := $(dml_rcflags) 12679b72db6SAo ZhongCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn321/dcn321_fpu.o := $(dml_rcflags) 12779b72db6SAo ZhongCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn31/dcn31_fpu.o := $(dml_rcflags) 12879b72db6SAo ZhongCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn302/dcn302_fpu.o := $(dml_rcflags) 12979b72db6SAo ZhongCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn303/dcn303_fpu.o := $(dml_rcflags) 13079b72db6SAo ZhongCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/calcs/dcn_calc_math.o := $(dml_rcflags) 13154b8ae66SMasahiro YamadaCFLAGS_$(AMDDALPATH)/dc/dml/dml1_display_rq_dlg_calc.o := $(dml_ccflags) 13254b8ae66SMasahiro YamadaCFLAGS_$(AMDDALPATH)/dc/dml/display_rq_dlg_helpers.o := $(dml_ccflags) 133c38d444eSDaniel KolesaCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dml1_display_rq_dlg_calc.o := $(dml_rcflags) 134c38d444eSDaniel KolesaCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/display_rq_dlg_helpers.o := $(dml_rcflags) 135552b7cb0SIsabella BassoCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/calcs/dcn_calcs.o := $(dml_rcflags) 136552b7cb0SIsabella BassoCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/calcs/dcn_calc_auto.o := $(dml_rcflags) 137552b7cb0SIsabella BassoCFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/calcs/dcn_calc_math.o := $(dml_rcflags) 138061bfa06SHarry Wentland 139552b7cb0SIsabella BassoDML = calcs/dce_calcs.o calcs/custom_float.o calcs/bw_fixed.o 140728c0698SHarry Wentland 1414652ae7aSHarry Wentlandifdef CONFIG_DRM_AMD_DC_FP 142552b7cb0SIsabella BassoDML += display_mode_lib.o display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o 1436e6faf7aSMelissa WenDML += dcn10/dcn10_fpu.o 144ee373411SQingqing ZhuoDML += dcn20/dcn20_fpu.o 145776c1f56SLeo LiDML += display_mode_vba.o dcn20/display_rq_dlg_calc_20.o dcn20/display_mode_vba_20.o 146057fc695SJun LeiDML += dcn20/display_rq_dlg_calc_20v2.o dcn20/display_mode_vba_20v2.o 147542816ffSRoman LiDML += dcn21/display_rq_dlg_calc_21.o dcn21/display_mode_vba_21.o 148e4b0eac3SJasdeep DhillonDML += dcn30/dcn30_fpu.o dcn30/display_mode_vba_30.o dcn30/display_rq_dlg_calc_30.o 14974458c08SNicholas KazlauskasDML += dcn31/display_mode_vba_31.o dcn31/display_rq_dlg_calc_31.o 150af2f2a25SRodrigo SiqueiraDML += dcn314/display_mode_vba_314.o dcn314/display_rq_dlg_calc_314.o 151dda4fb85SAurabindo PillaiDML += dcn32/display_mode_vba_32.o dcn32/display_rq_dlg_calc_32.o dcn32/display_mode_vba_util_32.o 15226f4712aSMelissa WenDML += dcn31/dcn31_fpu.o 153041a1109SRodrigo SiqueiraDML += dcn32/dcn32_fpu.o 154197485c6SRodrigo SiqueiraDML += dcn321/dcn321_fpu.o 15531484207SQingqing ZhuoDML += dcn301/dcn301_fpu.o 156f369e4ebSJasdeep DhillonDML += dcn302/dcn302_fpu.o 15753923e62SJasdeep DhillonDML += dcn303/dcn303_fpu.o 1584c3861f5SRodrigo SiqueiraDML += dcn314/dcn314_fpu.o 159d738db68SQingqing ZhuoDML += dsc/rc_calc_fpu.o 160552b7cb0SIsabella BassoDML += calcs/dcn_calcs.o calcs/dcn_calc_math.o calcs/dcn_calc_auto.o 16174458c08SNicholas Kazlauskasendif 162061bfa06SHarry Wentland 163061bfa06SHarry WentlandAMD_DAL_DML = $(addprefix $(AMDDALPATH)/dc/dml/,$(DML)) 164061bfa06SHarry Wentland 165061bfa06SHarry WentlandAMD_DISPLAY_FILES += $(AMD_DAL_DML) 166