drm/radeon: reduce stack frame size for radeon_cs_ioctl
Subsystems (2)
PATCH 1/1 drm/radeon: reduce stack frame size for radeon_cs_ioctl
From: Arnd Bergmann <[email protected]>
Clang inlines radeon_cs_parser_relocs() into radeon_cs_ioctl(), and since both of these use a lot of stack space, the sum of them can make it exceed a limit of 1280 bytes:
drivers/gpu/drm/radeon/radeon_cs.c:669:5: error: stack frame size (1328) exceeds limit (1280) in 'radeon_cs_ioctl' [-Werror,-Wframe-larger-than]
669 | int radeon_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
| ^
Mark radeon_cs_parser_relocs as noinline_for_stack, so clang and gcc both behave in a consistent way. Calling into radeon_cs_parser_relocs() still uses a lot of stack space here, but this is not any worse than it already was, and the other code paths are better now.
--- drivers/gpu/drm/radeon/radeon_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_cs.c +1 -1
@@ -78,7 +78,7 @@ static void radeon_cs_buckets_get_list(struct radeon_cs_buckets *b, } } -static int radeon_cs_parser_relocs (struct radeon_cs_parser *p) +static noinline_for_stack int radeon_cs_parser_relocs(struct radeon_cs_parser *p) {struct radeon_cs_chunk *chunk;struct radeon_cs_buckets buckets;
Signature · 1 line
2.39.5