summaryrefslogtreecommitdiff
path: root/overlay
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-18 18:24:43 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-18 18:24:43 +0100
commit3f5129471fdcc81ae4291bfa717e497d223e35a1 (patch)
tree3b25009fc3e5cd97b849a3d7692ad3c3bc7fdcc6 /overlay
parente1ed5606c6dd9d320b97582a9575e2b86a17e844 (diff)
overlay: Convert gem objects to megabytes
Less confusing, I hope. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay')
-rw-r--r--overlay/overlay.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/overlay/overlay.c b/overlay/overlay.c
index 56dd2e1f..92eca694 100644
--- a/overlay/overlay.c
+++ b/overlay/overlay.c
@@ -488,16 +488,19 @@ static void show_gem_objects(struct overlay_context *ctx, struct overlay_gem_obj
chart_draw(&go->gtt, ctx->cr);
chart_draw(&go->aperture, ctx->cr);
- sprintf(buf, "Total: %ld bytes, %d objects",
- go->gem_objects.total_bytes, go->gem_objects.total_count);
+ sprintf(buf, "Total: %ldMB, %d objects",
+ go->gem_objects.total_bytes >> 20, go->gem_objects.total_count);
cairo_set_source_rgba(ctx->cr, 1, 1, 1, 1);
cairo_move_to(ctx->cr, 12, y);
cairo_show_text(ctx->cr, buf);
y += 14;
for (comm = go->gem_objects.comm; comm; comm = comm->next) {
- sprintf(buf, " %s: %ld bytes, %d objects",
- comm->name, comm->bytes, comm->count);
+ if ((comm->bytes >> 20) == 0)
+ break;
+
+ sprintf(buf, " %s: %ldMB, %d objects",
+ comm->name, comm->bytes >> 20, comm->count);
cairo_set_source_rgba(ctx->cr, 1, 1, 1, 1);
cairo_move_to(ctx->cr, 12, y);
cairo_show_text(ctx->cr, buf);