Skip to contentSkip to conversation

drm/amdgpu/display: make FP handling in Makefiles consistent

PATCH In review Alex Deucher 3 participants 8 messages Jun 10, 2022 – Jun 15, 2022

Subsystems (4)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu/display: make FP handling in Makefiles consistent

Use the same pattern as the DML Makefile and while we are here add a missing x86 guard around the msse flags for DCN3.2.x.

---
 drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile | 3 +--
 drivers/gpu/drm/amd/display/dc/dcn201/Makefile  | 1 -
 drivers/gpu/drm/amd/display/dc/dcn30/Makefile   | 6 ++----
 drivers/gpu/drm/amd/display/dc/dcn302/Makefile  | 8 +++++++-
 drivers/gpu/drm/amd/display/dc/dcn32/Makefile   | 5 +++--
 drivers/gpu/drm/amd/display/dc/dcn321/Makefile  | 5 +++--
 6 files changed, 16 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile +1 -2
index c935c10b5f4f..7b505e1e9308 100644
@@ -180,7 +180,7 @@ CLK_MGR_DCN32 = dcn32_clk_mgr.o dcn32_clk_mgr_smu_msg.o
 AMD_DAL_CLK_MGR_DCN32 = $(addprefix $(AMDDALPATH)/dc/clk_mgr/dcn32/,$(CLK_MGR_DCN32))
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -mhard-float -msse
 endif
 
 ifdef CONFIG_PPC64
@@ -191,7 +191,6 @@ ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
 endif
-CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -mhard-float
 endif
 
 ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn201/Makefile +0 -1
index f68038ceb1b1..96cbd4ccd344 100644
@@ -18,7 +18,6 @@ ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
 endif
-CFLAGS_$(AMDDALPATH)/dc/dcn201/dcn201_resource.o += -mhard-float
 endif
 
 ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn30/Makefile +2 -4
index dfd77b3cc84d..c20331eb62e0 100644
@@ -32,8 +32,8 @@ DCN30 = dcn30_init.o dcn30_hubbub.o dcn30_hubp.o dcn30_dpp.o dcn30_optc.o \
 
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -msse
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mhard-float -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -msse
 endif
 
 ifdef CONFIG_PPC64
@@ -45,8 +45,6 @@ ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
 endif
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o += -mhard-float
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o += -mhard-float
 endif
 
 ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn302/Makefile +7 -1
index f9561d7f97a1..e4b69ad0dde5 100644
@@ -8,7 +8,7 @@
 DCN3_02 = dcn302_init.o dcn302_hwseq.o dcn302_resource.o
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -msse
 endif
 
 ifdef CONFIG_PPC64
@@ -16,6 +16,12 @@ CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -maltivec
 endif
 
 ifdef CONFIG_X86
+ifdef CONFIG_CC_IS_GCC
+ifeq ($(call cc-ifversion, -lt, 0701, y), y)
+IS_OLD_GCC = 1
+endif
+endif
+
 ifdef IS_OLD_GCC
 # Stack alignment mismatch, proceed with caution.
 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +3 -2
index 3d09db3070f4..34f2e37b6704 100644
@@ -16,7 +16,7 @@ DCN32 = dcn32_resource.o dcn32_hubbub.o dcn32_hwseq.o dcn32_init.o \
 		dcn32_mpc.o
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -mhard-float -msse
 endif
 
 ifdef CONFIG_PPC64
@@ -27,9 +27,9 @@ ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
 endif
-CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -mhard-float
 endif
 
+ifdef CONFIG_X86
 ifdef IS_OLD_GCC
 # Stack alignment mismatch, proceed with caution.
 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
@@ -38,6 +38,7 @@ CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -mpreferred-stack-boundary=4
 else
 CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -msse2
 endif
+endif
 
 AMD_DAL_DCN32 = $(addprefix $(AMDDALPATH)/dc/dcn32/,$(DCN32))
 
drivers/gpu/drm/amd/display/dc/dcn321/Makefile +3 -2
index 5896ca303e39..e554fd6c16f2 100644
@@ -13,7 +13,7 @@
 DCN321 = dcn321_resource.o dcn321_dio_link_encoder.o
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -mhard-float -msse
 endif
 
 ifdef CONFIG_PPC64
@@ -24,9 +24,9 @@ ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
 endif
-CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -mhard-float
 endif
 
+ifdef CONFIG_X86
 ifdef IS_OLD_GCC
 # Stack alignment mismatch, proceed with caution.
 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
@@ -35,6 +35,7 @@ CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -mpreferred-stack-boundary=4
 else
 CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -msse2
 endif
+endif
 
 AMD_DAL_DCN321 = $(addprefix $(AMDDALPATH)/dc/dcn321/,$(DCN321))
 
Signature · 1 line
2.35.3
author maintainer
#1 lore raw

PATCH 1/1 drm/amdkfd: fix warning when CONFIG_HSA_AMD_P2P is not set

drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c:1542:11:
warning: variable 'i' set but not used [-Wunused-but-set-variable]

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c   | 4 ++++
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 7 +++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +4 -0
index aebc384531ac..88a0e3ac0f33 100644
@@ -773,6 +773,10 @@ void amdgpu_gmc_init_pdb0(struct amdgpu_device *adev)
  */
 uint64_t amdgpu_gmc_vram_mc2pa(struct amdgpu_device *adev, uint64_t mc_addr)
 {
+	dev_info(adev->dev, "amdgpu_gmc_vram_mc2pa: 0x%0llx, 0x%0llx, 0x%0llx\n",
+		 mc_addr,
+		 adev->gmc.vram_start,
+		 adev->vm_manager.vram_base_offset);
 	return mc_addr - adev->gmc.vram_start + adev->vm_manager.vram_base_offset;
 }
 
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +5 -2
index 3e240b22ec91..411447357196 100644
@@ -1539,7 +1539,10 @@ static int kfd_dev_create_p2p_links(void)
 {
 	struct kfd_topology_device *dev;
 	struct kfd_topology_device *new_dev;
-	uint32_t i, k;
+#if defined(CONFIG_HSA_AMD_P2P)
+	uint32_t i;
+#endif
+	uint32_t k;
 	int ret = 0;
 
 	k = 0;
@@ -1553,7 +1556,6 @@ static int kfd_dev_create_p2p_links(void)
 		return 0;
 
 	k--;
-	i = 0;
 
 	/* create in-direct links */
 	ret = kfd_create_indirect_link_prop(new_dev, k);
@@ -1562,6 +1564,7 @@ static int kfd_dev_create_p2p_links(void)
 
 	/* create p2p links */
 #if defined(CONFIG_HSA_AMD_P2P)
+	i = 0;
 	list_for_each_entry(dev, &topology_device_list, list) {
 		if (dev == new_dev)
 			break;
Signature · 1 line
2.35.3
#2 lore raw

Re: [PATCH] drm/amdkfd: fix warning when CONFIG_HSA_AMD_P2P is not set

Quoted 16 lines · Alex Deucher

drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c:1542:11:
warning: variable 'i' set but not used [-Wunused-but-set-variable]

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c   | 4 ++++
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 7 +++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -0
index aebc384531ac..88a0e3ac0f33 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c void amdgpu_gmc_init_pdb0(struct amdgpu_device *adev) · line 781

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +4 -0
@@ -773,6 +773,10 @@ void amdgpu_gmc_init_pdb0(struct amdgpu_device *adev)
  */
 uint64_t amdgpu_gmc_vram_mc2pa(struct amdgpu_device *adev, uint64_t mc_addr)
 {
+       dev_info(adev->dev, "amdgpu_gmc_vram_mc2pa: 0x%0llx, 0x%0llx, 0x%0llx\n",
+                mc_addr,
+                adev->gmc.vram_start,
+                adev->vm_manager.vram_base_offset);
        return mc_addr - adev->gmc.vram_start + adev->vm_manager.vram_base_offset;
 }

Ignore this hunk. Didn't mean to commit this.

Alex

Quoted 36 lines
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +5 -3
index 3e240b22ec91..411447357196 100644
@@ -1539,7 +1539,10 @@ static int kfd_dev_create_p2p_links(void)
 {
        struct kfd_topology_device *dev;
        struct kfd_topology_device *new_dev;
-       uint32_t i, k;
+#if defined(CONFIG_HSA_AMD_P2P)
+       uint32_t i;
+#endif
+       uint32_t k;
        int ret = 0;
 
        k = 0;
@@ -1553,7 +1556,6 @@ static int kfd_dev_create_p2p_links(void)
                return 0;
 
        k--;
-       i = 0;
 
        /* create in-direct links */
        ret = kfd_create_indirect_link_prop(new_dev, k);
@@ -1562,6 +1564,7 @@ static int kfd_dev_create_p2p_links(void)
 
        /* create p2p links */
 #if defined(CONFIG_HSA_AMD_P2P)
+       i = 0;
        list_for_each_entry(dev, &topology_device_list, list) {
                if (dev == new_dev)
                        break;
--

2.35.3

#3 lore raw
In reply to Alex Deucher

Am 10.06.22 um 17:42 schrieb Alex Deucher:

Quoted 2 lines

Use the same pattern as the DML Makefile and while we are here add a missing x86 guard around the msse flags for DCN3.2.x.

IIRC the idea was to limit the whole float handling to the DML and remove it from the rest of the code.

But not sure if that's already completed yet.

Christian.

Quoted 158 lines
---
  drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile | 3 +--
  drivers/gpu/drm/amd/display/dc/dcn201/Makefile  | 1 -
  drivers/gpu/drm/amd/display/dc/dcn30/Makefile   | 6 ++----
  drivers/gpu/drm/amd/display/dc/dcn302/Makefile  | 8 +++++++-
  drivers/gpu/drm/amd/display/dc/dcn32/Makefile   | 5 +++--
  drivers/gpu/drm/amd/display/dc/dcn321/Makefile  | 5 +++--
  6 files changed, 16 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile +1 -2
index c935c10b5f4f..7b505e1e9308 100644
@@ -180,7 +180,7 @@ CLK_MGR_DCN32 = dcn32_clk_mgr.o dcn32_clk_mgr_smu_msg.o
  AMD_DAL_CLK_MGR_DCN32 = $(addprefix $(AMDDALPATH)/dc/clk_mgr/dcn32/,$(CLK_MGR_DCN32))
 
  ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -mhard-float -msse
  endif
 
  ifdef CONFIG_PPC64
@@ -191,7 +191,6 @@ ifdef CONFIG_CC_IS_GCC
  ifeq ($(call cc-ifversion, -lt, 0701, y), y)
  IS_OLD_GCC = 1
  endif
-CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -mhard-float
  endif
 
  ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn201/Makefile +0 -1
index f68038ceb1b1..96cbd4ccd344 100644
@@ -18,7 +18,6 @@ ifdef CONFIG_CC_IS_GCC
  ifeq ($(call cc-ifversion, -lt, 0701, y), y)
  IS_OLD_GCC = 1
  endif
-CFLAGS_$(AMDDALPATH)/dc/dcn201/dcn201_resource.o += -mhard-float
  endif
 
  ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn30/Makefile +2 -4
index dfd77b3cc84d..c20331eb62e0 100644
@@ -32,8 +32,8 @@ DCN30 = dcn30_init.o dcn30_hubbub.o dcn30_hubp.o dcn30_dpp.o dcn30_optc.o \
 
 
  ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -msse
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mhard-float -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -msse
  endif
 
  ifdef CONFIG_PPC64
@@ -45,8 +45,6 @@ ifdef CONFIG_CC_IS_GCC
  ifeq ($(call cc-ifversion, -lt, 0701, y), y)
  IS_OLD_GCC = 1
  endif
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o += -mhard-float
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o += -mhard-float
  endif
 
  ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn302/Makefile +7 -1
index f9561d7f97a1..e4b69ad0dde5 100644
@@ -8,7 +8,7 @@
  DCN3_02 = dcn302_init.o dcn302_hwseq.o dcn302_resource.o
 
  ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -msse
  endif
 
  ifdef CONFIG_PPC64
@@ -16,6 +16,12 @@ CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -maltivec
  endif
 
  ifdef CONFIG_X86
+ifdef CONFIG_CC_IS_GCC
+ifeq ($(call cc-ifversion, -lt, 0701, y), y)
+IS_OLD_GCC = 1
+endif
+endif
+
  ifdef IS_OLD_GCC
  # Stack alignment mismatch, proceed with caution.
  # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +3 -2
index 3d09db3070f4..34f2e37b6704 100644
@@ -16,7 +16,7 @@ DCN32 = dcn32_resource.o dcn32_hubbub.o dcn32_hwseq.o dcn32_init.o \
  		dcn32_mpc.o
 
  ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -mhard-float -msse
  endif
 
  ifdef CONFIG_PPC64
@@ -27,9 +27,9 @@ ifdef CONFIG_CC_IS_GCC
  ifeq ($(call cc-ifversion, -lt, 0701, y), y)
  IS_OLD_GCC = 1
  endif
-CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -mhard-float
  endif
 
+ifdef CONFIG_X86
  ifdef IS_OLD_GCC
  # Stack alignment mismatch, proceed with caution.
  # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
@@ -38,6 +38,7 @@ CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -mpreferred-stack-boundary=4
  else
  CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -msse2
  endif
+endif
 
  AMD_DAL_DCN32 = $(addprefix $(AMDDALPATH)/dc/dcn32/,$(DCN32))
 
drivers/gpu/drm/amd/display/dc/dcn321/Makefile +3 -2
index 5896ca303e39..e554fd6c16f2 100644
@@ -13,7 +13,7 @@
  DCN321 = dcn321_resource.o dcn321_dio_link_encoder.o
 
  ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -mhard-float -msse
  endif
 
  ifdef CONFIG_PPC64
@@ -24,9 +24,9 @@ ifdef CONFIG_CC_IS_GCC
  ifeq ($(call cc-ifversion, -lt, 0701, y), y)
  IS_OLD_GCC = 1
  endif
-CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -mhard-float
  endif
 
+ifdef CONFIG_X86
  ifdef IS_OLD_GCC
  # Stack alignment mismatch, proceed with caution.
  # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
@@ -35,6 +35,7 @@ CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -mpreferred-stack-boundary=4
  else
  CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -msse2
  endif
+endif
 
  AMD_DAL_DCN321 = $(addprefix $(AMDDALPATH)/dc/dcn321/,$(DCN321))
 
#4 lore raw
Quoted 9 lines · Christian König

Am 10.06.22 um 17:42 schrieb Alex Deucher:

Quoted 2 lines

Use the same pattern as the DML Makefile and while we are here add a missing x86 guard around the msse flags for DCN3.2.x.

IIRC the idea was to limit the whole float handling to the DML and remove it from the rest of the code.

But not sure if that's already completed yet.

Yeah, that is the end goal, but it's not complete yet.

Alex

Quoted 162 lines

Christian.

Quoted 158 lines
---
  drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile | 3 +--
  drivers/gpu/drm/amd/display/dc/dcn201/Makefile  | 1 -
  drivers/gpu/drm/amd/display/dc/dcn30/Makefile   | 6 ++----
  drivers/gpu/drm/amd/display/dc/dcn302/Makefile  | 8 +++++++-
  drivers/gpu/drm/amd/display/dc/dcn32/Makefile   | 5 +++--
  drivers/gpu/drm/amd/display/dc/dcn321/Makefile  | 5 +++--
  6 files changed, 16 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile +1 -2
index c935c10b5f4f..7b505e1e9308 100644
@@ -180,7 +180,7 @@ CLK_MGR_DCN32 = dcn32_clk_mgr.o dcn32_clk_mgr_smu_msg.o
  AMD_DAL_CLK_MGR_DCN32 = $(addprefix $(AMDDALPATH)/dc/clk_mgr/dcn32/,$(CLK_MGR_DCN32))
 
  ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -mhard-float -msse
  endif
 
  ifdef CONFIG_PPC64
@@ -191,7 +191,6 @@ ifdef CONFIG_CC_IS_GCC
  ifeq ($(call cc-ifversion, -lt, 0701, y), y)
  IS_OLD_GCC = 1
  endif
-CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -mhard-float
  endif
 
  ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn201/Makefile +0 -1
index f68038ceb1b1..96cbd4ccd344 100644
@@ -18,7 +18,6 @@ ifdef CONFIG_CC_IS_GCC
  ifeq ($(call cc-ifversion, -lt, 0701, y), y)
  IS_OLD_GCC = 1
  endif
-CFLAGS_$(AMDDALPATH)/dc/dcn201/dcn201_resource.o += -mhard-float
  endif
 
  ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn30/Makefile +2 -4
index dfd77b3cc84d..c20331eb62e0 100644
@@ -32,8 +32,8 @@ DCN30 = dcn30_init.o dcn30_hubbub.o dcn30_hubp.o dcn30_dpp.o dcn30_optc.o \
 
 
  ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -msse
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mhard-float -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -msse
  endif
 
  ifdef CONFIG_PPC64
@@ -45,8 +45,6 @@ ifdef CONFIG_CC_IS_GCC
  ifeq ($(call cc-ifversion, -lt, 0701, y), y)
  IS_OLD_GCC = 1
  endif
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o += -mhard-float
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o += -mhard-float
  endif
 
  ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn302/Makefile +7 -1
index f9561d7f97a1..e4b69ad0dde5 100644
@@ -8,7 +8,7 @@
  DCN3_02 = dcn302_init.o dcn302_hwseq.o dcn302_resource.o
 
  ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -msse
  endif
 
  ifdef CONFIG_PPC64
@@ -16,6 +16,12 @@ CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -maltivec
  endif
 
  ifdef CONFIG_X86
+ifdef CONFIG_CC_IS_GCC
+ifeq ($(call cc-ifversion, -lt, 0701, y), y)
+IS_OLD_GCC = 1
+endif
+endif
+
  ifdef IS_OLD_GCC
  # Stack alignment mismatch, proceed with caution.
  # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +3 -2
index 3d09db3070f4..34f2e37b6704 100644
@@ -16,7 +16,7 @@ DCN32 = dcn32_resource.o dcn32_hubbub.o dcn32_hwseq.o dcn32_init.o \
              dcn32_mpc.o
 
  ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -mhard-float -msse
  endif
 
  ifdef CONFIG_PPC64
@@ -27,9 +27,9 @@ ifdef CONFIG_CC_IS_GCC
  ifeq ($(call cc-ifversion, -lt, 0701, y), y)
  IS_OLD_GCC = 1
  endif
-CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -mhard-float
  endif
 
+ifdef CONFIG_X86
  ifdef IS_OLD_GCC
  # Stack alignment mismatch, proceed with caution.
  # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
@@ -38,6 +38,7 @@ CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -mpreferred-stack-boundary=4
  else
  CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -msse2
  endif
+endif
 
  AMD_DAL_DCN32 = $(addprefix $(AMDDALPATH)/dc/dcn32/,$(DCN32))
 
drivers/gpu/drm/amd/display/dc/dcn321/Makefile +3 -2
index 5896ca303e39..e554fd6c16f2 100644
@@ -13,7 +13,7 @@
  DCN321 = dcn321_resource.o dcn321_dio_link_encoder.o
 
  ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -mhard-float -msse
  endif
 
  ifdef CONFIG_PPC64
@@ -24,9 +24,9 @@ ifdef CONFIG_CC_IS_GCC
  ifeq ($(call cc-ifversion, -lt, 0701, y), y)
  IS_OLD_GCC = 1
  endif
-CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -mhard-float
  endif
 
+ifdef CONFIG_X86
  ifdef IS_OLD_GCC
  # Stack alignment mismatch, proceed with caution.
  # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
@@ -35,6 +35,7 @@ CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -mpreferred-stack-boundary=4
  else
  CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -msse2
  endif
+endif
 
  AMD_DAL_DCN321 = $(addprefix $(AMDDALPATH)/dc/dcn321/,$(DCN321))
 
#5 lore raw
In reply to Alex Deucher

Ping?

Quoted 164 lines · Alex Deucher

Use the same pattern as the DML Makefile and while we are here add a missing x86 guard around the msse flags for DCN3.2.x.

---
 drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile | 3 +--
 drivers/gpu/drm/amd/display/dc/dcn201/Makefile  | 1 -
 drivers/gpu/drm/amd/display/dc/dcn30/Makefile   | 6 ++----
 drivers/gpu/drm/amd/display/dc/dcn302/Makefile  | 8 +++++++-
 drivers/gpu/drm/amd/display/dc/dcn32/Makefile   | 5 +++--
 drivers/gpu/drm/amd/display/dc/dcn321/Makefile  | 5 +++--
 6 files changed, 16 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile +1 -2
index c935c10b5f4f..7b505e1e9308 100644
@@ -180,7 +180,7 @@ CLK_MGR_DCN32 = dcn32_clk_mgr.o dcn32_clk_mgr_smu_msg.o
 AMD_DAL_CLK_MGR_DCN32 = $(addprefix $(AMDDALPATH)/dc/clk_mgr/dcn32/,$(CLK_MGR_DCN32))
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -mhard-float -msse
 endif
 
 ifdef CONFIG_PPC64
@@ -191,7 +191,6 @@ ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
 endif
-CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -mhard-float
 endif
 
 ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn201/Makefile +0 -1
index f68038ceb1b1..96cbd4ccd344 100644
@@ -18,7 +18,6 @@ ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
 endif
-CFLAGS_$(AMDDALPATH)/dc/dcn201/dcn201_resource.o += -mhard-float
 endif
 
 ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn30/Makefile +2 -4
index dfd77b3cc84d..c20331eb62e0 100644
@@ -32,8 +32,8 @@ DCN30 = dcn30_init.o dcn30_hubbub.o dcn30_hubp.o dcn30_dpp.o dcn30_optc.o \
 
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -msse
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mhard-float -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -msse
 endif
 
 ifdef CONFIG_PPC64
@@ -45,8 +45,6 @@ ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
 endif
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o += -mhard-float
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o += -mhard-float
 endif
 
 ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn302/Makefile +7 -1
index f9561d7f97a1..e4b69ad0dde5 100644
@@ -8,7 +8,7 @@
 DCN3_02 = dcn302_init.o dcn302_hwseq.o dcn302_resource.o
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -msse
 endif
 
 ifdef CONFIG_PPC64
@@ -16,6 +16,12 @@ CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -maltivec
 endif
 
 ifdef CONFIG_X86
+ifdef CONFIG_CC_IS_GCC
+ifeq ($(call cc-ifversion, -lt, 0701, y), y)
+IS_OLD_GCC = 1
+endif
+endif
+
 ifdef IS_OLD_GCC
 # Stack alignment mismatch, proceed with caution.
 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +3 -2
index 3d09db3070f4..34f2e37b6704 100644
@@ -16,7 +16,7 @@ DCN32 = dcn32_resource.o dcn32_hubbub.o dcn32_hwseq.o dcn32_init.o \
                dcn32_mpc.o
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -mhard-float -msse
 endif
 
 ifdef CONFIG_PPC64
@@ -27,9 +27,9 @@ ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
 endif
-CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -mhard-float
 endif
 
+ifdef CONFIG_X86
 ifdef IS_OLD_GCC
 # Stack alignment mismatch, proceed with caution.
 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
@@ -38,6 +38,7 @@ CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -mpreferred-stack-boundary=4
 else
 CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -msse2
 endif
+endif
 
 AMD_DAL_DCN32 = $(addprefix $(AMDDALPATH)/dc/dcn32/,$(DCN32))
 
drivers/gpu/drm/amd/display/dc/dcn321/Makefile +3 -3
index 5896ca303e39..e554fd6c16f2 100644
@@ -13,7 +13,7 @@
 DCN321 = dcn321_resource.o dcn321_dio_link_encoder.o
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -mhard-float -msse
 endif
 
 ifdef CONFIG_PPC64
@@ -24,9 +24,9 @@ ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
 endif
-CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -mhard-float
 endif
 
+ifdef CONFIG_X86
 ifdef IS_OLD_GCC
 # Stack alignment mismatch, proceed with caution.
 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
@@ -35,6 +35,7 @@ CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -mpreferred-stack-boundary=4
 else
 CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -msse2
 endif
+endif
 
 AMD_DAL_DCN321 = $(addprefix $(AMDDALPATH)/dc/dcn321/,$(DCN321))
 
--

2.35.3

#6 lore raw

Anyone? This fixes the build on non-x86.

Alex

Quoted 168 lines · Alex Deucher

Ping?

Quoted 164 lines · Alex Deucher

Use the same pattern as the DML Makefile and while we are here add a missing x86 guard around the msse flags for DCN3.2.x.

---
 drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile | 3 +--
 drivers/gpu/drm/amd/display/dc/dcn201/Makefile  | 1 -
 drivers/gpu/drm/amd/display/dc/dcn30/Makefile   | 6 ++----
 drivers/gpu/drm/amd/display/dc/dcn302/Makefile  | 8 +++++++-
 drivers/gpu/drm/amd/display/dc/dcn32/Makefile   | 5 +++--
 drivers/gpu/drm/amd/display/dc/dcn321/Makefile  | 5 +++--
 6 files changed, 16 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile +1 -2
index c935c10b5f4f..7b505e1e9308 100644
@@ -180,7 +180,7 @@ CLK_MGR_DCN32 = dcn32_clk_mgr.o dcn32_clk_mgr_smu_msg.o
 AMD_DAL_CLK_MGR_DCN32 = $(addprefix $(AMDDALPATH)/dc/clk_mgr/dcn32/,$(CLK_MGR_DCN32))
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -mhard-float -msse
 endif
 
 ifdef CONFIG_PPC64
@@ -191,7 +191,6 @@ ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
 endif
-CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -mhard-float
 endif
 
 ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn201/Makefile +0 -1
index f68038ceb1b1..96cbd4ccd344 100644
@@ -18,7 +18,6 @@ ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
 endif
-CFLAGS_$(AMDDALPATH)/dc/dcn201/dcn201_resource.o += -mhard-float
 endif
 
 ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn30/Makefile +2 -4
index dfd77b3cc84d..c20331eb62e0 100644
@@ -32,8 +32,8 @@ DCN30 = dcn30_init.o dcn30_hubbub.o dcn30_hubp.o dcn30_dpp.o dcn30_optc.o \
 
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -msse
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mhard-float -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -msse
 endif
 
 ifdef CONFIG_PPC64
@@ -45,8 +45,6 @@ ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
 endif
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o += -mhard-float
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o += -mhard-float
 endif
 
 ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn302/Makefile +7 -1
index f9561d7f97a1..e4b69ad0dde5 100644
@@ -8,7 +8,7 @@
 DCN3_02 = dcn302_init.o dcn302_hwseq.o dcn302_resource.o
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -msse
 endif
 
 ifdef CONFIG_PPC64
@@ -16,6 +16,12 @@ CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -maltivec
 endif
 
 ifdef CONFIG_X86
+ifdef CONFIG_CC_IS_GCC
+ifeq ($(call cc-ifversion, -lt, 0701, y), y)
+IS_OLD_GCC = 1
+endif
+endif
+
 ifdef IS_OLD_GCC
 # Stack alignment mismatch, proceed with caution.
 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +3 -2
index 3d09db3070f4..34f2e37b6704 100644
@@ -16,7 +16,7 @@ DCN32 = dcn32_resource.o dcn32_hubbub.o dcn32_hwseq.o dcn32_init.o \
                dcn32_mpc.o
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -mhard-float -msse
 endif
 
 ifdef CONFIG_PPC64
@@ -27,9 +27,9 @@ ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
 endif
-CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -mhard-float
 endif
 
+ifdef CONFIG_X86
 ifdef IS_OLD_GCC
 # Stack alignment mismatch, proceed with caution.
 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
@@ -38,6 +38,7 @@ CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -mpreferred-stack-boundary=4
 else
 CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -msse2
 endif
+endif
 
 AMD_DAL_DCN32 = $(addprefix $(AMDDALPATH)/dc/dcn32/,$(DCN32))
 
drivers/gpu/drm/amd/display/dc/dcn321/Makefile +3 -3
index 5896ca303e39..e554fd6c16f2 100644
@@ -13,7 +13,7 @@
 DCN321 = dcn321_resource.o dcn321_dio_link_encoder.o
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -mhard-float -msse
 endif
 
 ifdef CONFIG_PPC64
@@ -24,9 +24,9 @@ ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
 endif
-CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -mhard-float
 endif
 
+ifdef CONFIG_X86
 ifdef IS_OLD_GCC
 # Stack alignment mismatch, proceed with caution.
 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
@@ -35,6 +35,7 @@ CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -mpreferred-stack-boundary=4
 else
 CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -msse2
 endif
+endif
 
 AMD_DAL_DCN321 = $(addprefix $(AMDDALPATH)/dc/dcn321/,$(DCN321))
 
--

2.35.3

#7 lore raw

Well in this case Acked-by: Christian König <[email protected]>

Christian.

Am 14.06.22 um 15:30 schrieb Alex Deucher:

Quoted 171 lines

Anyone? This fixes the build on non-x86.

Alex

Quoted 166 lines · Alex Deucher

Ping?

Quoted 163 lines · Alex Deucher

Use the same pattern as the DML Makefile and while we are here add a missing x86 guard around the msse flags for DCN3.2.x.

---
  drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile | 3 +--
  drivers/gpu/drm/amd/display/dc/dcn201/Makefile  | 1 -
  drivers/gpu/drm/amd/display/dc/dcn30/Makefile   | 6 ++----
  drivers/gpu/drm/amd/display/dc/dcn302/Makefile  | 8 +++++++-
  drivers/gpu/drm/amd/display/dc/dcn32/Makefile   | 5 +++--
  drivers/gpu/drm/amd/display/dc/dcn321/Makefile  | 5 +++--
  6 files changed, 16 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile +1 -2
index c935c10b5f4f..7b505e1e9308 100644
@@ -180,7 +180,7 @@ CLK_MGR_DCN32 = dcn32_clk_mgr.o dcn32_clk_mgr_smu_msg.o
  AMD_DAL_CLK_MGR_DCN32 = $(addprefix $(AMDDALPATH)/dc/clk_mgr/dcn32/,$(CLK_MGR_DCN32))
 
  ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -mhard-float -msse
  endif
 
  ifdef CONFIG_PPC64
@@ -191,7 +191,6 @@ ifdef CONFIG_CC_IS_GCC
  ifeq ($(call cc-ifversion, -lt, 0701, y), y)
  IS_OLD_GCC = 1
  endif
-CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn32/dcn32_clk_mgr.o := -mhard-float
  endif
 
  ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn201/Makefile +0 -1
index f68038ceb1b1..96cbd4ccd344 100644
@@ -18,7 +18,6 @@ ifdef CONFIG_CC_IS_GCC
  ifeq ($(call cc-ifversion, -lt, 0701, y), y)
  IS_OLD_GCC = 1
  endif
-CFLAGS_$(AMDDALPATH)/dc/dcn201/dcn201_resource.o += -mhard-float
  endif
 
  ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn30/Makefile +2 -4
index dfd77b3cc84d..c20331eb62e0 100644
@@ -32,8 +32,8 @@ DCN30 = dcn30_init.o dcn30_hubbub.o dcn30_hubp.o dcn30_dpp.o dcn30_optc.o \
 
 
  ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -msse
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mhard-float -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -msse
  endif
 
  ifdef CONFIG_PPC64
@@ -45,8 +45,6 @@ ifdef CONFIG_CC_IS_GCC
  ifeq ($(call cc-ifversion, -lt, 0701, y), y)
  IS_OLD_GCC = 1
  endif
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o += -mhard-float
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o += -mhard-float
  endif
 
  ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn302/Makefile +7 -1
index f9561d7f97a1..e4b69ad0dde5 100644
@@ -8,7 +8,7 @@
  DCN3_02 = dcn302_init.o dcn302_hwseq.o dcn302_resource.o
 
  ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -msse
  endif
 
  ifdef CONFIG_PPC64
@@ -16,6 +16,12 @@ CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -maltivec
  endif
 
  ifdef CONFIG_X86
+ifdef CONFIG_CC_IS_GCC
+ifeq ($(call cc-ifversion, -lt, 0701, y), y)
+IS_OLD_GCC = 1
+endif
+endif
+
  ifdef IS_OLD_GCC
  # Stack alignment mismatch, proceed with caution.
  # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +3 -2
index 3d09db3070f4..34f2e37b6704 100644
@@ -16,7 +16,7 @@ DCN32 = dcn32_resource.o dcn32_hubbub.o dcn32_hwseq.o dcn32_init.o \
                 dcn32_mpc.o
 
  ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -mhard-float -msse
  endif
 
  ifdef CONFIG_PPC64
@@ -27,9 +27,9 @@ ifdef CONFIG_CC_IS_GCC
  ifeq ($(call cc-ifversion, -lt, 0701, y), y)
  IS_OLD_GCC = 1
  endif
-CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -mhard-float
  endif
 
+ifdef CONFIG_X86
  ifdef IS_OLD_GCC
  # Stack alignment mismatch, proceed with caution.
  # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
@@ -38,6 +38,7 @@ CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -mpreferred-stack-boundary=4
  else
  CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -msse2
  endif
+endif
 
  AMD_DAL_DCN32 = $(addprefix $(AMDDALPATH)/dc/dcn32/,$(DCN32))
 
drivers/gpu/drm/amd/display/dc/dcn321/Makefile +3 -3
index 5896ca303e39..e554fd6c16f2 100644
@@ -13,7 +13,7 @@
  DCN321 = dcn321_resource.o dcn321_dio_link_encoder.o
 
  ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -mhard-float -msse
  endif
 
  ifdef CONFIG_PPC64
@@ -24,9 +24,9 @@ ifdef CONFIG_CC_IS_GCC
  ifeq ($(call cc-ifversion, -lt, 0701, y), y)
  IS_OLD_GCC = 1
  endif
-CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -mhard-float
  endif
 
+ifdef CONFIG_X86
  ifdef IS_OLD_GCC
  # Stack alignment mismatch, proceed with caution.
  # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
@@ -35,6 +35,7 @@ CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -mpreferred-stack-boundary=4
  else
  CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o += -msse2
  endif
+endif
 
  AMD_DAL_DCN321 = $(addprefix $(AMDDALPATH)/dc/dcn321/,$(DCN321))
 
--

2.35.3