755,34 → 755,36 |
EXPORT_SYMBOL(drm_mm_debug_table); |
|
#if defined(CONFIG_DEBUG_FS) |
int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm) |
static unsigned long drm_mm_dump_hole(struct seq_file *m, struct drm_mm_node *entry) |
{ |
struct drm_mm_node *entry; |
unsigned long total_used = 0, total_free = 0, total = 0; |
unsigned long hole_start, hole_end, hole_size; |
|
hole_start = drm_mm_hole_node_start(&mm->head_node); |
hole_end = drm_mm_hole_node_end(&mm->head_node); |
if (entry->hole_follows) { |
hole_start = drm_mm_hole_node_start(entry); |
hole_end = drm_mm_hole_node_end(entry); |
hole_size = hole_end - hole_start; |
if (hole_size) |
seq_printf(m, "0x%08lx-0x%08lx: 0x%08lx: free\n", |
hole_start, hole_end, hole_size); |
total_free += hole_size; |
return hole_size; |
} |
|
return 0; |
} |
|
int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm) |
{ |
struct drm_mm_node *entry; |
unsigned long total_used = 0, total_free = 0, total = 0; |
|
total_free += drm_mm_dump_hole(m, &mm->head_node); |
|
drm_mm_for_each_node(entry, mm) { |
seq_printf(m, "0x%08lx-0x%08lx: 0x%08lx: used\n", |
entry->start, entry->start + entry->size, |
entry->size); |
total_used += entry->size; |
if (entry->hole_follows) { |
hole_start = drm_mm_hole_node_start(entry); |
hole_end = drm_mm_hole_node_end(entry); |
hole_size = hole_end - hole_start; |
seq_printf(m, "0x%08lx-0x%08lx: 0x%08lx: free\n", |
hole_start, hole_end, hole_size); |
total_free += hole_size; |
total_free += drm_mm_dump_hole(m, entry); |
} |
} |
total = total_free + total_used; |
|
seq_printf(m, "total: %lu, used %lu free %lu\n", total, total_used, total_free); |