[Mesa-dev] [PATCH 05/10] gallium: change end_query() to return boolean

Nicolai Hähnle nhaehnle at gmail.com
Tue Jun 14 16:19:12 UTC 2016


On 14.06.2016 17:57, Rob Clark wrote:
> From: Rob Clark <robclark at freedesktop.org>
>
> s/bool/boolean/ to make it match the other APIs.

Please no. C has finally grown a proper bool type, we should use it 
where possible. If anything, make the patch go in the other direction.

Nicolai

>
> Signed-off-by: Rob Clark <robclark at freedesktop.org>
> ---
>   src/gallium/drivers/freedreno/freedreno_query.c | 2 +-
>   src/gallium/drivers/i915/i915_query.c           | 2 +-
>   src/gallium/drivers/ilo/ilo_query.c             | 2 +-
>   src/gallium/drivers/llvmpipe/lp_query.c         | 2 +-
>   src/gallium/drivers/noop/noop_pipe.c            | 2 +-
>   src/gallium/drivers/nouveau/nv30/nv30_query.c   | 2 +-
>   src/gallium/drivers/nouveau/nv50/nv50_query.c   | 2 +-
>   src/gallium/drivers/r300/r300_query.c           | 4 ++--
>   src/gallium/drivers/radeon/r600_query.c         | 2 +-
>   src/gallium/drivers/rbug/rbug_context.c         | 4 ++--
>   src/gallium/drivers/softpipe/sp_query.c         | 2 +-
>   src/gallium/drivers/svga/svga_pipe_query.c      | 2 +-
>   src/gallium/drivers/swr/swr_query.cpp           | 2 +-
>   src/gallium/drivers/vc4/vc4_query.c             | 2 +-
>   src/gallium/drivers/virgl/virgl_query.c         | 4 ++--
>   src/gallium/include/pipe/p_context.h            | 2 +-
>   16 files changed, 19 insertions(+), 19 deletions(-)
>
> diff --git a/src/gallium/drivers/freedreno/freedreno_query.c b/src/gallium/drivers/freedreno/freedreno_query.c
> index 18e0c79..fc50076 100644
> --- a/src/gallium/drivers/freedreno/freedreno_query.c
> +++ b/src/gallium/drivers/freedreno/freedreno_query.c
> @@ -66,7 +66,7 @@ fd_begin_query(struct pipe_context *pctx, struct pipe_query *pq)
>   	return q->funcs->begin_query(fd_context(pctx), q);
>   }
>
> -static bool
> +static boolean
>   fd_end_query(struct pipe_context *pctx, struct pipe_query *pq)
>   {
>   	struct fd_query *q = fd_query(pq);
> diff --git a/src/gallium/drivers/i915/i915_query.c b/src/gallium/drivers/i915/i915_query.c
> index d6015a6..9d5569a 100644
> --- a/src/gallium/drivers/i915/i915_query.c
> +++ b/src/gallium/drivers/i915/i915_query.c
> @@ -60,7 +60,7 @@ static boolean i915_begin_query(struct pipe_context *ctx,
>      return true;
>   }
>
> -static bool i915_end_query(struct pipe_context *ctx, struct pipe_query *query)
> +static boolean i915_end_query(struct pipe_context *ctx, struct pipe_query *query)
>   {
>      return true;
>   }
> diff --git a/src/gallium/drivers/ilo/ilo_query.c b/src/gallium/drivers/ilo/ilo_query.c
> index 3088c96..98c3f6d 100644
> --- a/src/gallium/drivers/ilo/ilo_query.c
> +++ b/src/gallium/drivers/ilo/ilo_query.c
> @@ -128,7 +128,7 @@ ilo_begin_query(struct pipe_context *pipe, struct pipe_query *query)
>      return true;
>   }
>
> -static bool
> +static boolean
>   ilo_end_query(struct pipe_context *pipe, struct pipe_query *query)
>   {
>      struct ilo_query *q = ilo_query(query);
> diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c
> index d5ed656..ffc4f56c 100644
> --- a/src/gallium/drivers/llvmpipe/lp_query.c
> +++ b/src/gallium/drivers/llvmpipe/lp_query.c
> @@ -239,7 +239,7 @@ llvmpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
>   }
>
>
> -static bool
> +static boolean
>   llvmpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
>   {
>      struct llvmpipe_context *llvmpipe = llvmpipe_context( pipe );
> diff --git a/src/gallium/drivers/noop/noop_pipe.c b/src/gallium/drivers/noop/noop_pipe.c
> index 99e5f1a..e58507b 100644
> --- a/src/gallium/drivers/noop/noop_pipe.c
> +++ b/src/gallium/drivers/noop/noop_pipe.c
> @@ -63,7 +63,7 @@ static boolean noop_begin_query(struct pipe_context *ctx, struct pipe_query *que
>      return true;
>   }
>
> -static bool noop_end_query(struct pipe_context *ctx, struct pipe_query *query)
> +static boolean noop_end_query(struct pipe_context *ctx, struct pipe_query *query)
>   {
>      return true;
>   }
> diff --git a/src/gallium/drivers/nouveau/nv30/nv30_query.c b/src/gallium/drivers/nouveau/nv30/nv30_query.c
> index aa9a12f..0f4d9b4 100644
> --- a/src/gallium/drivers/nouveau/nv30/nv30_query.c
> +++ b/src/gallium/drivers/nouveau/nv30/nv30_query.c
> @@ -175,7 +175,7 @@ nv30_query_begin(struct pipe_context *pipe, struct pipe_query *pq)
>      return true;
>   }
>
> -static bool
> +static boolean
>   nv30_query_end(struct pipe_context *pipe, struct pipe_query *pq)
>   {
>      struct nv30_context *nv30 = nv30_context(pipe);
> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_query.c b/src/gallium/drivers/nouveau/nv50/nv50_query.c
> index 9a1397a..9124946 100644
> --- a/src/gallium/drivers/nouveau/nv50/nv50_query.c
> +++ b/src/gallium/drivers/nouveau/nv50/nv50_query.c
> @@ -54,7 +54,7 @@ nv50_begin_query(struct pipe_context *pipe, struct pipe_query *pq)
>      return q->funcs->begin_query(nv50_context(pipe), q);
>   }
>
> -static bool
> +static boolean
>   nv50_end_query(struct pipe_context *pipe, struct pipe_query *pq)
>   {
>      struct nv50_query *q = nv50_query(pq);
> diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c
> index 79e2198..1428d03 100644
> --- a/src/gallium/drivers/r300/r300_query.c
> +++ b/src/gallium/drivers/r300/r300_query.c
> @@ -112,8 +112,8 @@ void r300_stop_query(struct r300_context *r300)
>       r300->query_current = NULL;
>   }
>
> -static bool r300_end_query(struct pipe_context* pipe,
> -	                   struct pipe_query* query)
> +static boolean r300_end_query(struct pipe_context* pipe,
> +                              struct pipe_query* query)
>   {
>       struct r300_context* r300 = r300_context(pipe);
>       struct r300_query *q = r300_query(query);
> diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c
> index e362614..2fd5c5e 100644
> --- a/src/gallium/drivers/radeon/r600_query.c
> +++ b/src/gallium/drivers/radeon/r600_query.c
> @@ -749,7 +749,7 @@ boolean r600_query_hw_begin(struct r600_common_context *rctx,
>   	return true;
>   }
>
> -static bool r600_end_query(struct pipe_context *ctx, struct pipe_query *query)
> +static boolean r600_end_query(struct pipe_context *ctx, struct pipe_query *query)
>   {
>   	struct r600_common_context *rctx = (struct r600_common_context *)ctx;
>   	struct r600_query *rquery = (struct r600_query *)query;
> diff --git a/src/gallium/drivers/rbug/rbug_context.c b/src/gallium/drivers/rbug/rbug_context.c
> index 77f09b0..7db8cb3 100644
> --- a/src/gallium/drivers/rbug/rbug_context.c
> +++ b/src/gallium/drivers/rbug/rbug_context.c
> @@ -178,13 +178,13 @@ rbug_begin_query(struct pipe_context *_pipe,
>      return ret;
>   }
>
> -static bool
> +static boolean
>   rbug_end_query(struct pipe_context *_pipe,
>                  struct pipe_query *query)
>   {
>      struct rbug_context *rb_pipe = rbug_context(_pipe);
>      struct pipe_context *pipe = rb_pipe->pipe;
> -   bool ret;
> +   boolean ret;
>
>      pipe_mutex_lock(rb_pipe->call_mutex);
>      ret = pipe->end_query(pipe,
> diff --git a/src/gallium/drivers/softpipe/sp_query.c b/src/gallium/drivers/softpipe/sp_query.c
> index bec0116..e051605 100644
> --- a/src/gallium/drivers/softpipe/sp_query.c
> +++ b/src/gallium/drivers/softpipe/sp_query.c
> @@ -134,7 +134,7 @@ softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
>   }
>
>
> -static bool
> +static boolean
>   softpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
>   {
>      struct softpipe_context *softpipe = softpipe_context( pipe );
> diff --git a/src/gallium/drivers/svga/svga_pipe_query.c b/src/gallium/drivers/svga/svga_pipe_query.c
> index 4febf9b..04d9ce4 100644
> --- a/src/gallium/drivers/svga/svga_pipe_query.c
> +++ b/src/gallium/drivers/svga/svga_pipe_query.c
> @@ -941,7 +941,7 @@ svga_begin_query(struct pipe_context *pipe, struct pipe_query *q)
>   }
>
>
> -static bool
> +static boolean
>   svga_end_query(struct pipe_context *pipe, struct pipe_query *q)
>   {
>      struct svga_context *svga = svga_context(pipe);
> diff --git a/src/gallium/drivers/swr/swr_query.cpp b/src/gallium/drivers/swr/swr_query.cpp
> index 7867db3..529a28b 100644
> --- a/src/gallium/drivers/swr/swr_query.cpp
> +++ b/src/gallium/drivers/swr/swr_query.cpp
> @@ -232,7 +232,7 @@ swr_begin_query(struct pipe_context *pipe, struct pipe_query *q)
>      return true;
>   }
>
> -static bool
> +static boolean
>   swr_end_query(struct pipe_context *pipe, struct pipe_query *q)
>   {
>      struct swr_context *ctx = swr_context(pipe);
> diff --git a/src/gallium/drivers/vc4/vc4_query.c b/src/gallium/drivers/vc4/vc4_query.c
> index ddf8f8f..0d326fa 100644
> --- a/src/gallium/drivers/vc4/vc4_query.c
> +++ b/src/gallium/drivers/vc4/vc4_query.c
> @@ -56,7 +56,7 @@ vc4_begin_query(struct pipe_context *ctx, struct pipe_query *query)
>           return true;
>   }
>
> -static bool
> +static boolean
>   vc4_end_query(struct pipe_context *ctx, struct pipe_query *query)
>   {
>           return true;
> diff --git a/src/gallium/drivers/virgl/virgl_query.c b/src/gallium/drivers/virgl/virgl_query.c
> index 4ddb925..19f9fab 100644
> --- a/src/gallium/drivers/virgl/virgl_query.c
> +++ b/src/gallium/drivers/virgl/virgl_query.c
> @@ -107,8 +107,8 @@ static boolean virgl_begin_query(struct pipe_context *ctx,
>      return true;
>   }
>
> -static bool virgl_end_query(struct pipe_context *ctx,
> -                           struct pipe_query *q)
> +static boolean virgl_end_query(struct pipe_context *ctx,
> +                               struct pipe_query *q)
>   {
>      struct virgl_context *vctx = virgl_context(ctx);
>      struct virgl_query *query = virgl_query(q);
> diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
> index 24c947e..62897e1 100644
> --- a/src/gallium/include/pipe/p_context.h
> +++ b/src/gallium/include/pipe/p_context.h
> @@ -141,7 +141,7 @@ struct pipe_context {
>                            struct pipe_query *q);
>
>      boolean (*begin_query)(struct pipe_context *pipe, struct pipe_query *q);
> -   bool (*end_query)(struct pipe_context *pipe, struct pipe_query *q);
> +   boolean (*end_query)(struct pipe_context *pipe, struct pipe_query *q);
>
>      /**
>       * Get results of a query.
>


More information about the mesa-dev mailing list