[Intel-gfx] [PATCH 2/2] intel: Avoid overcounting fences when emitting self-referential relocs

Daniel Vetter daniel at ffwll.ch
Wed May 8 18:11:42 CEST 2013


On Wed, May 08, 2013 at 04:33:10PM +0100, Chris Wilson wrote:
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
>  intel/intel_bufmgr_gem.c |   15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
> index 6ebeec9..ccedeab 100644
> --- a/intel/intel_bufmgr_gem.c
> +++ b/intel/intel_bufmgr_gem.c
> @@ -1652,6 +1652,14 @@ do_bo_emit_reloc(drm_intel_bo *bo, uint32_t offset,
>  	assert(offset <= bo->size - 4);
>  	assert((write_domain & (write_domain - 1)) == 0);
>  
> +	/* An object needing a fence is a tiled buffer, so it won't have
> +	 * relocs to other buffers.
> +	 */
> +	if (need_fence) {
> +		assert(target_bo_gem->reloc_count == 0);
> +		target_bo_gem->reloc_tree_fences = 1;
> +	}
> +
>  	/* Make sure that we're not adding a reloc to something whose size has
>  	 * already been accounted for.
>  	 */
> @@ -1659,13 +1667,8 @@ do_bo_emit_reloc(drm_intel_bo *bo, uint32_t offset,
>  	if (target_bo_gem != bo_gem) {
>  		target_bo_gem->used_as_reloc_target = true;
>  		bo_gem->reloc_tree_size += target_bo_gem->reloc_tree_size;
> +		bo_gem->reloc_tree_fences += target_bo_gem->reloc_tree_fences;
>  	}
> -	/* An object needing a fence is a tiled buffer, so it won't have
> -	 * relocs to other buffers.
> -	 */
> -	if (need_fence)
> -		target_bo_gem->reloc_tree_fences = 1;
> -	bo_gem->reloc_tree_fences += target_bo_gem->reloc_tree_fences;
>  
>  	bo_gem->relocs[bo_gem->reloc_count].offset = offset;
>  	bo_gem->relocs[bo_gem->reloc_count].delta = target_offset;
> -- 
> 1.7.10.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list