diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-17 12:32:17 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-17 12:35:50 +0100 |
commit | 06c0cc0bb42d0a3f1c72e0c0d85d15107a392069 (patch) | |
tree | 4b1acdfbae2c4a55a7d48b28423ac5d155a97411 /overlay/overlay.c | |
parent | f9a50de3dcc501e930de6c60983a4feb57121e7e (diff) |
overlay: Show GPU waits
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay/overlay.c')
-rw-r--r-- | overlay/overlay.c | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/overlay/overlay.c b/overlay/overlay.c index 62639b61..99a56a93 100644 --- a/overlay/overlay.c +++ b/overlay/overlay.c @@ -53,7 +53,8 @@ static void overlay_hide(cairo_surface_t *surface) struct overlay_gpu_top { struct gpu_top gpu_top; - struct chart chart[MAX_RINGS]; + struct chart busy[MAX_RINGS]; + struct chart wait[MAX_RINGS]; }; static void init_gpu_top(struct overlay_gpu_top *gt, @@ -70,16 +71,31 @@ static void init_gpu_top(struct overlay_gpu_top *gt, gpu_top_init(>->gpu_top); for (n = 0; n < gt->gpu_top.num_rings; n++) { - chart_init(>->chart[n], + chart_init(>->busy[n], gt->gpu_top.ring[n].name, 120); - chart_set_position(>->chart[n], 12, 12); - chart_set_size(>->chart[n], + chart_set_position(>->busy[n], 12, 12); + chart_set_size(>->busy[n], cairo_image_surface_get_width(surface)-24, 100); - chart_set_rgba(>->chart[n], - rgba[n][0], rgba[n][1], rgba[n][2], rgba[n][3]); - chart_set_range(>->chart[n], 0, 100); + chart_set_stroke_rgba(>->busy[n], + rgba[n][0], rgba[n][1], rgba[n][2], rgba[n][3]); + chart_set_mode(>->busy[n], CHART_STROKE); + chart_set_range(>->busy[n], 0, 100); + } + + for (n = 0; n < gt->gpu_top.num_rings; n++) { + chart_init(>->wait[n], + gt->gpu_top.ring[n].name, + 120); + chart_set_position(>->wait[n], 12, 12); + chart_set_size(>->wait[n], + cairo_image_surface_get_width(surface)-24, + 100); + chart_set_fill_rgba(>->wait[n], + rgba[n][0], rgba[n][1], rgba[n][2], rgba[n][3] * 0.70); + chart_set_mode(>->wait[n], CHART_FILL); + chart_set_range(>->wait[n], 0, 100); } } @@ -90,9 +106,15 @@ static void show_gpu_top(cairo_t *cr, struct overlay_gpu_top *gt) update = gpu_top_update(>->gpu_top); for (n = 0; n < gt->gpu_top.num_rings; n++) { if (update) - chart_add_sample(>->chart[n], + chart_add_sample(>->wait[n], + gt->gpu_top.ring[n].u.u.wait + gt->gpu_top.ring[n].u.u.sema); + chart_draw(>->wait[n], cr); + } + for (n = 0; n < gt->gpu_top.num_rings; n++) { + if (update) + chart_add_sample(>->busy[n], gt->gpu_top.ring[n].u.u.busy); - chart_draw(>->chart[n], cr); + chart_draw(>->busy[n], cr); } cairo_set_source_rgb(cr, 1, 1, 1); |