Skip to contentSkip to conversation

amdgpu/dc/dml: Consolidate redundant CFLAGS

PATCH In review Matthias Kaehlcke 2 participants 7 messages Feb 8, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/4 amdgpu/dc/dml: Consolidate redundant CFLAGS

Use a variable for common CFLAGS instead of specifying the same flags for every source file.

---
Changes in v3:
- Use variable for compiler options instead of subdir-ccflags-y

 drivers/gpu/drm/amd/display/dc/dml/Makefile | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/Makefile +9 -8
index 3488af2b5786..96b337a03172 100644
@@ -24,15 +24,16 @@
 # It provides the general basic services required by other DAL
 # subcomponents.
 
-CFLAGS_display_mode_vba.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_display_mode_lib.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_display_pipe_clocks.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_display_rq_dlg_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_dml1_display_rq_dlg_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_display_rq_dlg_helpers.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_soc_bounding_box.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_dml_common_defs.o := -mhard-float -msse -mpreferred-stack-boundary=4
+dml_ccflags := -mhard-float -msse -mpreferred-stack-boundary=4
 
+CFLAGS_display_mode_vba.o := $(dml_ccflags)
+CFLAGS_display_mode_lib.o := $(dml_ccflags)
+CFLAGS_display_pipe_clocks.o := $(dml_ccflags)
+CFLAGS_display_rq_dlg_calc.o := $(dml_ccflags)
+CFLAGS_dml1_display_rq_dlg_calc.o := $(dml_ccflags)
+CFLAGS_display_rq_dlg_helpers.o := $(dml_ccflags)
+CFLAGS_soc_bounding_box.o := $(dml_ccflags)
+CFLAGS_dml_common_defs.o := $(dml_ccflags)
 
 DML = display_mode_lib.o display_rq_dlg_calc.o \
 	  display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
Signature · 6 lines
2.16.0.rc1.238.g530d649a79-goog

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH v3 2/4 amdgpu/dc/calcs: Consolidate redundant CFLAGS

Use a variable for common CFLAGS instead of specifying the same flags for every source file.

---
Changes in v3:
- patch added

 drivers/gpu/drm/amd/display/dc/calcs/Makefile | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/Makefile +5 -3
index 7959e382ed28..af0f452f3c9f 100644
@@ -24,9 +24,11 @@
 # It calculates Bandwidth and Watermarks values for HW programming
 #
 
-CFLAGS_dcn_calcs.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_dcn_calc_auto.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_dcn_calc_math.o := -mhard-float -msse -mpreferred-stack-boundary=4 -Wno-tautological-compare
+calcs_ccflags := -mhard-float -msse -mpreferred-stack-boundary=4
+
+CFLAGS_dcn_calcs.o := $(calcs_ccflags)
+CFLAGS_dcn_calc_auto.o := $(calcs_ccflags)
+CFLAGS_dcn_calc_math.o := $(calcs_ccflags) -Wno-tautological-compare
 
 BW_CALCS = dce_calcs.o bw_fixed.o custom_float.o
 
Signature · 6 lines
2.16.0.rc1.238.g530d649a79-goog

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

PATCH v3 3/4 amdgpu/dc/dml: Support clang option for stack alignment

In reply to Matthias Kaehlcke

DML uses the compiler option -mpreferred-stack-boundary=4 to configure a stack alignment of 16 bytes. Clang uses the option -mstack-alignment instead, which expects as parameter the alignment in bytes, and not a power of two like -mpreferred-stack-boundary.

Probe for both compiler options and use the correct one, similar to what is done in arch/x86/Makefile.

---
Changes in v3:
- adapted use of variable instead of subdir-ccflags-y

 drivers/gpu/drm/amd/display/dc/dml/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/Makefile +7 -1
index 96b337a03172..782886cac61c 100644
@@ -24,7 +24,13 @@
 # It provides the general basic services required by other DAL
 # subcomponents.
 
-dml_ccflags := -mhard-float -msse -mpreferred-stack-boundary=4
+ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
+	cc_stack_align := -mpreferred-stack-boundary=4
+else ifneq ($(call cc-option, -mstack-alignment=16),)
+	cc_stack_align := -mstack-alignment=16
+endif
+
+dml_ccflags := -mhard-float -msse $(cc_stack_align)
 
 CFLAGS_display_mode_vba.o := $(dml_ccflags)
 CFLAGS_display_mode_lib.o := $(dml_ccflags)
Signature · 6 lines
2.16.0.rc1.238.g530d649a79-goog

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

PATCH v3 4/4 amdgpu/dc/calcs: Support clang option for stack alignment

In reply to Matthias Kaehlcke

calcs uses the compiler option -mpreferred-stack-boundary=4 to configure a stack alignment of 16 bytes. Clang uses the option -mstack-alignment instead, which expects as parameter the alignment in bytes, and not a power of two like -mpreferred-stack-boundary.

Probe for both compiler options and use the correct one, similar to what is done in arch/x86/Makefile.

---
Changes in v3:
- patch added

Note to self: if this patterns proliferates further we probably want to put the evaluation of the correct compiler flag in some common place.

 drivers/gpu/drm/amd/display/dc/calcs/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/calcs/Makefile +7 -1
index af0f452f3c9f..95f332ee3e7e 100644
@@ -24,7 +24,13 @@
 # It calculates Bandwidth and Watermarks values for HW programming
 #
 
-calcs_ccflags := -mhard-float -msse -mpreferred-stack-boundary=4
+ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
+	cc_stack_align := -mpreferred-stack-boundary=4
+else ifneq ($(call cc-option, -mstack-alignment=16),)
+	cc_stack_align := -mstack-alignment=16
+endif
+
+calcs_ccflags := -mhard-float -msse $(cc_stack_align)
 
 CFLAGS_dcn_calcs.o := $(calcs_ccflags)
 CFLAGS_dcn_calc_auto.o := $(calcs_ccflags)
Signature · 1 line
2.16.0.rc1.238.g530d649a79-goog
maintainer Reviewed-by on v3 4/4
#4 lore raw

Re: [PATCH v3 4/4] amdgpu/dc/calcs: Support clang option for stack alignment

Quoted 9 lines · Matthias Kaehlcke

calcs uses the compiler option -mpreferred-stack-boundary=4 to configure a stack alignment of 16 bytes. Clang uses the option -mstack-alignment instead, which expects as parameter the alignment in bytes, and not a power of two like -mpreferred-stack-boundary.

Probe for both compiler options and use the correct one, similar to what is done in arch/x86/Makefile.

Series is

Harry

Quoted 20 lines

---
Changes in v3:
- patch added

Note to self: if this patterns proliferates further we probably want to put the evaluation of the correct compiler flag in some common place.

 drivers/gpu/drm/amd/display/dc/calcs/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/calcs/Makefile +0 -1
index af0f452f3c9f..95f332ee3e7e 100644
@@ -24,7 +24,13 @@
 # It calculates Bandwidth and Watermarks values for HW programming
 #
 
-calcs_ccflags := -mhard-float -msse -mpreferred-stack-boundary=4

drivers/gpu/drm/amd/display/dc/calcs/Makefile line 36

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/calcs/Makefile +7 -0
+ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
+	cc_stack_align := -mpreferred-stack-boundary=4
+else ifneq ($(call cc-option, -mstack-alignment=16),)
+	cc_stack_align := -mstack-alignment=16
+endif
+
+calcs_ccflags := -mhard-float -msse $(cc_stack_align)
 
 CFLAGS_dcn_calcs.o := $(calcs_ccflags)
 CFLAGS_dcn_calc_auto.o := $(calcs_ccflags)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#5 lore raw

Re: [PATCH v3 4/4] amdgpu/dc/calcs: Support clang option for stack alignment

Quoted 6 lines · Harry Wentland
Quoted 5 lines · Matthias Kaehlcke

