[PATCH] drm/amd/display: Reduce stack size for dml21_ModeSupportAndSystemConfigurationFull

Arnd Bergmann arnd at kernel.org
Tue Sep 14 21:56:11 UTC 2021


On Tue, Sep 14, 2021 at 11:05 PM Harry Wentland <harry.wentland at amd.com> wrote:
>
> [Why & How]
> With Werror enabled in the kernel we were failing the clang build since
> dml21_ModeSupportAndSystemConfigurationFull's stack frame is 1064 when
> building with clang, and exceeding the default 1024 stack frame limit.
>
> The culprit seems to be the Pipe struct, so pull the relevant block
> out into its own sub-function.

I suspect it's not the Pipe struct but rather the way that you call another
function with a crazy number of arguments here. After your change,
this likely gets inlined and you avoid the problem, so the patch ends
up doing the right thing.

If you do more patches like this, I would suggest mentioning the new
stack usage of the calling function and the new noinline function, to
make sure that the combined number isn't actually worse than the old
number.

You can get these numbers by recompiling the file with the frame
size warning set to a low value, e.g. adding -Wframe-larger-than=100
to the command line.

Acked-by: Arnd Bergmann <arnd at arndb.de>


More information about the amd-gfx mailing list