overlay: Fix display of rc6 states

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-08-20 21:58:22 +01:00
parent b98bade56e
commit 0b78c1632c

View File

@ -481,24 +481,25 @@ static void show_gpu_freq(struct overlay_context *ctx, struct overlay_gpu_freq *
cairo_move_to(ctx->cr, 12, y); cairo_move_to(ctx->cr, 12, y);
cairo_show_text(ctx->cr, buf); cairo_show_text(ctx->cr, buf);
if (gf->rc6.rc6_combined && !is_power_of_two(gf->rc6.enabled)) { if (gf->rc6.rc6_combined && !is_power_of_two(gf->rc6.enabled)) {
char *txt;
len = 0; len = 0;
sprintf(buf, " ("); txt = buf + sprintf(buf, " (");
if (gf->rc6.enabled & 1) { if (gf->rc6.enabled & 1) {
if (len) if (len)
len += sprintf(buf + 3 + len, ", "); len += sprintf(txt + len, ", ");
len += sprintf(buf + 3 + len, "rc6=%d%%", gf->rc6.rc6); len += sprintf(txt + len, "rc6=%d%%", gf->rc6.rc6);
} }
if (gf->rc6.enabled & 2) { if (gf->rc6.enabled & 2) {
if (len) if (len)
len += sprintf(buf + 3 + len, ", "); len += sprintf(txt + len, ", ");
len += sprintf(buf + 3 + len, "rc6p=%d%%", gf->rc6.rc6p); len += sprintf(txt + len, "rc6p=%d%%", gf->rc6.rc6p);
} }
if (gf->rc6.enabled & 4) { if (gf->rc6.enabled & 4) {
if (len) if (len)
len += sprintf(buf + 3 + len, ", "); len += sprintf(txt + len, ", ");
len += sprintf(buf + 3 + len, "rc6pp=%d%%", gf->rc6.rc6pp); len += sprintf(txt + len, "rc6pp=%d%%", gf->rc6.rc6pp);
} }
sprintf(buf + 3 + len, ")"); sprintf(txt + len, ")");
cairo_show_text(ctx->cr, buf); cairo_show_text(ctx->cr, buf);
} }
y += 14; y += 14;