Skip to contentSkip to conversation

drm/nouveau/fb: mark ramfuc_reg() noinline

PATCH In review Paul Bolle 1 participant 2 messages Jan 10, 2014 – Mar 7, 2014

Subsystems (3)
lore
Share & tools
lore

Paul Bolle

author
#0 lore raw

PATCH 1/1 drm/nouveau/fb: mark ramfuc_reg() noinline

Building ramnve0.o triggers a GCC warning on 32 bits x86:
drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c: In function 'nve0_ram_ctor':
drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c:1253:1: warning: the frame size of 1496 bytes is larger than 1024 bytes [-Wframe-larger-than=]

This warning is caused by ramfuc_reg(), which is inlined 74 times in nve0_ram_ctor(). Mark it noinline to silence this warning.

---
Compile tested (on 32 bits x86) only. I've no Nvidia cards at hand, so I can't really test it.

This assumes this function - a constructor, apparently - isn't called often, so the overhead calling of 74 functions is acceptable. (The same goes for the similar functions in [...]/ramnva3.c and in [...]/ramnvc0.c, though these call ramfuc_reg() not quite as often.) Perhaps there are other downsides to not inlining this function too. So proper testing will probably be needed.

 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 · 1 line
1.8.4.2
author
#1 lore raw

Paul Bolle schreef op vr 10-01-2014 om 11:37 [+0100]:

Quoted 7 lines

Building ramnve0.o triggers a GCC warning on 32 bits x86:
drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c: In function 'nve0_ram_ctor':
drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c:1253:1: warning: the frame size of 1496 bytes is larger than 1024 bytes [-Wframe-larger-than=]

This warning is caused by ramfuc_reg(), which is inlined 74 times in nve0_ram_ctor(). Mark it noinline to silence this warning.

Quoted 6 lines

---
Compile tested (on 32 bits x86) only. I've no Nvidia cards at hand, so I can't really test it.

This assumes this function - a constructor, apparently - isn't called

Here "this function" refers to nve0_ram_ctor().

Quoted 4 lines

often, so the overhead calling of 74 functions is acceptable. (The same goes for the similar functions in [...]/ramnva3.c and in [...]/ramnvc0.c, though these call ramfuc_reg() not quite as often.) Perhaps there are other downsides to not inlining this function too. So

And here it refers to ramfuc_reg(). So my writing was a bit confusing.

Quoted 1 line

proper testing will probably be needed.

Building v3.14-rc5 on 32 bit x86 still triggers this warning. Has anyone tried to review or test this patch?

Paul Bolle

Quoted 16 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 -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);