[Mesa-dev] [PATCH] radeon: ensure that timing/profiling queries are suspended on flush

Marek Olšák maraeo at gmail.com
Thu Nov 19 08:06:27 PST 2015


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Wed, Nov 18, 2015 at 6:45 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> The queries_suspended_for_flush flag is redundant because suspended queries
> are not removed from their respective linked list.
> ---
>  src/gallium/drivers/radeon/r600_pipe_common.c | 13 ++++++-------
>  src/gallium/drivers/radeon/r600_pipe_common.h |  2 --
>  2 files changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
> index 60be412..f03dcd9 100644
> --- a/src/gallium/drivers/radeon/r600_pipe_common.c
> +++ b/src/gallium/drivers/radeon/r600_pipe_common.c
> @@ -27,6 +27,7 @@
>  #include "r600_pipe_common.h"
>  #include "r600_cs.h"
>  #include "tgsi/tgsi_parse.h"
> +#include "util/list.h"
>  #include "util/u_draw_quad.h"
>  #include "util/u_memory.h"
>  #include "util/u_format_s3tc.h"
> @@ -135,12 +136,10 @@ static void r600_memory_barrier(struct pipe_context *ctx, unsigned flags)
>  void r600_preflush_suspend_features(struct r600_common_context *ctx)
>  {
>         /* suspend queries */
> -       ctx->queries_suspended_for_flush = false;
> -       if (ctx->num_cs_dw_nontimer_queries_suspend) {
> +       if (!LIST_IS_EMPTY(&ctx->active_nontimer_queries))
>                 r600_suspend_nontimer_queries(ctx);
> +       if (!LIST_IS_EMPTY(&ctx->active_timer_queries))
>                 r600_suspend_timer_queries(ctx);
> -               ctx->queries_suspended_for_flush = true;
> -       }
>
>         ctx->streamout.suspended = false;
>         if (ctx->streamout.begin_emitted) {
> @@ -157,10 +156,10 @@ void r600_postflush_resume_features(struct r600_common_context *ctx)
>         }
>
>         /* resume queries */
> -       if (ctx->queries_suspended_for_flush) {
> -               r600_resume_nontimer_queries(ctx);
> +       if (!LIST_IS_EMPTY(&ctx->active_timer_queries))
>                 r600_resume_timer_queries(ctx);
> -       }
> +       if (!LIST_IS_EMPTY(&ctx->active_nontimer_queries))
> +               r600_resume_nontimer_queries(ctx);
>  }
>
>  static void r600_flush_from_st(struct pipe_context *ctx,
> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
> index f9fecdf..253d657 100644
> --- a/src/gallium/drivers/radeon/r600_pipe_common.h
> +++ b/src/gallium/drivers/radeon/r600_pipe_common.h
> @@ -397,8 +397,6 @@ struct r600_common_context {
>         struct list_head                active_timer_queries;
>         unsigned                        num_cs_dw_nontimer_queries_suspend;
>         unsigned                        num_cs_dw_timer_queries_suspend;
> -       /* If queries have been suspended. */
> -       bool                            queries_suspended_for_flush;
>         /* Additional hardware info. */
>         unsigned                        backend_mask;
>         unsigned                        max_db; /* for OQ */
> --
> 2.5.0
>
> _______________________________________________
> 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