summaryrefslogtreecommitdiff
path: root/overlay/overlay.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-18 11:15:08 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-18 11:22:52 +0100
commit98572f0446e62eb889f28efe39fc1501e96093c1 (patch)
tree8083751ac6ddcee17a4068b53f4cb4c5090c1b9d /overlay/overlay.c
parentb79a28355ded0118f6e53f745684d67c8201bf30 (diff)
overlay: Count flips per plane
Stop the misleading double-accounting of flips when we have multiple displays active. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay/overlay.c')
-rw-r--r--overlay/overlay.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/overlay/overlay.c b/overlay/overlay.c
index 42327111..2ff9e9ca 100644
--- a/overlay/overlay.c
+++ b/overlay/overlay.c
@@ -321,8 +321,23 @@ static void show_gpu_perf(struct overlay_context *ctx, struct overlay_gpu_perf *
prev = &comm->next;
}
- sprintf(buf, "Flips: %d", gp->gpu_perf.flip_complete);
- gp->gpu_perf.flip_complete = 0;
+ {
+ int has_flips = 0, len;
+ for (n = 0; n < 4; n++) {
+ if (gp->gpu_perf.flip_complete[n])
+ has_flips = n + 1;
+ }
+ if (has_flips) {
+ len = sprintf(buf, "Flips:");
+ for (n = 0; n < has_flips; n++)
+ len += sprintf(buf + len, "%s %d",
+ n ? "," : "",
+ gp->gpu_perf.flip_complete[n]);
+ } else {
+ sprintf(buf, "Flips: 0");
+ }
+ memset(gp->gpu_perf.flip_complete, 0, sizeof(gp->gpu_perf.flip_complete));
+ }
cairo_set_source_rgba(ctx->cr, 1, 1, 1, 1);
cairo_move_to(ctx->cr, 12, y);
cairo_show_text(ctx->cr, buf);