calcs uses the compiler option -mpreferred-stack-boundary=4 to configure a stack alignment of 16 bytes. Clang uses the option -mstack-alignment instead, which expects as parameter the alignment in bytes, and not a power of two like -mpreferred-stack-boundary.

Quoted 7 lines
Quoted 4 lines

Probe for both compiler options and use the correct one, similar to what is done in arch/x86/Makefile.

Series is

... and merged to amd-staging-drm-next.

I had to resolve a small conflict with patches 1 & 2. Not a big deal but curious what development branch you use. We normally use this for amd-gfx development: https://cgit.freedesktop.org/~agd5f/linux/log/?h=amd-staging-drm-next (although it might be a bit behind our internal dev tree).

Harry

Quoted 38 lines

Harry

Quoted 20 lines

---
Changes in v3:
- patch added

Note to self: if this patterns proliferates further we probably want to put the evaluation of the correct compiler flag in some common place.

 drivers/gpu/drm/amd/display/dc/calcs/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/calcs/Makefile +0 -1
index af0f452f3c9f..95f332ee3e7e 100644
@@ -24,7 +24,13 @@
 # It calculates Bandwidth and Watermarks values for HW programming
 #
 
-calcs_ccflags := -mhard-float -msse -mpreferred-stack-boundary=4

drivers/gpu/drm/amd/display/dc/calcs/Makefile line 36

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/calcs/Makefile +7 -0
+ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
+	cc_stack_align := -mpreferred-stack-boundary=4
+else ifneq ($(call cc-option, -mstack-alignment=16),)
+	cc_stack_align := -mstack-alignment=16
+endif
+
+calcs_ccflags := -mhard-float -msse $(cc_stack_align)
 
 CFLAGS_dcn_calcs.o := $(calcs_ccflags)
 CFLAGS_dcn_calc_auto.o := $(calcs_ccflags)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

Re: [PATCH v3 4/4] amdgpu/dc/calcs: Support clang option for stack alignment

El Thu, Feb 08, 2018 at 04:44:21PM -0500 Harry Wentland ha dit:

Quoted 10 lines · Harry Wentland
Quoted 9 lines · Matthias Kaehlcke
Quoted 8 lines

calcs uses the compiler option -mpreferred-stack-boundary=4 to configure a stack alignment of 16 bytes. Clang uses the option -mstack-alignment instead, which expects as parameter the alignment in bytes, and not a power of two like -mpreferred-stack-boundary.

Probe for both compiler options and use the correct one, similar to what is done in arch/x86/Makefile.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Series is

... and merged to amd-staging-drm-next.

Thanks!

Quoted 1 line

I had to resolve a small conflict with patches 1 & 2. Not a big deal but curious what development branch you use. We normally use this for amd-gfx development: https://cgit.freedesktop.org/~agd5f/linux/log/?h=amd-staging-drm-next (although it might be a bit behind our internal dev tree).

I typically use Linus' tree as base, will try to remember to check future patches against amd-staging-drm-next.

Quoted 35 lines
Quoted 35 lines
Quoted 20 lines

---
Changes in v3:
- patch added

Note to self: if this patterns proliferates further we probably want to put the evaluation of the correct compiler flag in some common place.

 drivers/gpu/drm/amd/display/dc/calcs/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/calcs/Makefile +0 -1
index af0f452f3c9f..95f332ee3e7e 100644
@@ -24,7 +24,13 @@
 # It calculates Bandwidth and Watermarks values for HW programming
 #
 
-calcs_ccflags := -mhard-float -msse -mpreferred-stack-boundary=4

drivers/gpu/drm/amd/display/dc/calcs/Makefile line 36

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/calcs/Makefile +7 -0
+ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
+	cc_stack_align := -mpreferred-stack-boundary=4
+else ifneq ($(call cc-option, -mstack-alignment=16),)
+	cc_stack_align := -mstack-alignment=16
+endif
+
+calcs_ccflags := -mhard-float -msse $(cc_stack_align)
 
 CFLAGS_dcn_calcs.o := $(calcs_ccflags)
 CFLAGS_dcn_calc_auto.o := $(calcs_ccflags)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel