[Mesa-dev] [PATCH] r600g: Use virtual address for PIPE_QUERY_SO* in r600_emit_query_end

Alex Deucher alexdeucher at gmail.com
Mon Mar 25 15:15:09 PDT 2013


On Mon, Mar 25, 2013 at 6:11 PM, Martin Andersson <g02maran at gmail.com> wrote:
> Virtual address is used for PIPE_QUERY_SO* queries in
> r600_emit_query_begin, but not in r600_emit_query_end.
>
> This will trigger a GPU fault when one of those queries is
> made and virtual address is enabled.

Should also go to the 9.1 branch.

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  src/gallium/drivers/r600/r600_query.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/r600/r600_query.c b/src/gallium/drivers/r600/r600_query.c
> index 0335189..782ad26 100644
> --- a/src/gallium/drivers/r600/r600_query.c
> +++ b/src/gallium/drivers/r600/r600_query.c
> @@ -186,10 +186,11 @@ static void r600_emit_query_end(struct r600_context *ctx, struct r600_query *que
>         case PIPE_QUERY_PRIMITIVES_GENERATED:
>         case PIPE_QUERY_SO_STATISTICS:
>         case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
> +               va += query->buffer.results_end + query->result_size/2;
>                 cs->buf[cs->cdw++] = PKT3(PKT3_EVENT_WRITE, 2, 0);
>                 cs->buf[cs->cdw++] = EVENT_TYPE(EVENT_TYPE_SAMPLE_STREAMOUTSTATS) | EVENT_INDEX(3);
> -               cs->buf[cs->cdw++] = query->buffer.results_end + query->result_size/2;
> -               cs->buf[cs->cdw++] = 0;
> +               cs->buf[cs->cdw++] = va;
> +               cs->buf[cs->cdw++] = (va >> 32UL) & 0xFF;
>                 break;
>         case PIPE_QUERY_TIME_ELAPSED:
>                 va += query->buffer.results_end + query->result_size/2;
> --
> 1.8.2
>
> _______________________________________________
> 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