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

Submitted by Zhou, David(ChunMing) on April 12, 2018, 10:09 a.m.

Details

Message ID 20180412100940.25039-10-david1.zhou@amd.com
State New
Headers show
Series "***[WIP] TTM per process lru ***" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Zhou, David(ChunMing) April 12, 2018, 10:09 a.m.
Change-Id: I877b2d5c54b3e47b66f2d58454dcf1e5f5a68972
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

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,