AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Bump frame warning limit for clang builds of dml
@ 2026-08-21 22:32 IVAN.LIPSKI
  2026-08-21 22:35 ` Mario Limonciello
  0 siblings, 1 reply; 2+ messages in thread
From: IVAN.LIPSKI @ 2026-08-21 22:32 UTC (permalink / raw)
  To: amd-gfx, Mario Limonciello; +Cc: Harry Wentland, Leo Li, Alex Hung, Ivan Lipski

From: Ivan Lipski <ivan.lipski@amd.com>

[Why&How]
When building the DML files with clang without any sanitizer or LTO,
the following -Wframe-larger-than errors break the build under
CONFIG_WERROR:

  display_mode_vba_30.c: error: stack frame size (2512) exceeds limit
    (2048) in 'dml30_ModeSupportAndSystemConfigurationFull'
  display_mode_vba_31.c: error: stack frame size (2416) exceeds limit
    (2048) in 'dml31_ModeSupportAndSystemConfigurationFull'
  display_mode_vba_314.c: error: stack frame size (2392) exceeds limit
    (2048) in 'dml314_ModeSupportAndSystemConfigurationFull'

Clang consistently spills more than gcc, pushing the frame past the 2048
byte limit.

Apply an existing approach of increasing the warn stack size to the
non-sanitizer path so plain clang builds use a 3072 byte limit.

Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5642

Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dml/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile
index 10d4ace04d4f1..99da9dbd62b75 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
@@ -36,7 +36,11 @@ ifneq ($(CONFIG_FRAME_WARN),0)
             frame_warn_limit := 3072
         endif
     else
-        frame_warn_limit := 2048
+        ifeq ($(CONFIG_CC_IS_CLANG),y)
+            frame_warn_limit := 3072
+        else
+            frame_warn_limit := 2048
+        endif
     endif
 
     ifeq ($(call test-lt, $(CONFIG_FRAME_WARN), $(frame_warn_limit)),y)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amd/display: Bump frame warning limit for clang builds of dml
  2026-08-21 22:32 [PATCH] drm/amd/display: Bump frame warning limit for clang builds of dml IVAN.LIPSKI
@ 2026-08-21 22:35 ` Mario Limonciello
  0 siblings, 0 replies; 2+ messages in thread
From: Mario Limonciello @ 2026-08-21 22:35 UTC (permalink / raw)
  To: IVAN.LIPSKI, amd-gfx; +Cc: Harry Wentland, Leo Li, Alex Hung

On 8/21/26 17:32, IVAN.LIPSKI@amd.com wrote:
> From: Ivan Lipski <ivan.lipski@amd.com>
> 
> [Why&How]
> When building the DML files with clang without any sanitizer or LTO,
> the following -Wframe-larger-than errors break the build under
> CONFIG_WERROR:
> 
>    display_mode_vba_30.c: error: stack frame size (2512) exceeds limit
>      (2048) in 'dml30_ModeSupportAndSystemConfigurationFull'
>    display_mode_vba_31.c: error: stack frame size (2416) exceeds limit
>      (2048) in 'dml31_ModeSupportAndSystemConfigurationFull'
>    display_mode_vba_314.c: error: stack frame size (2392) exceeds limit
>      (2048) in 'dml314_ModeSupportAndSystemConfigurationFull'
> 
> Clang consistently spills more than gcc, pushing the frame past the 2048
> byte limit.
> 
> Apply an existing approach of increasing the warn stack size to the
> non-sanitizer path so plain clang builds use a 3072 byte limit.
> 
> Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5642
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>>
> Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
> ---
>   drivers/gpu/drm/amd/display/dc/dml/Makefile | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile
> index 10d4ace04d4f1..99da9dbd62b75 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
> @@ -36,7 +36,11 @@ ifneq ($(CONFIG_FRAME_WARN),0)
>               frame_warn_limit := 3072
>           endif
>       else
> -        frame_warn_limit := 2048
> +        ifeq ($(CONFIG_CC_IS_CLANG),y)
> +            frame_warn_limit := 3072
> +        else
> +            frame_warn_limit := 2048
> +        endif
>       endif
>   
>       ifeq ($(call test-lt, $(CONFIG_FRAME_WARN), $(frame_warn_limit)),y)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-21 22:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-21 22:32 [PATCH] drm/amd/display: Bump frame warning limit for clang builds of dml IVAN.LIPSKI
2026-08-21 22:35 ` Mario Limonciello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox