When creating a BO that shares the VM root PD's resv, TTM eviction fences are added to the resv, and there is another fence added for the BO clear job.
Signed-off-by: Benjamin Cheng <[email protected]> Reviewed-by: Christian König <[email protected]> --- v3: - Christian pointed out this is most likely only a theoretical bug that doesn't matter in practice so dropped the Fixes tag. --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 9da7ae6b9ef3..eb7473ed9e0e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -504,6 +504,14 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data, if (r) return r; + /* ttm_bo_init_reserved() + clear fence */ + r = dma_resv_reserve_fences(vm->root.bo->tbo.base.resv, + TTM_NUM_MOVE_FENCES + 1); + if (r) { + amdgpu_bo_unreserve(vm->root.bo); + return r; + } + resv = vm->root.bo->tbo.base.resv; } -- 2.56.1
