[Mesa-dev] [PATCH 09/17] i965: Refactor relocs into a brw_reloc_list structure.

Chris Wilson chris at chris-wilson.co.uk
Wed Sep 6 09:36:51 UTC 2017


Quoting Kenneth Graunke (2017-09-06 01:09:42)
> @@ -65,10 +74,8 @@ intel_batchbuffer_init(struct intel_screen *screen,
>     struct brw_bufmgr *bufmgr = screen->bufmgr;
>     const struct gen_device_info *devinfo = &screen->devinfo;
>  
> -   batch->reloc_count = 0;
> -   batch->reloc_array_size = 250;
> -   batch->relocs = malloc(batch->reloc_array_size *
> -                          sizeof(struct drm_i915_gem_relocation_entry));
> +   init_reloc_list(&batch->batch_relocs, 250);

8192/sizeof(struct drm_i915_gem_relocation_entry) would be a good
starting point for this vector. (Should have thought about keeping it
page aligned earlier).

> +
>     batch->exec_count = 0;
>     batch->exec_array_size = 100;

Similarly we could then bump exec_array_size to 128.
-Chris


More information about the mesa-dev mailing list