From 41f072a4f8fd3f3347789ee4186af0d4fcf69622 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sun, 21 Sep 2014 23:02:55 +0800 Subject: [PATCH] ilo: use a single list for queries We used different lists for different types of queries because we wanted to update software queries quickly. Now that there is no software queries, we are fine with a single list. Signed-off-by: Chia-I Wu --- src/gallium/drivers/ilo/ilo_3d.c | 71 ++++---------------------------- src/gallium/drivers/ilo/ilo_3d.h | 6 +-- 2 files changed, 8 insertions(+), 69 deletions(-) diff --git a/src/gallium/drivers/ilo/ilo_3d.c b/src/gallium/drivers/ilo/ilo_3d.c index ded5c6ce464..4be4ce4fc0d 100644 --- a/src/gallium/drivers/ilo/ilo_3d.c +++ b/src/gallium/drivers/ilo/ilo_3d.c @@ -217,29 +217,8 @@ ilo_3d_begin_query(struct pipe_context *pipe, struct ilo_query *q) query_begin_bo(hw3d, q); - switch (q->type) { - case PIPE_QUERY_OCCLUSION_COUNTER: - list_add(&q->list, &hw3d->occlusion_queries); - break; - case PIPE_QUERY_TIMESTAMP: - /* no-op */ - break; - case PIPE_QUERY_TIME_ELAPSED: - list_add(&q->list, &hw3d->time_elapsed_queries); - break; - case PIPE_QUERY_PRIMITIVES_GENERATED: - list_add(&q->list, &hw3d->prim_generated_queries); - break; - case PIPE_QUERY_PRIMITIVES_EMITTED: - list_add(&q->list, &hw3d->prim_emitted_queries); - break; - case PIPE_QUERY_PIPELINE_STATISTICS: - list_add(&q->list, &hw3d->pipeline_statistics_queries); - break; - default: - assert(!"unknown query type"); - break; - } + if (q->in_pairs) + list_add(&q->list, &hw3d->queries); } void @@ -286,24 +265,8 @@ ilo_3d_own_cp(struct ilo_cp *cp, void *data) ilo_builder_batch_snapshot(&hw3d->cp->builder, &snapshot); - /* resume occlusion queries */ - LIST_FOR_EACH_ENTRY(q, &hw3d->occlusion_queries, list) - query_begin_bo(hw3d, q); - - /* resume timer queries */ - LIST_FOR_EACH_ENTRY(q, &hw3d->time_elapsed_queries, list) - query_begin_bo(hw3d, q); - - /* resume prim generated queries */ - LIST_FOR_EACH_ENTRY(q, &hw3d->prim_generated_queries, list) - query_begin_bo(hw3d, q); - - /* resume prim emitted queries */ - LIST_FOR_EACH_ENTRY(q, &hw3d->prim_emitted_queries, list) - query_begin_bo(hw3d, q); - - /* resume pipeline statistics queries */ - LIST_FOR_EACH_ENTRY(q, &hw3d->pipeline_statistics_queries, list) + /* resume queries */ + LIST_FOR_EACH_ENTRY(q, &hw3d->queries, list) query_begin_bo(hw3d, q); if (!ilo_builder_validate(&hw3d->cp->builder, 0, NULL)) { @@ -329,24 +292,8 @@ ilo_3d_release_cp(struct ilo_cp *cp, void *data) assert(ilo_cp_space(hw3d->cp) >= hw3d->owner.reserve); - /* pause occlusion queries */ - LIST_FOR_EACH_ENTRY(q, &hw3d->occlusion_queries, list) - query_end_bo(hw3d, q); - - /* pause timer queries */ - LIST_FOR_EACH_ENTRY(q, &hw3d->time_elapsed_queries, list) - query_end_bo(hw3d, q); - - /* pause prim generated queries */ - LIST_FOR_EACH_ENTRY(q, &hw3d->prim_generated_queries, list) - query_end_bo(hw3d, q); - - /* pause prim emitted queries */ - LIST_FOR_EACH_ENTRY(q, &hw3d->prim_emitted_queries, list) - query_end_bo(hw3d, q); - - /* pause pipeline statistics queries */ - LIST_FOR_EACH_ENTRY(q, &hw3d->pipeline_statistics_queries, list) + /* pause queries */ + LIST_FOR_EACH_ENTRY(q, &hw3d->queries, list) query_end_bo(hw3d, q); } @@ -385,11 +332,7 @@ ilo_3d_create(struct ilo_cp *cp, const struct ilo_dev_info *dev) hw3d->new_batch = true; - list_inithead(&hw3d->occlusion_queries); - list_inithead(&hw3d->time_elapsed_queries); - list_inithead(&hw3d->prim_generated_queries); - list_inithead(&hw3d->prim_emitted_queries); - list_inithead(&hw3d->pipeline_statistics_queries); + list_inithead(&hw3d->queries); hw3d->pipeline = ilo_3d_pipeline_create(cp, dev); if (!hw3d->pipeline) { diff --git a/src/gallium/drivers/ilo/ilo_3d.h b/src/gallium/drivers/ilo/ilo_3d.h index 9053dcdcc99..e4a805627b0 100644 --- a/src/gallium/drivers/ilo/ilo_3d.h +++ b/src/gallium/drivers/ilo/ilo_3d.h @@ -51,11 +51,7 @@ struct ilo_3d { bool cond; } render_condition; - struct list_head occlusion_queries; - struct list_head time_elapsed_queries; - struct list_head prim_generated_queries; - struct list_head prim_emitted_queries; - struct list_head pipeline_statistics_queries; + struct list_head queries; struct ilo_3d_pipeline *pipeline; }; -- 2.30.2