From: Chunming Zhou <david1.zhou@amd.com>
To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Cc: Jerry.Zhang@amd.com, ckoenig.leichtzumerken@gmail.com, Kai.Guo@amd.com
Subject: [PATCH 03/13] drm/amdgpu: add lru backend for amdgpu driver
Date: Wed, 9 May 2018 14:45:33 +0800 [thread overview]
Message-ID: <20180509064543.15937-4-david1.zhou@amd.com> (raw)
In-Reply-To: <20180509064543.15937-1-david1.zhou@amd.com>
Change-Id: I4ee2abf1ddf5c0fe59c5803da51e99bb57388d05
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++++
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 25 +++++++++++++++++++++++++
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 9 +++++++++
3 files changed, 38 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index dfd22db13fb1..0bbb1dfdceff 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1279,6 +1279,10 @@ static struct ttm_bo_driver amdgpu_bo_driver = {
.invalidate_caches = &amdgpu_invalidate_caches,
.init_mem_type = &amdgpu_init_mem_type,
.eviction_valuable = amdgpu_ttm_bo_eviction_valuable,
+ .get_evictable_bo = &amdgpu_vm_get_evictable_bo,
+ .add_to_lru = &amdgpu_vm_add_to_lru,
+ .del_from_lru = &amdgpu_vm_del_from_lru,
+ .move_to_lru_tail = &amdgpu_vm_move_to_lru_tail,
.evict_flags = &amdgpu_evict_flags,
.move = &amdgpu_bo_move,
.verify_access = &amdgpu_verify_access,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 8e71d3984016..cc6093233ae7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -124,6 +124,31 @@ static void amdgpu_vm_bo_base_init(struct amdgpu_vm_bo_base *base,
spin_unlock(&vm->status_lock);
}
+struct ttm_buffer_object *amdgpu_vm_get_evictable_bo(struct ttm_bo_device *bdev,
+ uint32_t mem_type,
+ const struct ttm_place *place,
+ struct ttm_operation_ctx *ctx,
+ bool *locked)
+{
+
+}
+
+void amdgpu_vm_add_to_lru(struct ttm_buffer_object *bo)
+{
+
+}
+
+void amdgpu_vm_del_from_lru(struct ttm_buffer_object *bo)
+{
+
+}
+
+void amdgpu_vm_move_to_lru_tail(struct ttm_buffer_object *bo)
+{
+
+}
+
+
/**
* amdgpu_vm_level_shift - return the addr shift for each level
*
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
index 30f080364c97..0c965683faba 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
@@ -256,6 +256,15 @@ struct amdgpu_vm_manager {
spinlock_t pasid_lock;
};
+struct ttm_buffer_object *amdgpu_vm_get_evictable_bo(struct ttm_bo_device *bdev,
+ uint32_t mem_type,
+ const struct ttm_place *place,
+ struct ttm_operation_ctx *ctx,
+ bool *locked);
+void amdgpu_vm_add_to_lru(struct ttm_buffer_object *bo);
+void amdgpu_vm_del_from_lru(struct ttm_buffer_object *bo);
+void amdgpu_vm_move_to_lru_tail(struct ttm_buffer_object *bo);
+
void amdgpu_vm_manager_init(struct amdgpu_device *adev);
void amdgpu_vm_manager_fini(struct amdgpu_device *adev);
int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
--
2.14.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-05-09 6:45 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-09 6:45 [PATCH 00/13] *** per vm lru *** Chunming Zhou
2018-05-09 6:45 ` Chunming Zhou [this message]
2018-05-09 6:45 ` [PATCH 05/13] drm/amdgpu: pass vm lru to buffer object Chunming Zhou
2018-05-09 6:45 ` [PATCH 06/13] drm/amdgpu: add amdgpu lru implementation Chunming Zhou
2018-05-09 6:45 ` [PATCH 07/13] drm/ttm: export ttm_bo_ref_bug Chunming Zhou
2018-05-09 6:45 ` [PATCH 11/13] ttm: export ttm_transfered_destroy Chunming Zhou
[not found] ` <20180509064543.15937-1-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-05-09 6:45 ` [PATCH 01/13] ttm: abstruct evictable bo Chunming Zhou
2018-05-09 8:34 ` Lucas Stach
2018-05-09 9:50 ` Daniel Vetter
2018-05-09 10:06 ` zhoucm1
2018-05-09 16:04 ` Alex Deucher
2018-05-09 6:45 ` [PATCH 02/13] ttm: allow driver has own lru policy Chunming Zhou
2018-05-09 6:45 ` [PATCH 04/13] drm/amdgpu: init/fini vm lru Chunming Zhou
2018-05-09 6:45 ` [PATCH 08/13] drm/amdgpu: use RB tree instead of link list Chunming Zhou
2018-05-09 6:45 ` [PATCH 09/13] drm/amdgpu: add bo index counter Chunming Zhou
2018-05-09 6:45 ` [PATCH 10/13] drm/amdgpu: bulk move per vm bo Chunming Zhou
2018-05-09 6:45 ` [PATCH 12/13] drm/amdgpu: transferred bo doesn't use vm lru Chunming Zhou
2018-05-09 6:45 ` [PATCH 13/13] drm/amdgpu: free vm lru when vm fini Chunming Zhou
2018-05-10 5:07 ` [PATCH 00/13] *** per vm lru *** Zhang, Jerry (Junwei)
[not found] ` <5AF3D38F.1040704-5C7GfCeVMHo@public.gmane.org>
2018-05-10 8:45 ` zhoucm1
2018-05-14 5:44 ` Zhang, Jerry (Junwei)
[not found] ` <8c18f05c-54bc-47c8-8d63-8610420238cc-5C7GfCeVMHo@public.gmane.org>
2018-05-14 5:54 ` Zhang, Jerry (Junwei)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180509064543.15937-4-david1.zhou@amd.com \
--to=david1.zhou@amd.com \
--cc=Jerry.Zhang@amd.com \
--cc=Kai.Guo@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox