Skip to contentSkip to conversation

drm/nouveau/fb: Prevent inlining of ramfuc_reg

PATCH In review Stéphane Marchesin 2 participants 2 messages Jun 27, 2014 – Jun 28, 2014 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau/fb: Prevent inlining of ramfuc_reg

When gcc 4.8 inlines this function, it eats up 16 bytes on the stack every time. Eventually we hit warnings because our stack grew too much:

ramnve0.c:1383:1: error: the frame size of 1496 bytes is larger than 1024 bytes

We fix this by preventing inlining for this function.

---
 drivers/gpu/drm/nouveau/core/subdev/fb/ramfuc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/core/subdev/fb/ramfuc.h +1 -1
index 0f57fcf..04e3849 100644
@@ -26,7 +26,7 @@ ramfuc_reg2(u32 addr1, u32 addr2)
 	};
 }
 
-static inline struct ramfuc_reg
+static noinline struct ramfuc_reg
 ramfuc_reg(u32 addr)
 {
 	return ramfuc_reg2(addr, addr);
Signature · 6 lines
2.0.0.526.g5318336

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 1403900245-1541-1-git-send-email-marcheu-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org

#2 lore raw
Quoted 8 lines · Stéphane Marchesin

When gcc 4.8 inlines this function, it eats up 16 bytes on the stack every time. Eventually we hit warnings because our stack grew too much:

ramnve0.c:1383:1: error: the frame size of 1496 bytes is larger than 1024 bytes

We fix this by preventing inlining for this function.

Got it. Thanks!

Quoted 22 lines
---
 drivers/gpu/drm/nouveau/core/subdev/fb/ramfuc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/core/subdev/fb/ramfuc.h +1 -2
index 0f57fcf..04e3849 100644
@@ -26,7 +26,7 @@ ramfuc_reg2(u32 addr1, u32 addr2)
        };
 }
 
-static inline struct ramfuc_reg
+static noinline struct ramfuc_reg
 ramfuc_reg(u32 addr)
 {
        return ramfuc_reg2(addr, addr);
--

2.0.0.526.g5318336

Quoted 4 lines

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau