]> Git Repo - J-linux.git/commitdiff
media: mediatek: vcodec: mark vdec_vp9_slice_map_counts_eob_coef noinline
authorArnd Bergmann <[email protected]>
Fri, 18 Oct 2024 15:14:42 +0000 (15:14 +0000)
committerMauro Carvalho Chehab <[email protected]>
Fri, 13 Dec 2024 16:51:35 +0000 (17:51 +0100)
With KASAN enabled, clang fails to optimize the inline version of
vdec_vp9_slice_map_counts_eob_coef() properly, leading to kilobytes
of temporary values spilled to the stack:

drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c:1526:12: error: stack frame size (2160) exceeds limit (2048) in 'vdec_vp9_slice_update_prob' [-Werror,-Wframe-larger-than]

This seems to affect all versions of clang including the latest (clang-20),
but the degree of stack overhead is different per release.

Marking the function as noinline_for_stack is harmless here and avoids
the problem completely.

Signed-off-by: Arnd Bergmann <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Signed-off-by: Sebastian Fricke <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c

index eea709d93820919d33d13184af7281fe9f0035fc..47c302745c1de9cdc7a0ea939e5dd3726a49e513 100644 (file)
@@ -1188,7 +1188,8 @@ err:
        return ret;
 }
 
-static
+/* clang stack usage explodes if this is inlined */
+static noinline_for_stack
 void vdec_vp9_slice_map_counts_eob_coef(unsigned int i, unsigned int j, unsigned int k,
                                        struct vdec_vp9_slice_frame_counts *counts,
                                        struct v4l2_vp9_frame_symbol_counts *counts_helper)
This page took 0.05413 seconds and 4 git commands to generate.