summaryrefslogtreecommitdiff
path: root/overlay/overlay.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-27 15:19:58 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-27 15:23:10 +0100
commit65d2481900c619846eddadb85086edbc578d6c17 (patch)
tree548fb3d1f66297f8ae650a67d8b9113b3538a6ae /overlay/overlay.c
parentddcd1b2ee5645475725a8e2f78917fa3e7d57c1b (diff)
overlay: read rc6 status from perf
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay/overlay.c')
-rw-r--r--overlay/overlay.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/overlay/overlay.c b/overlay/overlay.c
index d1eb158c..1cdf7391 100644
--- a/overlay/overlay.c
+++ b/overlay/overlay.c
@@ -582,28 +582,31 @@ static void show_gpu_freq(struct overlay_context *ctx, struct overlay_gpu_freq *
len = sprintf(buf, "RC6: %d%%", gf->rc6.rc6_combined);
cairo_set_source_rgba(ctx->cr, 1, 1, 1, 1);
cairo_move_to(ctx->cr, PAD, y);
- if (gf->rc6.rc6_combined && !is_power_of_two(gf->rc6.enabled)) {
+ if (gf->rc6.rc6_combined) {
int need_comma = 0;
+ int rewind = len;
len += sprintf(buf + len, " (");
- if (gf->rc6.enabled & 1) {
+ if (gf->rc6.rc6) {
len += sprintf(buf + len, "%src6=%d%%",
need_comma ? ", " : "",
gf->rc6.rc6);
- need_comma = 1;
+ need_comma++;
}
- if (gf->rc6.enabled & 2) {
+ if (gf->rc6.rc6p) {
len += sprintf(buf + len, "%src6p=%d%%",
need_comma ? ", " : "",
gf->rc6.rc6p);
- need_comma = 1;
+ need_comma++;
}
- if (gf->rc6.enabled & 4) {
+ if (gf->rc6.rc6pp) {
len += sprintf(buf + len, "%src6pp=%d%%",
need_comma ? ", " : "",
gf->rc6.rc6pp);
- need_comma = 1;
+ need_comma++;
}
sprintf(buf + len, ")");
+ if (need_comma <= 1)
+ buf[rewind] = '\0';
}
cairo_show_text(ctx->cr, buf);
y += 14;