]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/i915/wm: reduce stack usage in skl_print_wm_changes()
authorArnd Bergmann <arnd@arndb.de>
Fri, 20 Jun 2025 11:37:45 +0000 (13:37 +0200)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 24 Jun 2025 21:22:36 +0000 (17:22 -0400)
commitc9c325072b35671f26c92c9c7ba6fe5bb1ab111a
tree816c8f25c43c83731919e863a7c4eb7cde4ea92e
parentc4c1a9153079242465ce9a3d9753db8324c4b2bb
drm/i915/wm: reduce stack usage in skl_print_wm_changes()

When KMSAN is enabled, this function causes has a rather excessive stack usage:

drivers/gpu/drm/i915/display/skl_watermark.c:2977:1: error: stack frame size (1432) exceeds limit (1408) in 'skl_compute_wm' [-Werror,-Wframe-larger-than]

This is apparently all caused by the varargs calls to drm_dbg_kms(). Inlining
this into skl_compute_wm() means that any function called by skl_compute_wm()
has its own stack on top of that.

Move the worst bit into a separate function marked as noinline_for_stack to
limit that to the one code path that actually needs it.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20250620113748.3869160-1-arnd@kernel.org
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/display/skl_watermark.c