[Mesa-dev] [PATCH 1/2] nv50: fix 64 bits queries, based on nvc0

Ilia Mirkin imirkin at alum.mit.edu
Thu May 21 12:33:54 PDT 2015


So... this doesn't fix a known issue? Just because nvc0 does
something, doesn't make it right. nvc0 has a ton of internal mp/pm
stats too, which are 64-bit, and provide other differences.

As an aside, nv50_query_end for PIPE_QUERY_TIMESTAMP_DISJOINT *is*
busted... it sets q->ready = TRUE and then immediately sets it to
false :(

On Thu, May 21, 2015 at 3:28 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> According to nvc0, 64-bits queries use a fence to make sure
> the result is available.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/gallium/drivers/nouveau/nv50/nv50_query.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_query.c b/src/gallium/drivers/nouveau/nv50/nv50_query.c
> index 6690aa2..a3c8841 100644
> --- a/src/gallium/drivers/nouveau/nv50/nv50_query.c
> +++ b/src/gallium/drivers/nouveau/nv50/nv50_query.c
> @@ -46,6 +46,7 @@ struct nv50_query {
>     boolean flushed;
>     boolean is64bit;
>     struct nouveau_mm_allocation *mm;
> +   struct nouveau_fence *fence;
>  };
>
>  #define NV50_QUERY_ALLOC_SPACE 256
> @@ -92,6 +93,7 @@ static void
>  nv50_query_destroy(struct pipe_context *pipe, struct pipe_query *pq)
>  {
>     nv50_query_allocate(nv50_context(pipe), nv50_query(pq), 0);
> +   nouveau_fence_ref(NULL, &nv50_query(pq)->fence);
>     FREE(nv50_query(pq));
>  }
>
> @@ -260,12 +262,22 @@ nv50_query_end(struct pipe_context *pipe, struct pipe_query *pq)
>        break;
>     }
>     q->ready = q->flushed = FALSE;
> +
> +   if (q->is64bit)
> +      nouveau_fence_ref(nv50->screen->base.fence.current, &q->fence);
>  }
>
>  static INLINE boolean
>  nv50_query_ready(struct nv50_query *q)
>  {
> -   return q->ready || (!q->is64bit && (q->data[0] == q->sequence));
> +   if (q->is64bit) {
> +      if (nouveau_fence_signalled(q->fence))
> +         return TRUE;
> +   } else {
> +      if (q->data[0] == q->sequence)
> +         return TRUE;
> +   }
> +   return FALSE;
>  }
>
>  static boolean
> --
> 2.4.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list