etnaviv: implement set_active_query_state(..) for hw queries
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Tue, 28 May 2019 19:43:51 +0000 (21:43 +0200)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Tue, 4 Jun 2019 12:58:02 +0000 (14:58 +0200)
Clear w/ quad uses a normal draw which adds up to OQ. st/meta
uses set_active_query_state(..) to tell the driver to pause
queries in such cases.

Fixes spec@arb_occlusion_query@occlusion_query_meta_save piglit.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
src/gallium/drivers/etnaviv/etnaviv_query.c

index b076e87e78245f90e4faa626873b14e736d54781..bd75ca90b8a297f3d17644da589b15869a0d66a8 100644 (file)
@@ -134,8 +134,17 @@ etna_get_driver_query_group_info(struct pipe_screen *pscreen, unsigned index,
 }
 
 static void
-etna_set_active_query_state(struct pipe_context *pipe, boolean enable)
+etna_set_active_query_state(struct pipe_context *pctx, boolean enable)
 {
+   struct etna_context *ctx = etna_context(pctx);
+
+   if (enable) {
+      list_for_each_entry(struct etna_hw_query, hq, &ctx->active_hw_queries, node)
+         etna_hw_query_resume(hq, ctx);
+   } else {
+      list_for_each_entry(struct etna_hw_query, hq, &ctx->active_hw_queries, node)
+         etna_hw_query_suspend(hq, ctx);
+   }
 }
 
 void