Skip to contentSkip to conversation

amdgpu/dc/dml: Consolidate redundant CFLAGS

PATCH Superseded Matthias Kaehlcke 2 participants 5 messages Feb 8, 2018

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 amdgpu/dc/dml: Consolidate redundant CFLAGS

Use subdir-ccflags instead of specifying the same flags for every source file.

---
 drivers/gpu/drm/amd/display/dc/dml/Makefile | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/Makefile +1 -9
index 3488af2b5786..b8cadf833e71 100644
@@ -24,15 +24,7 @@
 # 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
-
+subdir-ccflags-y += -mhard-float -msse -mpreferred-stack-boundary=4
 
 DML = display_mode_lib.o display_rq_dlg_calc.o \
 	  display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
Signature · 1 line
2.16.0.rc1.238.g530d649a79-goog
#1 lore raw

PATCH 2/2 amdgpu/dc/dml: Support clang option for stack alignment

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.

---
 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 b8cadf833e71..740975931d21 100644
@@ -24,7 +24,13 @@
 # It provides the general basic services required by other DAL
 # subcomponents.
 
-subdir-ccflags-y += -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
+
+subdir-ccflags-y += -mhard-float -msse $(cc_stack_align)
 
 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
#2 lore raw

Re: [PATCH 2/2] amdgpu/dc/dml: Support clang option for stack alignment

Quoted 19 lines · 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.

---
 drivers/gpu/drm/amd/display/dc/dml/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/Makefile +0 -0
index b8cadf833e71..740975931d21 100644

drivers/gpu/drm/amd/display/dc/dml/Makefile line 32

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dml/Makefile +6 -1
@@ -24,7 +24,13 @@
 # It provides the general basic services required by other DAL
 # subcomponents.
 
-subdir-ccflags-y += -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
+

Any reason for using both = and := ?

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/dml/Makefile +1 -1
+subdir-ccflags-y += -mhard-float -msse $(cc_stack_align)
 
 DML = display_mode_lib.o display_rq_dlg_calc.o \
          display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
--

2.16.0.rc1.238.g530d649a79-goog

#3 lore raw

Re: [PATCH 2/2] amdgpu/dc/dml: Support clang option for stack alignment

El Wed, Feb 07, 2018 at 05:34:44PM -0800 Guenter Roeck ha dit:

Quoted 23 lines · Matthias Kaehlcke
Quoted 22 lines

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.

---
 drivers/gpu/drm/amd/display/dc/dml/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/Makefile +0 -0
index b8cadf833e71..740975931d21 100644
@@ -24,7 +24,13 @@
 # It provides the general basic services required by other DAL
 # subcomponents.
 
Quoted 8 lines

drivers/gpu/drm/amd/display/dc/dml/Makefile line 32

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/dml/Makefile +6 -1
-subdir-ccflags-y += -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
+

Any reason for using both = and := ?

Not really, will fix.

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

Reviewed-by on v1 1/2
#4 lore raw
In reply to Matthias Kaehlcke
Quoted 4 lines · Matthias Kaehlcke

Use subdir-ccflags instead of specifying the same flags for every source file.

Quoted 28 lines
---
 drivers/gpu/drm/amd/display/dc/dml/Makefile | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/Makefile +1 -10
index 3488af2b5786..b8cadf833e71 100644
@@ -24,15 +24,7 @@
 # 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
-
+subdir-ccflags-y += -mhard-float -msse -mpreferred-stack-boundary=4
 
 DML = display_mode_lib.o display_rq_dlg_calc.o \
          display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
--

2.16.0.rc1.238.g530d649a79-goog