All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kent Russell <kent.russell@amd.com>
To: amd-gfx@lists.freedesktop.org
Cc: Kent Russell <kent.russell@amd.com>
Subject: [PATCH] drm/amd/display: Explicitly set stack size to 4
Date: Tue, 21 Jul 2020 11:38:01 -0400	[thread overview]
Message-ID: <20200721153801.11699-1-kent.russell@amd.com> (raw)

In certain kernels using GCC 8.2, we get compilation errors saying:
-mpreferred-stack-boundary=3 is not between 4 and 12
Explicitly set -mpreferred-stack-boundary=4 in the Display Makefiles,
even when SSE2 is enabled

Change-Id: Ic7c4637e2e521af2d0444d3b5886f710131c80ca
Signed-off-by: Kent Russell <kent.russell@amd.com>
---
 drivers/gpu/drm/amd/display/dc/calcs/Makefile | 8 ++++----
 drivers/gpu/drm/amd/display/dc/dcn20/Makefile | 8 ++++----
 drivers/gpu/drm/amd/display/dc/dcn21/Makefile | 8 ++++----
 drivers/gpu/drm/amd/display/dc/dcn30/Makefile | 8 ++++----
 drivers/gpu/drm/amd/display/dc/dml/Makefile   | 9 +++++----
 drivers/gpu/drm/amd/display/dc/dsc/Makefile   | 8 ++++----
 6 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/calcs/Makefile b/drivers/gpu/drm/amd/display/dc/calcs/Makefile
index 4674aca8f206..5c519cec9039 100644
--- a/drivers/gpu/drm/amd/display/dc/calcs/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/calcs/Makefile
@@ -26,7 +26,9 @@
 #
 
 ifdef CONFIG_X86
-calcs_ccflags := -mhard-float -msse
+# Certain kernels don't compile with -mpreferred-stack-boundary=3, so explicitly set it
+# to 4, even if we enable SSE2
+calcs_ccflags := -mhard-float -msse -mpreferred-stack-boundary=4
 endif
 
 ifdef CONFIG_PPC64
@@ -40,12 +42,10 @@ endif
 endif
 
 ifdef CONFIG_X86
-ifdef IS_OLD_GCC
+ifndef IS_OLD_GCC
 # Stack alignment mismatch, proceed with caution.
 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
 # (8B stack alignment).
-calcs_ccflags += -mpreferred-stack-boundary=4
-else
 calcs_ccflags += -msse2
 endif
 endif
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/Makefile b/drivers/gpu/drm/amd/display/dc/dcn20/Makefile
index 5fcaf78334ff..78d3e0563a4c 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/Makefile
@@ -10,7 +10,9 @@ DCN20 = dcn20_resource.o dcn20_init.o dcn20_hwseq.o dcn20_dpp.o dcn20_dpp_cm.o d
 DCN20 += dcn20_dsc.o
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o := -mhard-float -msse
+# Certain kernels don't compile with -mpreferred-stack-boundary=3, so explicitly set it
+# to 4, even if we enable SSE2
+CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o := -mhard-float -msse -mpreferred-stack-boundary=4
 endif
 
 ifdef CONFIG_PPC64
@@ -24,12 +26,10 @@ endif
 endif
 
 ifdef CONFIG_X86
-ifdef IS_OLD_GCC
+ifndef IS_OLD_GCC
 # Stack alignment mismatch, proceed with caution.
 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
 # (8B stack alignment).
-CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o += -mpreferred-stack-boundary=4
-else
 CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o += -msse2
 endif
 endif
diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/Makefile b/drivers/gpu/drm/amd/display/dc/dcn21/Makefile
index 07684d3e375a..6183e8f141bb 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn21/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn21/Makefile
@@ -6,7 +6,9 @@ DCN21 = dcn21_init.o dcn21_hubp.o dcn21_hubbub.o dcn21_resource.o \
 	 dcn21_hwseq.o dcn21_link_encoder.o
 
 ifdef CONFIG_X86
-CFLAGS_$(AMDDALPATH)/dc/dcn21/dcn21_resource.o := -mhard-float -msse
+# Certain kernels don't compile with -mpreferred-stack-boundary=3, so explicitly set it
+# to 4, even if we enable SSE2
+CFLAGS_$(AMDDALPATH)/dc/dcn21/dcn21_resource.o := -mhard-float -msse -mpreferred-stack-boundary=4
 endif
 
 ifdef CONFIG_PPC64
