drm/buddy: Fix drm_buddy_print() to work with printk printers
Subsystems (3)
PATCH 1/1 drm/buddy: Fix drm_buddy_print() to work with printk printers
If we try to use printk-based drm_printer, like drm_dbg_printer(), output from drm_buddy_print() will be split into several lines:
[drm] chunk_size: 1024KiB, total: 7MiB, free: 7MiB, clear_free: 0MiB [drm] order- 2
[drm] free: 4 MiB
[drm] , blocks: 1
[drm] order- 1
[drm] free: 2 MiB
[drm] , blocks: 1
[drm] order- 0
[drm] free: 1 MiB
[drm] , blocks: 1
Fix that by using single drm_printf() per line.
Signed-off-by Michal Wajdeczko <[email protected]>
Cc Arunpravin Paneer Selvam <[email protected]>
--- drivers/gpu/drm/drm_buddy.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/gpu/drm/drm_buddy.c +3 -8
@@ -1139,15 +1139,10 @@ void drm_buddy_print(struct drm_buddy *mm, struct drm_printer *p) count++; } -drm_printf (p,"order-%2d " , order); - free = count * (mm->chunk_size << order); -if (free <SZ_1M ) -drm_printf (p,"free: %8llu KiB" , free >>10 ); -else -drm_printf (p,"free: %8llu MiB" , free >>20 ); - -drm_printf (p,", blocks: %llu\n" , count); +drm_printf (p,"order-%2d free: %8llu %s, blocks: %llu\n" , + order, free >> (free <SZ_1M ?10 :20 ), + free <SZ_1M ?"KiB" :"MiB" , count); } }EXPORT_SYMBOL (drm_buddy_print);
Signature · 1 line
2.43.0