Skip to content

Commit 820ccf8

Browse files
nathanchancealexdeucher
authored andcommitted
drm/amd/display: Respect user's CONFIG_FRAME_WARN more for dml files
Currently, there are several files in drm/amd/display that aim to have a higher -Wframe-larger-than value to avoid instances of that warning with a lower value from the user's configuration. However, with the way that it is currently implemented, it does not respect the user's request via CONFIG_FRAME_WARN for a higher stack frame limit, which can cause pain when new instances of the warning appear and break the build due to CONFIG_WERROR. Adjust the logic to switch from a hard coded -Wframe-larger-than value to only using the value as a minimum clamp and deferring to the requested value from CONFIG_FRAME_WARN if it is higher. Suggested-by: Harry Wentland <[email protected]> Reported-by: Greg Kroah-Hartman <[email protected]> Closes: https://lore.kernel.org/2025013003-audience-opposing-7f95@gregkh/ Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent e01f07c commit 820ccf8

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@ dml_ccflags := $(CC_FLAGS_FPU)
2929
dml_rcflags := $(CC_FLAGS_NO_FPU)
3030

3131
ifneq ($(CONFIG_FRAME_WARN),0)
32-
ifeq ($(filter y,$(CONFIG_KASAN)$(CONFIG_KCSAN)),y)
33-
frame_warn_flag := -Wframe-larger-than=3072
34-
else
35-
frame_warn_flag := -Wframe-larger-than=2048
36-
endif
32+
ifeq ($(filter y,$(CONFIG_KASAN)$(CONFIG_KCSAN)),y)
33+
frame_warn_limit := 3072
34+
else
35+
frame_warn_limit := 2048
36+
endif
37+
38+
ifeq ($(call test-lt, $(CONFIG_FRAME_WARN), $(frame_warn_limit)),y)
39+
frame_warn_flag := -Wframe-larger-than=$(frame_warn_limit)
40+
endif
3741
endif
3842

3943
CFLAGS_$(AMDDALPATH)/dc/dml/display_mode_lib.o := $(dml_ccflags)

drivers/gpu/drm/amd/display/dc/dml2/Makefile

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,19 @@ dml2_ccflags := $(CC_FLAGS_FPU)
2828
dml2_rcflags := $(CC_FLAGS_NO_FPU)
2929

3030
ifneq ($(CONFIG_FRAME_WARN),0)
31-
ifeq ($(filter y,$(CONFIG_KASAN)$(CONFIG_KCSAN)),y)
32-
ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_COMPILE_TEST),yy)
33-
frame_warn_flag := -Wframe-larger-than=4096
34-
else
35-
frame_warn_flag := -Wframe-larger-than=3072
36-
endif
37-
else
38-
frame_warn_flag := -Wframe-larger-than=2048
39-
endif
31+
ifeq ($(filter y,$(CONFIG_KASAN)$(CONFIG_KCSAN)),y)
32+
ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_COMPILE_TEST),yy)
33+
frame_warn_limit := 4096
34+
else
35+
frame_warn_limit := 3072
36+
endif
37+
else
38+
frame_warn_limit := 2048
39+
endif
40+
41+
ifeq ($(call test-lt, $(CONFIG_FRAME_WARN), $(frame_warn_limit)),y)
42+
frame_warn_flag := -Wframe-larger-than=$(frame_warn_limit)
43+
endif
4044
endif
4145

4246
subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dml2

0 commit comments

Comments
 (0)