]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm: omapdrm: reduce clang stack usage
authorArnd Bergmann <arnd@arndb.de>
Tue, 10 Jun 2025 09:27:33 +0000 (11:27 +0200)
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Thu, 12 Jun 2025 18:29:52 +0000 (21:29 +0300)
The thread sanitizer makes the stack usage explode from extra variable
spills in dispc_runtime_resume:

drivers/gpu/drm/omapdrm/dss/dispc.c:4735:27: error: stack frame size (1824) exceeds limit (1280) in 'dispc_runtime_resume' [-Werror,-Wframe-larger-than]

I could not figure out what exactly is going on here, but I see that
whenever dispc_restore_context() is not inlined, that function
and its caller shrink below 900 bytes combined of stack usage.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20250610092737.2641862-1-arnd@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
drivers/gpu/drm/omapdrm/dss/dispc.c

index 533f70e8a4a6491fc2496644cdbd796ed4997cf4..cf055815077cffad554a4ae58cfd7b81edcbb0d4 100644 (file)
@@ -524,7 +524,7 @@ static void dispc_save_context(struct dispc_device *dispc)
        DSSDBG("context saved\n");
 }
 
-static void dispc_restore_context(struct dispc_device *dispc)
+static noinline_for_stack void dispc_restore_context(struct dispc_device *dispc)
 {
        int i, j;