amdgpu/dc/dml: Consolidate redundant CFLAGS
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
@@ -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
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
@@ -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
PATCH v3 3/4 amdgpu/dc/dml: Support clang option for stack alignment
In reply to Matthias KaehlckeDML 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
@@ -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
PATCH v3 4/4 amdgpu/dc/calcs: Support clang option for stack alignment
In reply to Matthias Kaehlckecalcs 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
@@ -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
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.Signed-off-by Matthias Kaehlcke <[email protected]>
Series is
Harry
Quoted 20 lines
---
Changes in v3:
- patch addedNote 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@@ -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
Harry Wentland
maintainerRe: [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.Signed-off-by Matthias Kaehlcke <[email protected]>Series is
Reviewed-by Harry Wentland <[email protected]>
... 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 addedNote 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@@ -24,7 +24,13 @@ # It calculates Bandwidth and Watermarks values for HW programming # -calcs_ccflags := -mhard-float -msse -mpreferred-stack-boundary=4drivers/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
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
Signed-off-by Matthias Kaehlcke <[email protected]>Series is
Reviewed-by Harry Wentland <[email protected]>... 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 addedNote 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@@ -24,7 +24,13 @@ # It calculates Bandwidth and Watermarks values for HW programming # -calcs_ccflags := -mhard-float -msse -mpreferred-stack-boundary=4drivers/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