Skip to contentSkip to conversation

drm/amdgpu/display: make some functions static

PATCH In review Alex Deucher 3 participants 6 messages Jun 6, 2022

Subsystems (3)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/2 drm/amdgpu/display: make some functions static

Fixes "no previous prototype" warnings.

---
 .../gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c  | 2 +-
 drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dccg.c         | 8 ++++----
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c         | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c +1 -1
index 1db61029481b..ed70ae10bdb1 100644
@@ -487,7 +487,7 @@ static void dcn32_update_clocks(struct clk_mgr *clk_mgr_base,
 				clk_mgr_base->clks.dispclk_khz / 1000 / 7);
 }
 
-void dcn32_clock_read_ss_info(struct clk_mgr_internal *clk_mgr)
+static void dcn32_clock_read_ss_info(struct clk_mgr_internal *clk_mgr)
 {
 	struct dc_bios *bp = clk_mgr->base.ctx->dc_bios;
 	int ss_info_num = bp->funcs->get_ss_entry_number(
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dccg.c +4 -4
index 8eeb3b69b5b9..0faa1abd35ba 100644
@@ -662,8 +662,8 @@ void dccg31_init(struct dccg *dccg)
 	}
 }
 
-void dccg31_otg_add_pixel(struct dccg *dccg,
-		uint32_t otg_inst)
+static void dccg31_otg_add_pixel(struct dccg *dccg,
+				 uint32_t otg_inst)
 {
 	struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
 
@@ -671,8 +671,8 @@ void dccg31_otg_add_pixel(struct dccg *dccg,
 			OTG_ADD_PIXEL[otg_inst], 1);
 }
 
-void dccg31_otg_drop_pixel(struct dccg *dccg,
-		uint32_t otg_inst)
+static void dccg31_otg_drop_pixel(struct dccg *dccg,
+				  uint32_t otg_inst)
 {
 	struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
 
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c +1 -1
index 08232d05d894..152a76ad7957 100644
@@ -177,7 +177,7 @@ void dccg32_set_dtbclk_dto(
 	}
 }
 
