[Mesa-dev] [PATCH 2/4] xa: remove unneeded args

Thomas Hellstrom thellstrom at vmware.com
Wed Apr 2 00:36:53 PDT 2014


On 04/01/2014 05:04 PM, Rob Clark wrote:
> From: Rob Clark <robclark at freedesktop.org>
>
> Signed-off-by: Rob Clark <robclark at freedesktop.org>
> ---
>  src/gallium/state_trackers/xa/xa_composite.c | 3 +--
>  src/gallium/state_trackers/xa/xa_context.c   | 5 +----
>  src/gallium/state_trackers/xa/xa_priv.h      | 3 +--
>  src/gallium/state_trackers/xa/xa_renderer.c  | 7 ++++---
>  src/gallium/state_trackers/xa/xa_yuv.c       | 2 +-
>  5 files changed, 8 insertions(+), 12 deletions(-)
>
> diff --git a/src/gallium/state_trackers/xa/xa_composite.c b/src/gallium/state_trackers/xa/xa_composite.c
> index f63cf49..19e7309 100644
> --- a/src/gallium/state_trackers/xa/xa_composite.c
> +++ b/src/gallium/state_trackers/xa/xa_composite.c
> @@ -482,8 +482,7 @@ xa_composite_prepare(struct xa_context *ctx,
>  	return ret;
>  
>      ctx->dst = dst_srf;
> -    renderer_bind_destination(ctx, ctx->srf, ctx->srf->width,
> -			      ctx->srf->height);
> +    renderer_bind_destination(ctx, ctx->srf);
>  
>      ret = bind_composite_blend_state(ctx, comp);
>      if (ret != XA_ERR_NONE)
> diff --git a/src/gallium/state_trackers/xa/xa_context.c b/src/gallium/state_trackers/xa/xa_context.c
> index c2dc53b..ee32676 100644
> --- a/src/gallium/state_trackers/xa/xa_context.c
> +++ b/src/gallium/state_trackers/xa/xa_context.c
> @@ -281,7 +281,6 @@ xa_solid_prepare(struct xa_context *ctx, struct xa_surface *dst,
>  {
>      unsigned vs_traits, fs_traits;
>      struct xa_shader shader;
> -    int width, height;
>      int ret;
>  
>      ret = xa_ctx_srf_create(ctx, dst);
> @@ -295,8 +294,6 @@ xa_solid_prepare(struct xa_context *ctx, struct xa_surface *dst,
>      ctx->has_solid_color = 1;
>  
>      ctx->dst = dst;
> -    width = ctx->srf->width;
> -    height = ctx->srf->height;
>  
>  #if 0
>      debug_printf("Color Pixel=(%d, %d, %d, %d), RGBA=(%f, %f, %f, %f)\n",
> @@ -309,7 +306,7 @@ xa_solid_prepare(struct xa_context *ctx, struct xa_surface *dst,
>      vs_traits = VS_SOLID_FILL;
>      fs_traits = FS_SOLID_FILL;
>  
> -    renderer_bind_destination(ctx, ctx->srf, width, height);
> +    renderer_bind_destination(ctx, ctx->srf);
>      bind_solid_blend_state(ctx);
>      cso_set_samplers(ctx->cso, PIPE_SHADER_FRAGMENT, 0, NULL);
>      cso_set_sampler_views(ctx->cso, PIPE_SHADER_FRAGMENT, 0, NULL);
> diff --git a/src/gallium/state_trackers/xa/xa_priv.h b/src/gallium/state_trackers/xa/xa_priv.h
> index 348a98e..15aedb5 100644
> --- a/src/gallium/state_trackers/xa/xa_priv.h
> +++ b/src/gallium/state_trackers/xa/xa_priv.h
> @@ -241,8 +241,7 @@ void renderer_draw_yuv(struct xa_context *r,
>  		       struct xa_surface *srf[]);
>  
>  void renderer_bind_destination(struct xa_context *r,
> -			       struct pipe_surface *surface, int width,
> -			       int height);
> +			       struct pipe_surface *surface);
>  
>  void renderer_init_state(struct xa_context *r);
>  void renderer_copy_prepare(struct xa_context *r,
> diff --git a/src/gallium/state_trackers/xa/xa_renderer.c b/src/gallium/state_trackers/xa/xa_renderer.c
> index 056648a..e1da28c 100644
> --- a/src/gallium/state_trackers/xa/xa_renderer.c
> +++ b/src/gallium/state_trackers/xa/xa_renderer.c
> @@ -351,8 +351,10 @@ setup_vertex_data_yuv(struct xa_context *r,
>   */
>  void
>  renderer_bind_destination(struct xa_context *r,
> -			  struct pipe_surface *surface, int width, int height)
> +			  struct pipe_surface *surface)
>  {
> +    int width = surface->width;
> +    int height = surface->height;
>  
>      struct pipe_framebuffer_state fb;
>      struct pipe_viewport_state viewport;
> @@ -461,8 +463,7 @@ renderer_copy_prepare(struct xa_context *r,
>  	cso_single_sampler_done(r->cso, PIPE_SHADER_FRAGMENT);
>      }
>  
> -    renderer_bind_destination(r, dst_surface,
> -			      dst_surface->width, dst_surface->height);
> +    renderer_bind_destination(r, dst_surface);
>  
>      /* texture/sampler view */
>      {
> diff --git a/src/gallium/state_trackers/xa/xa_yuv.c b/src/gallium/state_trackers/xa/xa_yuv.c
> index 9c7c4d6..43f56ff 100644
> --- a/src/gallium/state_trackers/xa/xa_yuv.c
> +++ b/src/gallium/state_trackers/xa/xa_yuv.c
> @@ -131,7 +131,7 @@ xa_yuv_planar_blit(struct xa_context *r,
>      if (ret != XA_ERR_NONE)
>  	return -XA_ERR_NORES;
>  
> -    renderer_bind_destination(r, r->srf, r->srf->width, r->srf->height);
> +    renderer_bind_destination(r, r->srf);
>      xa_yuv_bind_blend_state(r);
>      xa_yuv_bind_shaders(r);
>      xa_yuv_bind_samplers(r, yuv);
Reviewed-by: Thomas Hellstrom <thellstrom at vmware.com>


More information about the mesa-dev mailing list