diff options
author | Marek Olšák <marek.olsak@amd.com> | 2017-06-21 20:45:38 +0200 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2017-06-26 02:17:03 +0200 |
commit | 5fa69be3c8894a6f313080c3afec7063d5356395 (patch) | |
tree | a90448a576095e0102b7d04452ffb41da9075789 /src/gallium | |
parent | 833f3c1c31b1c4dc7742d83eb2db63dcc9b42e1b (diff) |
mesa/glthread: add glthread "perf" counters and pass them to gallium HUD
for HUD integration in following commits. This valuable profiling data
will allow us to see on the HUD how well glthread is able to utilize
parallelism. This is better than benchmarking, because you can see
exactly what's happening and you don't have to be CPU-bound.
u_threaded_context has the same counters.
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/hud/hud_context.c | 8 | ||||
-rw-r--r-- | src/gallium/auxiliary/hud/hud_context.h | 5 | ||||
-rw-r--r-- | src/gallium/auxiliary/hud/hud_private.h | 2 | ||||
-rw-r--r-- | src/gallium/include/state_tracker/st_api.h | 4 | ||||
-rw-r--r-- | src/gallium/state_trackers/dri/dri_screen.c | 6 |
5 files changed, 23 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c index f32831b55f..551cea97a7 100644 --- a/src/gallium/auxiliary/hud/hud_context.c +++ b/src/gallium/auxiliary/hud/hud_context.c @@ -1694,3 +1694,11 @@ hud_destroy(struct hud_context *hud) pipe_resource_reference(&hud->font.texture, NULL); FREE(hud); } + +void +hud_add_queue_for_monitoring(struct hud_context *hud, + struct util_queue_monitoring *queue_info) +{ + assert(!hud->monitored_queue); + hud->monitored_queue = queue_info; +} diff --git a/src/gallium/auxiliary/hud/hud_context.h b/src/gallium/auxiliary/hud/hud_context.h index abf2ad5864..5a7e13b273 100644 --- a/src/gallium/auxiliary/hud/hud_context.h +++ b/src/gallium/auxiliary/hud/hud_context.h @@ -32,6 +32,7 @@ struct hud_context; struct cso_context; struct pipe_context; struct pipe_resource; +struct util_queue_monitoring; struct hud_context * hud_create(struct pipe_context *pipe, struct cso_context *cso); @@ -42,4 +43,8 @@ hud_destroy(struct hud_context *hud); void hud_draw(struct hud_context *hud, struct pipe_resource *tex); +void +hud_add_queue_for_monitoring(struct hud_context *hud, + struct util_queue_monitoring *queue_info); + #endif diff --git a/src/gallium/auxiliary/hud/hud_private.h b/src/gallium/auxiliary/hud/hud_private.h index f765bd9649..fba919e541 100644 --- a/src/gallium/auxiliary/hud/hud_private.h +++ b/src/gallium/auxiliary/hud/hud_private.h @@ -40,6 +40,8 @@ struct hud_context { struct hud_batch_query_context *batch_query; struct list_head pane_list; + struct util_queue_monitoring *monitored_queue; + /* states */ struct pipe_blend_state no_blend, alpha_blend; struct pipe_depth_stencil_alpha_state dsa; diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h index 47d06c869c..d641092aa2 100644 --- a/src/gallium/include/state_tracker/st_api.h +++ b/src/gallium/include/state_tracker/st_api.h @@ -179,6 +179,7 @@ enum st_manager_param { struct pipe_context; struct pipe_resource; struct pipe_fence_handle; +struct util_queue_monitoring; /** * Used in st_context_iface->get_resource_for_egl_image. @@ -474,7 +475,8 @@ struct st_manager * Call the loader function setBackgroundContext. Called from the worker * thread. */ - void (*set_background_context)(struct st_context_iface *stctxi); + void (*set_background_context)(struct st_context_iface *stctxi, + struct util_queue_monitoring *queue_info); }; /** diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c index aa215b09a2..6b58830e0b 100644 --- a/src/gallium/state_trackers/dri/dri_screen.c +++ b/src/gallium/state_trackers/dri/dri_screen.c @@ -447,7 +447,8 @@ dri_postprocessing_init(struct dri_screen *screen) } static void -dri_set_background_context(struct st_context_iface *st) +dri_set_background_context(struct st_context_iface *st, + struct util_queue_monitoring *queue_info) { struct dri_context *ctx = (struct dri_context *)st->st_manager_private; const __DRIbackgroundCallableExtension *backgroundCallable = @@ -459,6 +460,9 @@ dri_set_background_context(struct st_context_iface *st) */ assert(backgroundCallable); backgroundCallable->setBackgroundContext(ctx->cPriv->loaderPrivate); + + if (ctx->hud) + hud_add_queue_for_monitoring(ctx->hud, queue_info); } unsigned |