diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 14e92c9..e5bcb3b 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -2376,6 +2376,7 @@ drm_intel_gem_bo_exec(drm_intel_bo *bo, int used, drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; bo_gem->idle = false; + bo_gem->used_as_reloc_target = false; /* Disconnect the buffer from the validate list */ bo_gem->validate_index = -1; @@ -2473,6 +2474,7 @@ skip_execution: drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *)bo; bo_gem->idle = false; + bo_gem->used_as_reloc_target = false; /* Disconnect the buffer from the validate list */ bo_gem->validate_index = -1; @@ -2989,25 +2991,6 @@ drm_intel_gem_bo_is_reusable(drm_intel_bo *bo) return bo_gem->reusable; } -static int -_drm_intel_gem_bo_references(drm_intel_bo *bo, drm_intel_bo *target_bo) -{ - drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; - int i; - - for (i = 0; i < bo_gem->reloc_count; i++) { - if (bo_gem->reloc_target_info[i].bo == target_bo) - return 1; - if (bo == bo_gem->reloc_target_info[i].bo) - continue; - if (_drm_intel_gem_bo_references(bo_gem->reloc_target_info[i].bo, - target_bo)) - return 1; - } - - return 0; -} - /** Return true if target_bo is referenced by bo's relocation tree. */ static int drm_intel_gem_bo_references(drm_intel_bo *bo, drm_intel_bo *target_bo) @@ -3016,9 +2999,7 @@ drm_intel_gem_bo_references(drm_intel_bo *bo, drm_intel_bo *target_bo) if (bo == NULL || target_bo == NULL) return 0; - if (target_bo_gem->used_as_reloc_target) - return _drm_intel_gem_bo_references(bo, target_bo); - return 0; + return target_bo_gem->used_as_reloc_target; } static void