[PATCH 09/11] drm/amdgpu: counter for every bo creation

Chunming Zhou david1.zhou at amd.com
Thu Apr 12 10:09:38 UTC 2018


Change-Id: I877b2d5c54b3e47b66f2d58454dcf1e5f5a68972
Signed-off-by: Chunming Zhou <david1.zhou at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 7bb6ee777067..d54abba4e017 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -622,8 +622,10 @@ static int amdgpu_bo_do_create1(struct amdgpu_device *adev, unsigned long size,
 	if (type == ttm_bo_type_kernel)
 		bo->tbo.priority = 1;
 	bo->tbo.process = process;
+	bo->tbo.index = (u64)atomic64_inc_return(&process->bo_index);
 
 	bo->tbo.bdev = &adev->mman.bdev;
+	RB_CLEAR_NODE(&bo->tbo.node);
 	amdgpu_ttm_placement_from_domain(bo, domains);
 	r = ttm_bo_init_reserved(&adev->mman.bdev, &bo->tbo, size, type,
 				 &bo->placement, page_align, &ctx, acc_size,
-- 
2.14.1



More information about the amd-gfx mailing list