@@ -20,12 +22,10 @@ endif
 endif
 
 ifdef CONFIG_X86
-ifdef IS_OLD_GCC
+ifndef IS_OLD_GCC
 # Stack alignment mismatch, proceed with caution.
 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
 # (8B stack alignment).
-CFLAGS_$(AMDDALPATH)/dc/dcn21/dcn21_resource.o += -mpreferred-stack-boundary=4
-else
 CFLAGS_$(AMDDALPATH)/dc/dcn21/dcn21_resource.o += -msse2
 endif
 endif
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/Makefile b/drivers/gpu/drm/amd/display/dc/dcn30/Makefile
index 025637a83c3b..0d803486e051 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/Makefile
@@ -33,19 +33,19 @@ DCN30 = dcn30_init.o dcn30_hubbub.o dcn30_hubp.o dcn30_dpp.o dcn30_optc.o \
 
 CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -msse -mpreferred-stack-boundary=4
 
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mhard-float -msse
+# Certain kernels don't compile with -mpreferred-stack-boundary=3, so explicitly set it
+# to 4, even if we enable SSE2
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mhard-float -msse -mpreferred-stack-boundary=4
 ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
 endif
 endif
 
-ifdef IS_OLD_GCC
+ifndef IS_OLD_GCC
 # Stack alignment mismatch, proceed with caution.
 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
 # (8B stack alignment).
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o += -mpreferred-stack-boundary=4
-else
 CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o += -msse2
 endif
 
diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile
index 417331438c30..fc5e304c4dac 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
@@ -25,8 +25,11 @@
 # It provides the general basic services required by other DAL
 # subcomponents.
 
+
 ifdef CONFIG_X86
-dml_ccflags := -mhard-float -msse
+# Certain kernels don't compile with -mpreferred-stack-boundary=3, so explicitly set it
+# to 4, even if we enable SSE2
+dml_ccflags := -mhard-float -msse -mpreferred-stack-boundary=4
 endif
 
 ifdef CONFIG_PPC64
@@ -40,12 +43,10 @@ endif
 endif
 
 ifdef CONFIG_X86
-ifdef IS_OLD_GCC
+ifndef IS_OLD_GCC
 # Stack alignment mismatch, proceed with caution.
 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
 # (8B stack alignment).
-dml_ccflags += -mpreferred-stack-boundary=4
-else
 dml_ccflags += -msse2
 endif
 endif
diff --git a/drivers/gpu/drm/amd/display/dc/dsc/Makefile b/drivers/gpu/drm/amd/display/dc/dsc/Makefile
index ea29cf95d470..98695c66eaf1 100644
--- a/drivers/gpu/drm/amd/display/dc/dsc/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dsc/Makefile
@@ -3,7 +3,9 @@
 # Makefile for the 'dsc' sub-component of DAL.
 
 ifdef CONFIG_X86
-dsc_ccflags := -mhard-float -msse
+# Certain kernels don't compile with -mpreferred-stack-boundary=3, so explicitly set it
+# to 4, even if we enable SSE2
+dsc_ccflags := -mhard-float -msse -mpreferred-stack-boundary=4
 endif
 
 ifdef CONFIG_PPC64
@@ -17,12 +19,10 @@ endif
 endif
 
 ifdef CONFIG_X86
-ifdef IS_OLD_GCC
+ifndef IS_OLD_GCC
 # Stack alignment mismatch, proceed with caution.
 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
 # (8B stack alignment).
-dsc_ccflags += -mpreferred-stack-boundary=4
-else
 dsc_ccflags += -msse2
 endif
 endif
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

             reply	other threads:[~2020-07-21 15:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21 15:38 Kent Russell [this message]
2020-07-21 16:01 ` [PATCH] drm/amd/display: Explicitly set stack size to 4 Kazlauskas, Nicholas
2020-07-21 16:03 ` Felix Kuehling
2020-07-21 16:08   ` Kazlauskas, Nicholas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200721153801.11699-1-kent.russell@amd.com \
    --to=kent.russell@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.