mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-22 07:16:14 +00:00
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>
This commit is contained in:
parent
b79a28355d
commit
98572f0446
@ -264,7 +264,9 @@ static int busy_end(struct gpu_perf *gp, const void *event)
|
||||
|
||||
static int flip_complete(struct gpu_perf *gp, const void *event)
|
||||
{
|
||||
gp->flip_complete++;
|
||||
const struct sample_event *sample = event;
|
||||
|
||||
gp->flip_complete[sample->raw[0]]++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ struct gpu_perf {
|
||||
int (*func)(struct gpu_perf *, const void *);
|
||||
} *sample;
|
||||
|
||||
int flip_complete;
|
||||
int flip_complete[4];
|
||||
struct gpu_perf_comm {
|
||||
struct gpu_perf_comm *next;
|
||||
char name[256];
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user