media: verisilicon: fix excessive stack usage
authorArnd Bergmann <arnd@arndb.de>
Fri, 16 Jun 2023 14:48:47 +0000 (16:48 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 14 Jul 2023 07:14:09 +0000 (09:14 +0200)
commit7ee8acd1b803502878992acd6f99e61f1e8c7a25
tree78864e905824fe3119e3457e61d04938304091b4
parentd05dea76d4a813eb959ba0a150c45246d54e7148
media: verisilicon: fix excessive stack usage

In some configurations, gcc decides not to inline the register accessor
functions, which in turn leads to lots of temporary hantro_reg structures
on the stack that cannot be eliminated because they escape into an
uninlined function:

drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c:1022:1: warning: the frame size of 1112 bytes is larger than 1024 bytes [-Wframe-larger-than=]

Mark all of these as __always_inline so the compiler is able to completely
eliminate the temporary structures instead, which brings the stack usage
back down to just the normal local variables.

Closes: https://lore.kernel.org/oe-kbuild-all/202306151506.goHEegOd-lkp@intel.com/
[hverkuil: fix function prototype alignment, wrap commit log]

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 727a400686a2 ("media: verisilicon: Add Rockchip AV1 decoder")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/verisilicon/hantro.h