-void dccg32_set_valid_pixel_rate(
+static void dccg32_set_valid_pixel_rate(
 		struct dccg *dccg,
 		int ref_dtbclk_khz,
 		int otg_inst,
Signature · 1 line
2.35.3
author maintainer
#1 lore raw

PATCH 2/2 drm/amdgpu/display: fix DCN3.2 Makefiles for non-x86

Add proper handling for PPC64.

---
 drivers/gpu/drm/amd/display/dc/dcn32/Makefile  | 9 ++++++++-
 drivers/gpu/drm/amd/display/dc/dcn321/Makefile | 9 ++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +8 -1
index 6e0328060255..3d09db3070f4 100644
@@ -15,12 +15,19 @@ DCN32 = dcn32_resource.o dcn32_hubbub.o dcn32_hwseq.o dcn32_init.o \
 		dcn32_dio_stream_encoder.o dcn32_dio_link_encoder.o dcn32_hpo_dp_link_encoder.o \
 		dcn32_mpc.o
 
-CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -mhard-float -msse
+ifdef CONFIG_X86
+CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -msse
+endif
+
+ifdef CONFIG_PPC64
+CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -mhard-float -maltivec
+endif
 
 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 IS_OLD_GCC
drivers/gpu/drm/amd/display/dc/dcn321/Makefile +8 -1
index 9b61d08700ca..5896ca303e39 100644
@@ -12,12 +12,19 @@
 
 DCN321 = dcn321_resource.o dcn321_dio_link_encoder.o
 
-CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -mhard-float -msse
+ifdef CONFIG_X86
+CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -msse
+endif
+
+ifdef CONFIG_PPC64
+CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -mhard-float -maltivec
+endif
 
 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 IS_OLD_GCC
Signature · 1 line
2.35.3
maintainer
#2 lore raw

Re: [PATCH 2/2] drm/amdgpu/display: fix DCN3.2 Makefiles for non-x86

Quoted 14 lines · Alex Deucher

Add proper handling for PPC64.

---
 drivers/gpu/drm/amd/display/dc/dcn32/Makefile  | 9 ++++++++-
 drivers/gpu/drm/amd/display/dc/dcn321/Makefile | 9 ++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +0 -0
index 6e0328060255..3d09db3070f4 100644

drivers/gpu/drm/amd/display/dc/dcn32/Makefile DCN32 = dcn32_resource.o dcn32_hubbub.o dcn32_hwseq.o dcn32_init.o \ · line 19

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +2 -1
@@ -15,12 +15,19 @@ DCN32 = dcn32_resource.o dcn32_hubbub.o dcn32_hwseq.o dcn32_init.o \
 		dcn32_dio_stream_encoder.o dcn32_dio_link_encoder.o dcn32_hpo_dp_link_encoder.o \
 		dcn32_mpc.o
 
-CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -mhard-float -msse
+ifdef CONFIG_X86
+CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -msse

Should this have an -mhard-float as well? I see that in the other Makefiles.

The entry below only adds it for gcc, not for clang.

Harry

Quoted 39 lines
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +6 -0
+endif
+
+ifdef CONFIG_PPC64
+CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -mhard-float -maltivec
+endif
 
 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 IS_OLD_GCC
drivers/gpu/drm/amd/display/dc/dcn321/Makefile +8 -1
index 9b61d08700ca..5896ca303e39 100644
@@ -12,12 +12,19 @@
 
 DCN321 = dcn321_resource.o dcn321_dio_link_encoder.o
 
-CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -mhard-float -msse
+ifdef CONFIG_X86
+CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -msse
+endif
+
+ifdef CONFIG_PPC64
+CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -mhard-float -maltivec
+endif
 
 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 IS_OLD_GCC
#3 lore raw

Re: [PATCH 2/2] drm/amdgpu/display: fix DCN3.2 Makefiles for non-x86

Quoted 19 lines · Harry Wentland
Quoted 17 lines · Alex Deucher

Add proper handling for PPC64.

---
 drivers/gpu/drm/amd/display/dc/dcn32/Makefile  | 9 ++++++++-
 drivers/gpu/drm/amd/display/dc/dcn321/Makefile | 9 ++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +0 -0
index 6e0328060255..3d09db3070f4 100644
@@ -15,12 +15,19 @@ DCN32 = dcn32_resource.o dcn32_hubbub.o dcn32_hwseq.o dcn32_init.o \
              dcn32_dio_stream_encoder.o dcn32_dio_link_encoder.o dcn32_hpo_dp_link_encoder.o \
              dcn32_mpc.o
 
Quoted 8 lines

drivers/gpu/drm/amd/display/dc/dcn32/Makefile DCN32 = dcn32_resource.o dcn32_hubbub.o dcn32_hwseq.o dcn32_init.o \ · line 19

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +2 -1
-CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -mhard-float -msse
+ifdef CONFIG_X86
+CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -msse

Should this have an -mhard-float as well? I see that in the other Makefiles.

The entry below only adds it for gcc, not for clang.

A bunch of the other resource Makefiles don't seem to have it. E.g., drivers/gpu/drm/amd/display/dc/dcn30/Makefile drivers/gpu/drm/amd/display/dc/dcn302/Makefile

drivers/gpu/drm/amd/display/dc/dcn201/Makefile and drivers/gpu/drm/amd/display/dc/dml/Makefile do include it however.

Alex

Quoted 43 lines

Harry

Quoted 39 lines
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +6 -0
+endif
+
+ifdef CONFIG_PPC64
+CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -mhard-float -maltivec
+endif
 
 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 IS_OLD_GCC
drivers/gpu/drm/amd/display/dc/dcn321/Makefile +8 -1
index 9b61d08700ca..5896ca303e39 100644
@@ -12,12 +12,19 @@
 
 DCN321 = dcn321_resource.o dcn321_dio_link_encoder.o
 
-CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -mhard-float -msse
+ifdef CONFIG_X86
+CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -msse
+endif
+
+ifdef CONFIG_PPC64
+CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -mhard-float -maltivec
+endif
 
 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 IS_OLD_GCC
maintainer Reviewed-by
#4 lore raw

Re: [PATCH 2/2] drm/amdgpu/display: fix DCN3.2 Makefiles for non-x86

Quoted 27 lines · Alex Deucher
Quoted 26 lines · Harry Wentland
Quoted 14 lines · Alex Deucher

Add proper handling for PPC64.

---
 drivers/gpu/drm/amd/display/dc/dcn32/Makefile  | 9 ++++++++-
 drivers/gpu/drm/amd/display/dc/dcn321/Makefile | 9 ++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +0 -0
index 6e0328060255..3d09db3070f4 100644

drivers/gpu/drm/amd/display/dc/dcn32/Makefile DCN32 = dcn32_resource.o dcn32_hubbub.o dcn32_hwseq.o dcn32_init.o \ · line 19

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +2 -1
@@ -15,12 +15,19 @@ DCN32 = dcn32_resource.o dcn32_hubbub.o dcn32_hwseq.o dcn32_init.o \
              dcn32_dio_stream_encoder.o dcn32_dio_link_encoder.o dcn32_hpo_dp_link_encoder.o \
              dcn32_mpc.o
 
-CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -mhard-float -msse
+ifdef CONFIG_X86
+CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -msse

Should this have an -mhard-float as well? I see that in the other Makefiles.

Quoted 6 lines
Quoted 1 line

The entry below only adds it for gcc, not for clang.

A bunch of the other resource Makefiles don't seem to have it. E.g., drivers/gpu/drm/amd/display/dc/dcn30/Makefile drivers/gpu/drm/amd/display/dc/dcn302/Makefile

True, and things worked so far. In that case we probably don't need it.

Harry

Quoted 48 lines

drivers/gpu/drm/amd/display/dc/dcn201/Makefile and drivers/gpu/drm/amd/display/dc/dml/Makefile do include it however.

Alex

Quoted 43 lines

Harry

Quoted 39 lines
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +6 -0
+endif
+
+ifdef CONFIG_PPC64
+CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -mhard-float -maltivec
+endif
 
 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 IS_OLD_GCC
drivers/gpu/drm/amd/display/dc/dcn321/Makefile +8 -1
index 9b61d08700ca..5896ca303e39 100644
@@ -12,12 +12,19 @@
 
 DCN321 = dcn321_resource.o dcn321_dio_link_encoder.o
 
-CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -mhard-float -msse
+ifdef CONFIG_X86
+CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -msse
+endif
+
+ifdef CONFIG_PPC64
+CFLAGS_$(AMDDALPATH)/dc/dcn321/dcn321_resource.o := -mhard-float -maltivec
+endif
 
 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 IS_OLD_GCC
maintainer Reviewed-by on v1 1/2
#5 lore raw
In reply to Alex Deucher
Quoted 4 lines · Alex Deucher

Fixes "no previous prototype" warnings.

Harry

Quoted 58 lines
---
 .../gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c  | 2 +-
 drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dccg.c         | 8 ++++----
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c         | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c +1 -1
index 1db61029481b..ed70ae10bdb1 100644
@@ -487,7 +487,7 @@ static void dcn32_update_clocks(struct clk_mgr *clk_mgr_base,
 				clk_mgr_base->clks.dispclk_khz / 1000 / 7);
 }
 
-void dcn32_clock_read_ss_info(struct clk_mgr_internal *clk_mgr)
+static void dcn32_clock_read_ss_info(struct clk_mgr_internal *clk_mgr)
 {
 	struct dc_bios *bp = clk_mgr->base.ctx->dc_bios;
 	int ss_info_num = bp->funcs->get_ss_entry_number(
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dccg.c +4 -4
index 8eeb3b69b5b9..0faa1abd35ba 100644
@@ -662,8 +662,8 @@ void dccg31_init(struct dccg *dccg)
 	}
 }
 
-void dccg31_otg_add_pixel(struct dccg *dccg,
-		uint32_t otg_inst)
+static void dccg31_otg_add_pixel(struct dccg *dccg,
+				 uint32_t otg_inst)
 {
 	struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
 
@@ -671,8 +671,8 @@ void dccg31_otg_add_pixel(struct dccg *dccg,
 			OTG_ADD_PIXEL[otg_inst], 1);
 }
 
-void dccg31_otg_drop_pixel(struct dccg *dccg,
-		uint32_t otg_inst)
+static void dccg31_otg_drop_pixel(struct dccg *dccg,
+				  uint32_t otg_inst)
 {
 	struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
 
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c +1 -1
index 08232d05d894..152a76ad7957 100644
@@ -177,7 +177,7 @@ void dccg32_set_dtbclk_dto(
 	}
 }
 
-void dccg32_set_valid_pixel_rate(
+static void dccg32_set_valid_pixel_rate(
 		struct dccg *dccg,
 		int ref_dtbclk_khz,
 		int otg_inst,