ilo: use a single list for queries
authorChia-I Wu <olvaffe@gmail.com>
Sun, 21 Sep 2014 15:02:55 +0000 (23:02 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Sun, 21 Sep 2014 15:36:00 +0000 (23:36 +0800)
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 <olvaffe@gmail.com>
src/gallium/drivers/ilo/ilo_3d.c
src/gallium/drivers/ilo/ilo_3d.h

index ded5c6ce464ef594e1b52ab1f4f6b14fa3ac699d..4be4ce4fc0d7101157b15c3a39d1f9dd5672a85b 100644 (file)
@@ -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) {
index 9053dcdcc992cd0418597a849eb6135c673c8422..e4a805627b0f1f14ee08f2259952e90a12c6dc4e 100644 (file)
@@ -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;
 };