[Mesa-dev] [PATCH 35/53] i965: Change intel_batchbuffer_reloc() into brw_emit_reloc().

Chris Wilson chris at chris-wilson.co.uk
Wed Apr 5 11:05:23 UTC 2017


On Tue, Apr 04, 2017 at 05:10:25PM -0700, Kenneth Graunke wrote:
> This renames intel_batchbuffer_reloc to brw_emit_reloc and changes the
> parameter naming and ordering to match drm_intel_bo_emit_reloc().
> 
> For now, it's a trivial wrapper that accesses batch->bo.  When we
> rework relocations, it will start doing actual work.
> ---
>  src/mesa/drivers/dri/i965/genX_blorp_exec.c   |  8 ++++----
>  src/mesa/drivers/dri/i965/intel_batchbuffer.c | 15 +++++++--------
>  src/mesa/drivers/dri/i965/intel_batchbuffer.h | 17 +++++++----------
>  3 files changed, 18 insertions(+), 22 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/genX_blorp_exec.c b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
> index 7a2c8aaa596..78854e6fada 100644
> --- a/src/mesa/drivers/dri/i965/genX_blorp_exec.c
> +++ b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
> @@ -55,10 +55,10 @@ blorp_emit_reloc(struct blorp_batch *batch,
>     struct brw_context *brw = batch->driver_batch;
>  
>     uint32_t offset = (char *)location - (char *)brw->batch.map;
> -   return intel_batchbuffer_reloc(&brw->batch, address.buffer, offset,
> -                                  address.read_domains,
> -                                  address.write_domain,
> -                                  address.offset + delta);
> +   return brw_emit_reloc(&brw->batch, offset,
> +                         address.buffer, address.offset + delta,
> +                         address.read_domains,
> +                         address.write_domain);
>  }
>  
>  static void
> diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> index c35d9ca5bda..cf69927f54c 100644
> --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> @@ -580,16 +580,15 @@ _intel_batchbuffer_flush_fence(struct brw_context *brw,
>  /*  This is the only way buffers get added to the validate list.
>   */
>  uint64_t
> -intel_batchbuffer_reloc(struct intel_batchbuffer *batch,
> -                        drm_bacon_bo *buffer, uint32_t offset,
> -                        uint32_t read_domains, uint32_t write_domain,
> -                        uint32_t delta)
> +brw_emit_reloc(struct intel_batchbuffer *batch, uint32_t batch_offset,
> +               drm_bacon_bo *target, uint32_t target_offset,
> +               uint32_t read_domains, uint32_t write_domain)

Names make sense, but target_offset limited to u32? I hope that's on
your today list. (As well as stop passing around more than the single
write bit, the savings are quite substantial.)

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the mesa-dev mailing list