[Mesa-dev] [PATCHv2] gallium: fix type of flags in pipe_context::flush()

Marek Olšák maraeo at gmail.com
Fri May 3 08:38:11 PDT 2013


Reviewed-by: Marek Olšák <maraeo at gmail.com>

Marek

On Fri, May 3, 2013 at 5:19 PM, Chia-I Wu <olvaffe at gmail.com> wrote:
> It should be unsigned, not enum pipe_flush_flags.
>
> Fixed a build error:
>
>   src/gallium/state_trackers/egl/android/native_android.cpp:426:29: error:
>   invalid conversion from 'int' to 'pipe_flush_flags' [-fpermissive]
>
> v2: replace all occurrences of enum pipe_flush_flags by unsigned
>
> Signed-off-by: Chia-I Wu <olvaffe at gmail.com>
> ---
>  src/gallium/drivers/freedreno/freedreno_context.c |    2 +-
>  src/gallium/drivers/galahad/glhd_context.c        |    2 +-
>  src/gallium/drivers/i915/i915_batch.h             |    2 +-
>  src/gallium/drivers/i915/i915_flush.c             |    4 ++--
>  src/gallium/drivers/identity/id_context.c         |    2 +-
>  src/gallium/drivers/ilo/ilo_context.c             |    2 +-
>  src/gallium/drivers/llvmpipe/lp_context.c         |    2 +-
>  src/gallium/drivers/noop/noop_pipe.c              |    2 +-
>  src/gallium/drivers/nv30/nv30_context.c           |    2 +-
>  src/gallium/drivers/nv50/nv50_context.c           |    2 +-
>  src/gallium/drivers/nvc0/nvc0_context.c           |    2 +-
>  src/gallium/drivers/r300/r300_flush.c             |    2 +-
>  src/gallium/drivers/r600/r600_pipe.c              |    2 +-
>  src/gallium/drivers/radeonsi/radeonsi_pipe.c      |    2 +-
>  src/gallium/drivers/rbug/rbug_context.c           |    2 +-
>  src/gallium/drivers/softpipe/sp_flush.c           |    2 +-
>  src/gallium/drivers/softpipe/sp_flush.h           |    2 +-
>  src/gallium/drivers/svga/svga_pipe_flush.c        |    2 +-
>  src/gallium/drivers/trace/tr_context.c            |    2 +-
>  src/gallium/include/pipe/p_context.h              |    2 +-
>  src/gallium/state_trackers/clover/core/queue.cpp  |    2 +-
>  src/gallium/state_trackers/vega/vg_manager.c      |    2 +-
>  src/mesa/state_tracker/st_cb_flush.c              |    2 +-
>  src/mesa/state_tracker/st_cb_flush.h              |    2 +-
>  src/mesa/state_tracker/st_manager.c               |    2 +-
>  25 files changed, 26 insertions(+), 26 deletions(-)
>
> diff --git a/src/gallium/drivers/freedreno/freedreno_context.c b/src/gallium/drivers/freedreno/freedreno_context.c
> index 4753f58..64c21fe 100644
> --- a/src/gallium/drivers/freedreno/freedreno_context.c
> +++ b/src/gallium/drivers/freedreno/freedreno_context.c
> @@ -96,7 +96,7 @@ fd_context_render(struct pipe_context *pctx)
>
>  static void
>  fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
> -               enum pipe_flush_flags flags)
> +               unsigned flags)
>  {
>         DBG("fence=%p", fence);
>
> diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c
> index 8901b6a..a73a3ad 100644
> --- a/src/gallium/drivers/galahad/glhd_context.c
> +++ b/src/gallium/drivers/galahad/glhd_context.c
> @@ -844,7 +844,7 @@ galahad_context_clear_depth_stencil(struct pipe_context *_pipe,
>  static void
>  galahad_context_flush(struct pipe_context *_pipe,
>                        struct pipe_fence_handle **fence,
> -                      enum pipe_flush_flags flags)
> +                      unsigned flags)
>  {
>     struct galahad_context *glhd_pipe = galahad_context(_pipe);
>     struct pipe_context *pipe = glhd_pipe->pipe;
> diff --git a/src/gallium/drivers/i915/i915_batch.h b/src/gallium/drivers/i915/i915_batch.h
> index 5f2b324..ab0f8c8 100644
> --- a/src/gallium/drivers/i915/i915_batch.h
> +++ b/src/gallium/drivers/i915/i915_batch.h
> @@ -55,6 +55,6 @@
>   */
>  extern void i915_flush(struct i915_context *i915,
>                         struct pipe_fence_handle **fence,
> -                       enum pipe_flush_flags flags);
> +                       unsigned flags);
>
>  #endif
> diff --git a/src/gallium/drivers/i915/i915_flush.c b/src/gallium/drivers/i915/i915_flush.c
> index 3db6ca1..0dca722 100644
> --- a/src/gallium/drivers/i915/i915_flush.c
> +++ b/src/gallium/drivers/i915/i915_flush.c
> @@ -40,7 +40,7 @@
>
>  static void i915_flush_pipe( struct pipe_context *pipe,
>                               struct pipe_fence_handle **fence,
> -                             enum pipe_flush_flags flags )
> +                             unsigned flags )
>  {
>     struct i915_context *i915 = i915_context(pipe);
>     enum i915_winsys_flush_flags winsys_flags = I915_FLUSH_ASYNC;
> @@ -71,7 +71,7 @@ void i915_init_flush_functions( struct i915_context *i915 )
>   */
>  void i915_flush(struct i915_context *i915,
>                  struct pipe_fence_handle **fence,
> -                enum pipe_flush_flags flags)
> +                unsigned flags)
>  {
>     struct i915_winsys_batchbuffer *batch = i915->batch;
>
> diff --git a/src/gallium/drivers/identity/id_context.c b/src/gallium/drivers/identity/id_context.c
> index d0b67ef..0eff6c9 100644
> --- a/src/gallium/drivers/identity/id_context.c
> +++ b/src/gallium/drivers/identity/id_context.c
> @@ -712,7 +712,7 @@ identity_clear_depth_stencil(struct pipe_context *_pipe,
>  static void
>  identity_flush(struct pipe_context *_pipe,
>                 struct pipe_fence_handle **fence,
> -               enum pipe_flush_flags flags)
> +               unsigned flags)
>  {
>     struct identity_context *id_pipe = identity_context(_pipe);
>     struct pipe_context *pipe = id_pipe->pipe;
> diff --git a/src/gallium/drivers/ilo/ilo_context.c b/src/gallium/drivers/ilo/ilo_context.c
> index a8c1b1b..3a101b4 100644
> --- a/src/gallium/drivers/ilo/ilo_context.c
> +++ b/src/gallium/drivers/ilo/ilo_context.c
> @@ -77,7 +77,7 @@ ilo_context_post_cp_flush(struct ilo_cp *cp, void *data)
>  static void
>  ilo_flush(struct pipe_context *pipe,
>            struct pipe_fence_handle **f,
> -          enum pipe_flush_flags flags)
> +          unsigned flags)
>  {
>     struct ilo_context *ilo = ilo_context(pipe);
>
> diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c
> index fa675ea..a6d7e59 100644
> --- a/src/gallium/drivers/llvmpipe/lp_context.c
> +++ b/src/gallium/drivers/llvmpipe/lp_context.c
> @@ -103,7 +103,7 @@ static void llvmpipe_destroy( struct pipe_context *pipe )
>  static void
>  do_flush( struct pipe_context *pipe,
>            struct pipe_fence_handle **fence,
> -          enum pipe_flush_flags flags)
> +          unsigned flags)
>  {
>     llvmpipe_flush(pipe, fence, __FUNCTION__);
>  }
> diff --git a/src/gallium/drivers/noop/noop_pipe.c b/src/gallium/drivers/noop/noop_pipe.c
> index 02588d9..ac837b1 100644
> --- a/src/gallium/drivers/noop/noop_pipe.c
> +++ b/src/gallium/drivers/noop/noop_pipe.c
> @@ -243,7 +243,7 @@ static void noop_blit(struct pipe_context *ctx,
>   */
>  static void noop_flush(struct pipe_context *ctx,
>                         struct pipe_fence_handle **fence,
> -                       enum pipe_flush_flags flags)
> +                       unsigned flags)
>  {
>  }
>
> diff --git a/src/gallium/drivers/nv30/nv30_context.c b/src/gallium/drivers/nv30/nv30_context.c
> index fc0d719..bd05042 100644
> --- a/src/gallium/drivers/nv30/nv30_context.c
> +++ b/src/gallium/drivers/nv30/nv30_context.c
> @@ -69,7 +69,7 @@ nv30_context_kick_notify(struct nouveau_pushbuf *push)
>
>  static void
>  nv30_context_flush(struct pipe_context *pipe, struct pipe_fence_handle **fence,
> -                   enum pipe_flush_flags flags)
> +                   unsigned flags)
>  {
>     struct nv30_context *nv30 = nv30_context(pipe);
>     struct nouveau_pushbuf *push = nv30->base.pushbuf;
> diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c
> index ce5999a..16697a0 100644
> --- a/src/gallium/drivers/nv50/nv50_context.c
> +++ b/src/gallium/drivers/nv50/nv50_context.c
> @@ -34,7 +34,7 @@
>  static void
>  nv50_flush(struct pipe_context *pipe,
>             struct pipe_fence_handle **fence,
> -           enum pipe_flush_flags flags)
> +           unsigned flags)
>  {
>     struct nouveau_screen *screen = nouveau_screen(pipe->screen);
>
> diff --git a/src/gallium/drivers/nvc0/nvc0_context.c b/src/gallium/drivers/nvc0/nvc0_context.c
> index ea36f7b..cd86040 100644
> --- a/src/gallium/drivers/nvc0/nvc0_context.c
> +++ b/src/gallium/drivers/nvc0/nvc0_context.c
> @@ -34,7 +34,7 @@
>  static void
>  nvc0_flush(struct pipe_context *pipe,
>             struct pipe_fence_handle **fence,
> -           enum pipe_flush_flags flags)
> +           unsigned flags)
>  {
>     struct nvc0_context *nvc0 = nvc0_context(pipe);
>     struct nouveau_screen *screen = &nvc0->screen->base;
> diff --git a/src/gallium/drivers/r300/r300_flush.c b/src/gallium/drivers/r300/r300_flush.c
> index 709fe52..3dd3864 100644
> --- a/src/gallium/drivers/r300/r300_flush.c
> +++ b/src/gallium/drivers/r300/r300_flush.c
> @@ -139,7 +139,7 @@ void r300_flush(struct pipe_context *pipe,
>
>  static void r300_flush_wrapped(struct pipe_context *pipe,
>                                 struct pipe_fence_handle **fence,
> -                               enum pipe_flush_flags flags)
> +                               unsigned flags)
>  {
>      r300_flush(pipe,
>                 flags & PIPE_FLUSH_END_OF_FRAME ? RADEON_FLUSH_END_OF_FRAME : 0,
> diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
> index daadaeb..50fe77b 100644
> --- a/src/gallium/drivers/r600/r600_pipe.c
> +++ b/src/gallium/drivers/r600/r600_pipe.c
> @@ -183,7 +183,7 @@ static void r600_flush(struct pipe_context *ctx, unsigned flags)
>
>  static void r600_flush_from_st(struct pipe_context *ctx,
>                                struct pipe_fence_handle **fence,
> -                              enum pipe_flush_flags flags)
> +                              unsigned flags)
>  {
>         struct r600_context *rctx = (struct r600_context *)ctx;
>         struct r600_fence **rfence = (struct r600_fence**)fence;
> diff --git a/src/gallium/drivers/radeonsi/radeonsi_pipe.c b/src/gallium/drivers/radeonsi/radeonsi_pipe.c
> index 8a072fd..4f4c144 100644
> --- a/src/gallium/drivers/radeonsi/radeonsi_pipe.c
> +++ b/src/gallium/drivers/radeonsi/radeonsi_pipe.c
> @@ -161,7 +161,7 @@ void radeonsi_flush(struct pipe_context *ctx, struct pipe_fence_handle **fence,
>
>  static void r600_flush_from_st(struct pipe_context *ctx,
>                                struct pipe_fence_handle **fence,
> -                               enum pipe_flush_flags flags)
> +                               unsigned flags)
>  {
>         radeonsi_flush(ctx, fence,
>                         flags & PIPE_FLUSH_END_OF_FRAME ? RADEON_FLUSH_END_OF_FRAME : 0);
> diff --git a/src/gallium/drivers/rbug/rbug_context.c b/src/gallium/drivers/rbug/rbug_context.c
> index f57db40..bf939b9 100644
> --- a/src/gallium/drivers/rbug/rbug_context.c
> +++ b/src/gallium/drivers/rbug/rbug_context.c
> @@ -942,7 +942,7 @@ rbug_clear_depth_stencil(struct pipe_context *_pipe,
>  static void
>  rbug_flush(struct pipe_context *_pipe,
>             struct pipe_fence_handle **fence,
> -           enum pipe_flush_flags flags)
> +           unsigned flags)
>  {
>     struct rbug_context *rb_pipe = rbug_context(_pipe);
>     struct pipe_context *pipe = rb_pipe->pipe;
> diff --git a/src/gallium/drivers/softpipe/sp_flush.c b/src/gallium/drivers/softpipe/sp_flush.c
> index 899ac53..a85eaa4 100644
> --- a/src/gallium/drivers/softpipe/sp_flush.c
> +++ b/src/gallium/drivers/softpipe/sp_flush.c
> @@ -96,7 +96,7 @@ softpipe_flush( struct pipe_context *pipe,
>  void
>  softpipe_flush_wrapped(struct pipe_context *pipe,
>                         struct pipe_fence_handle **fence,
> -                       enum pipe_flush_flags flags)
> +                       unsigned flags)
>  {
>     softpipe_flush(pipe, SP_FLUSH_TEXTURE_CACHE, fence);
>  }
> diff --git a/src/gallium/drivers/softpipe/sp_flush.h b/src/gallium/drivers/softpipe/sp_flush.h
> index d406103..f93ebd9 100644
> --- a/src/gallium/drivers/softpipe/sp_flush.h
> +++ b/src/gallium/drivers/softpipe/sp_flush.h
> @@ -43,7 +43,7 @@ softpipe_flush(struct pipe_context *pipe,
>  void
>  softpipe_flush_wrapped(struct pipe_context *pipe,
>                         struct pipe_fence_handle **fence,
> -                       enum pipe_flush_flags flags);
> +                       unsigned flags);
>
>  boolean
>  softpipe_flush_resource(struct pipe_context *pipe,
> diff --git a/src/gallium/drivers/svga/svga_pipe_flush.c b/src/gallium/drivers/svga/svga_pipe_flush.c
> index a6048d9..d593c78 100644
> --- a/src/gallium/drivers/svga/svga_pipe_flush.c
> +++ b/src/gallium/drivers/svga/svga_pipe_flush.c
> @@ -33,7 +33,7 @@
>
>  static void svga_flush( struct pipe_context *pipe,
>                          struct pipe_fence_handle **fence,
> -                        enum pipe_flush_flags flags)
> +                        unsigned flags)
>  {
>     struct svga_context *svga = svga_context(pipe);
>
> diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
> index f8637bd..962b15e 100644
> --- a/src/gallium/drivers/trace/tr_context.c
> +++ b/src/gallium/drivers/trace/tr_context.c
> @@ -1287,7 +1287,7 @@ trace_context_clear_depth_stencil(struct pipe_context *_pipe,
>  static INLINE void
>  trace_context_flush(struct pipe_context *_pipe,
>                      struct pipe_fence_handle **fence,
> -                    enum pipe_flush_flags flags)
> +                    unsigned flags)
>  {
>     struct trace_context *tr_ctx = trace_context(_pipe);
>     struct pipe_context *pipe = tr_ctx->pipe;
> diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
> index da1f5a8..b9b5f3e 100644
> --- a/src/gallium/include/pipe/p_context.h
> +++ b/src/gallium/include/pipe/p_context.h
> @@ -352,7 +352,7 @@ struct pipe_context {
>      */
>     void (*flush)(struct pipe_context *pipe,
>                   struct pipe_fence_handle **fence,
> -                 enum pipe_flush_flags flags);
> +                 unsigned flags);
>
>     /**
>      * Create a view on a texture to be used by a shader stage.
> diff --git a/src/gallium/state_trackers/clover/core/queue.cpp b/src/gallium/state_trackers/clover/core/queue.cpp
> index 95b02d7..0b1c494 100644
> --- a/src/gallium/state_trackers/clover/core/queue.cpp
> +++ b/src/gallium/state_trackers/clover/core/queue.cpp
> @@ -53,7 +53,7 @@ _cl_command_queue::flush() {
>                                 [](event_ptr &ev) { return !ev->signalled(); });
>
>        // Flush and fence them.
> -      pipe->flush(pipe, &fence, (enum pipe_flush_flags)0);
> +      pipe->flush(pipe, &fence, 0);
>        std::for_each(first, last, [&](event_ptr &ev) { ev->fence(fence); });
>        screen->fence_reference(screen, &fence, NULL);
>        queued_events.erase(first, last);
> diff --git a/src/gallium/state_trackers/vega/vg_manager.c b/src/gallium/state_trackers/vega/vg_manager.c
> index ad0e98d..a8518ab 100644
> --- a/src/gallium/state_trackers/vega/vg_manager.c
> +++ b/src/gallium/state_trackers/vega/vg_manager.c
> @@ -143,7 +143,7 @@ vg_context_flush(struct st_context_iface *stctxi, unsigned flags,
>                   struct pipe_fence_handle **fence)
>  {
>     struct vg_context *ctx = (struct vg_context *) stctxi;
> -   enum pipe_flush_flags pipe_flags = 0;
> +   unsigned pipe_flags = 0;
>
>     if (flags & ST_FLUSH_END_OF_FRAME) {
>        pipe_flags |= PIPE_FLUSH_END_OF_FRAME;
> diff --git a/src/mesa/state_tracker/st_cb_flush.c b/src/mesa/state_tracker/st_cb_flush.c
> index b110047..f428e0a 100644
> --- a/src/mesa/state_tracker/st_cb_flush.c
> +++ b/src/mesa/state_tracker/st_cb_flush.c
> @@ -77,7 +77,7 @@ display_front_buffer(struct st_context *st)
>
>  void st_flush(struct st_context *st,
>                struct pipe_fence_handle **fence,
> -              enum pipe_flush_flags flags)
> +              unsigned flags)
>  {
>     FLUSH_VERTICES(st->ctx, 0);
>     FLUSH_CURRENT(st->ctx, 0);
> diff --git a/src/mesa/state_tracker/st_cb_flush.h b/src/mesa/state_tracker/st_cb_flush.h
> index 003e2a2..cb5c62e 100644
> --- a/src/mesa/state_tracker/st_cb_flush.h
> +++ b/src/mesa/state_tracker/st_cb_flush.h
> @@ -42,7 +42,7 @@ st_init_flush_functions(struct dd_function_table *functions);
>  extern void
>  st_flush(struct st_context *st,
>           struct pipe_fence_handle **fence,
> -         enum pipe_flush_flags flags);
> +         unsigned flags);
>
>  extern void
>  st_finish(struct st_context *st);
> diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
> index ff52aa1..5561af6 100644
> --- a/src/mesa/state_tracker/st_manager.c
> +++ b/src/mesa/state_tracker/st_manager.c
> @@ -453,7 +453,7 @@ st_context_flush(struct st_context_iface *stctxi, unsigned flags,
>                   struct pipe_fence_handle **fence)
>  {
>     struct st_context *st = (struct st_context *) stctxi;
> -   enum pipe_flush_flags pipe_flags = 0;
> +   unsigned pipe_flags = 0;
>
>     if (flags & ST_FLUSH_END_OF_FRAME) {
>        pipe_flags |= PIPE_FLUSH_END_OF_FRAME;
> --
> 1.7.10.4
>
> _______________________________________________
> 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