Skip to content

Commit c73d05e

Browse files
committed
drm/amdgpu/display: fix CFLAGS setup for DCN30
Properly handle clang and older versions of gcc. Fixes: e77165b ("drm/amd/display: Add DCN3 blocks to Makefile") Acked-by: Nirmoy Das <nirmoy.das@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 898c730 commit c73d05e

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

  • drivers/gpu/drm/amd/display/dc/dcn30

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,21 @@ DCN30 = dcn30_init.o dcn30_hubbub.o dcn30_hubp.o dcn30_dpp.o dcn30_optc.o \
3131
dcn30_dio_link_encoder.o dcn30_resource.o
3232

3333

34-
CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -msse -mpreferred-stack-boundary=4
35-
34+
ifdef CONFIG_X86
3635
CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mhard-float -msse
36+
CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -msse
37+
endif
38+
39+
ifdef CONFIG_PPC64
40+
CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mhard-float -maltivec
41+
CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -maltivec
42+
endif
43+
44+
ifdef CONFIG_ARM64
45+
CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mgeneral-regs-only
46+
CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mgeneral-regs-only
47+
endif
48+
3749
ifdef CONFIG_CC_IS_GCC
3850
ifeq ($(call cc-ifversion, -lt, 0701, y), y)
3951
IS_OLD_GCC = 1
@@ -45,8 +57,10 @@ ifdef IS_OLD_GCC
4557
# GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
4658
# (8B stack alignment).
4759
CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o += -mpreferred-stack-boundary=4
60+
CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o += -mpreferred-stack-boundary=4
4861
else
4962
CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o += -msse2
63+
CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o += -msse2
5064
endif
5165

5266
AMD_DAL_DCN30 = $(addprefix $(AMDDALPATH)/dc/dcn30/,$(DCN30))

0 commit comments

Comments
 (0)