<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Reviewed-by: Tim Rowley <<a href="mailto:timothy.o.rowley@intel.com" class="">timothy.o.rowley@intel.com</a>>
<div class=""><br class="">
<div style="">
<blockquote type="cite" class="">
<div class="">On Dec 1, 2016, at 7:08 PM, Bruce Cherniak <<a href="mailto:bruce.cherniak@intel.com" class="">bruce.cherniak@intel.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">The active_query count was incorrect for query types that don't require<br class="">
a begin_query.  Removed the unnecessary assert.<br class="">
---<br class="">
src/gallium/drivers/swr/swr_query.cpp | 13 +++++++------<br class="">
1 file changed, 7 insertions(+), 6 deletions(-)<br class="">
<br class="">
diff --git a/src/gallium/drivers/swr/swr_query.cpp b/src/gallium/drivers/swr/swr_query.cpp<br class="">
index a95e0d8..6eb0781 100644<br class="">
--- a/src/gallium/drivers/swr/swr_query.cpp<br class="">
+++ b/src/gallium/drivers/swr/swr_query.cpp<br class="">
@@ -165,8 +165,9 @@ swr_begin_query(struct pipe_context *pipe, struct pipe_query *q)<br class="">
   /* Initialize Results */<br class="">
   memset(&pq->result, 0, sizeof(pq->result));<br class="">
   switch (pq->type) {<br class="">
+   case PIPE_QUERY_GPU_FINISHED:<br class="">
   case PIPE_QUERY_TIMESTAMP:<br class="">
-      /* nothing to do */<br class="">
+      /* nothing to do, but don't want the default */<br class="">
      break;<br class="">
   case PIPE_QUERY_TIME_ELAPSED:<br class="">
      pq->result.timestamp_start = swr_get_timestamp(pipe->screen);<br class="">
@@ -181,10 +182,10 @@ swr_begin_query(struct pipe_context *pipe, struct pipe_query *q)<br class="">
         SwrEnableStatsFE(ctx->swrContext, TRUE);<br class="">
         SwrEnableStatsBE(ctx->swrContext, TRUE);<br class="">
      }<br class="">
+      ctx->active_queries++;<br class="">
      break;<br class="">
   }<br class="">
<br class="">
-   ctx->active_queries++;<br class="">
<br class="">
   return true;<br class="">
}<br class="">
@@ -195,11 +196,10 @@ swr_end_query(struct pipe_context *pipe, struct pipe_query *q)<br class="">
   struct swr_context *ctx = swr_context(pipe);<br class="">
   struct swr_query *pq = swr_query(q);<br class="">
<br class="">
-   assert(ctx->active_queries<br class="">
-          && "swr_end_query, there are no active queries!");<br class="">
-   ctx->active_queries--;<br class="">
-<br class="">
   switch (pq->type) {<br class="">
+   case PIPE_QUERY_GPU_FINISHED:<br class="">
+      /* nothing to do, but don't want the default */<br class="">
+      break;<br class="">
   case PIPE_QUERY_TIMESTAMP:<br class="">
   case PIPE_QUERY_TIME_ELAPSED:<br class="">
      pq->result.timestamp_end = swr_get_timestamp(pipe->screen);<br class="">
@@ -214,6 +214,7 @@ swr_end_query(struct pipe_context *pipe, struct pipe_query *q)<br class="">
      swr_fence_submit(ctx, pq->fence);<br class="">
<br class="">
      /* Only change stat collection if there are no active queries */<br class="">
+      ctx->active_queries--;<br class="">
      if (ctx->active_queries == 0) {<br class="">
         SwrEnableStatsFE(ctx->swrContext, FALSE);<br class="">
         SwrEnableStatsBE(ctx->swrContext, FALSE);<br class="">
-- <br class="">
2.7.4<br class="">
<br class="">
_______________________________________________<br class="">
mesa-dev mailing list<br class="">
<a href="mailto:mesa-dev@lists.freedesktop.org" class="">mesa-dev@lists.freedesktop.org</a><br class="">
https://lists.freedesktop.org/mailman/listinfo/mesa-dev<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>